From 286a4c5caa1945c8d1cb365a3d90fb09d5700cb2 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 23 Feb 2012 08:14:46 -0500 Subject: Revise the PCM callback system after adding multichannel audio. Additional status callback is added to pcm_play/rec_data instead of using a special function to set it. Status includes DMA error reporting to the status callback. Playback and recording callback become more alike except playback uses "const void **addr" (because the data should not be altered) and recording uses "void **addr". "const" is put in place throughout where appropriate. Most changes are fairly trivial. One that should be checked in particular because it isn't so much is telechips, if anyone cares to bother. PP5002 is not so trivial either but that tested as working. Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2 Reviewed-on: http://gerrit.rockbox.org/166 Reviewed-by: Michael Sevakis Tested-by: Michael Sevakis --- firmware/target/hosted/maemo/pcm-gstreamer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'firmware/target/hosted/maemo') diff --git a/firmware/target/hosted/maemo/pcm-gstreamer.c b/firmware/target/hosted/maemo/pcm-gstreamer.c index e5620d0702..61f33cbadd 100644 --- a/firmware/target/hosted/maemo/pcm-gstreamer.c +++ b/firmware/target/hosted/maemo/pcm-gstreamer.c @@ -189,9 +189,8 @@ static void feed_data(GstElement * appsrc, guint size_hint, void *unused) from inside gstreamer's stream thread as it will deadlock */ inside_feed_data = 1; - pcm_play_get_more_callback((void **)&pcm_data, &pcm_data_size); - - if (pcm_data_size != 0) + if (pcm_play_dma_complete_callback(PCM_DMAST_OK, (const void **)&pcm_data, + &pcm_data_size)) { GstBuffer *buffer = gst_buffer_new (); GstFlowReturn ret; @@ -205,7 +204,7 @@ static void feed_data(GstElement * appsrc, guint size_hint, void *unused) if (ret != 0) DEBUGF("push-buffer error result: %d\n", ret); - pcm_play_dma_started_callback(); + pcm_play_dma_status_callback(PCM_DMAST_STARTED); } else { DEBUGF("feed_data: No Data.\n"); -- cgit v1.2.3