summaryrefslogtreecommitdiff
path: root/firmware/pcm_record.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-10-06 22:27:27 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-10-06 22:27:27 +0000
commit6077e5b7c85c0d6f5963e4aadb215faf2c4d10d2 (patch)
treea6bc91ee4168e83617e942eeaea46e5523e82420 /firmware/pcm_record.c
parentf6de0d4083a4fcb6da57f271e1f8ccaf715e571d (diff)
downloadrockbox-6077e5b7c85c0d6f5963e4aadb215faf2c4d10d2.tar.gz
rockbox-6077e5b7c85c0d6f5963e4aadb215faf2c4d10d2.zip
Unify PCM interface just above the hardware driver level for all targets including the sims. Perform lockout of audio callback when changing states. Weird new playback or recording trouble? Check before and after this revision first though things seem quite sound.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15006 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/pcm_record.c')
-rw-r--r--firmware/pcm_record.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c
index a5d0e51c30..ac12fe2ba0 100644
--- a/firmware/pcm_record.c
+++ b/firmware/pcm_record.c
@@ -34,25 +34,8 @@
34 34
35/***************************************************************************/ 35/***************************************************************************/
36 36
37/**
38 * APIs implemented in the target tree portion:
39 * Public -
40 * pcm_init_recording
41 * pcm_close_recording
42 * Semi-private -
43 * pcm_rec_dma_start
44 * pcm_rec_dma_stop
45 */
46
47/** These items may be implemented target specifically or need to
48 be shared semi-privately **/
49extern struct thread_entry *codec_thread_p; 37extern struct thread_entry *codec_thread_p;
50 38
51/* the registered callback function for when more data is available */
52volatile pcm_more_callback_type2 pcm_callback_more_ready = NULL;
53/* DMA transfer in is currently active */
54volatile bool pcm_recording = false;
55
56/** General recording state **/ 39/** General recording state **/
57static bool is_recording; /* We are recording */ 40static bool is_recording; /* We are recording */
58static bool is_paused; /* We have paused */ 41static bool is_paused; /* We have paused */
@@ -1790,25 +1773,3 @@ size_t enc_unget_pcm_data(size_t size)
1790 1773
1791 return 0; 1774 return 0;
1792} /* enc_unget_pcm_data */ 1775} /* enc_unget_pcm_data */
1793
1794/** Low level pcm recording apis **/
1795
1796/****************************************************************************
1797 * Functions that do not require targeted implementation but only a targeted
1798 * interface
1799 */
1800void pcm_record_data(pcm_more_callback_type2 more_ready,
1801 void *start, size_t size)
1802{
1803 if (!(start && size))
1804 return;
1805
1806 pcm_callback_more_ready = more_ready;
1807 pcm_rec_dma_start(start, size);
1808} /* pcm_record_data */
1809
1810void pcm_stop_recording(void)
1811{
1812 if (pcm_recording)
1813 pcm_rec_dma_stop();
1814} /* pcm_stop_recording */