summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/PDa/src
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2012-02-23 08:14:46 -0500
committerMichael Sevakis <jethead71@rockbox.org>2012-03-03 07:23:38 +0100
commit286a4c5caa1945c8d1cb365a3d90fb09d5700cb2 (patch)
tree4835f46d16ec78d035ec9f49333079fe618384c1 /apps/plugins/pdbox/PDa/src
parent3f82f3aca14eb954e55f761721ffdd2684f0e812 (diff)
downloadrockbox-286a4c5caa1945c8d1cb365a3d90fb09d5700cb2.tar.gz
rockbox-286a4c5caa1945c8d1cb365a3d90fb09d5700cb2.zip
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 <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
Diffstat (limited to 'apps/plugins/pdbox/PDa/src')
-rw-r--r--apps/plugins/pdbox/PDa/src/s_audio_rockbox.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c b/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c
index 76a50fa075..6571f74edf 100644
--- a/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c
+++ b/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c
@@ -26,7 +26,7 @@
26#include "s_stuff.h" 26#include "s_stuff.h"
27 27
28/* Declare functions that go to IRAM. */ 28/* Declare functions that go to IRAM. */
29void pdbox_get_more(unsigned char** start, size_t* size) ICODE_ATTR; 29void pdbox_get_more(const void** start, size_t* size) ICODE_ATTR;
30int rockbox_send_dacs(void) ICODE_ATTR; 30int rockbox_send_dacs(void) ICODE_ATTR;
31 31
32/* Extern variables. */ 32/* Extern variables. */
@@ -90,12 +90,12 @@ void rockbox_close_audio(void)
90} 90}
91 91
92/* Rockbox audio callback. */ 92/* Rockbox audio callback. */
93void pdbox_get_more(unsigned char** start, size_t* size) 93void pdbox_get_more(const void** start, size_t* size)
94{ 94{
95 if(outbuf_fill > 0) 95 if(outbuf_fill > 0)
96 { 96 {
97 /* Store output data address and size. */ 97 /* Store output data address and size. */
98 *start = (unsigned char*) outbuf[outbuf_tail].data; 98 *start = outbuf[outbuf_tail].data;
99 *size = sizeof(outbuf[outbuf_tail].data); 99 *size = sizeof(outbuf[outbuf_tail].data);
100 100
101 /* Free this part of output buffer. */ 101 /* Free this part of output buffer. */
@@ -116,8 +116,6 @@ void pdbox_get_more(unsigned char** start, size_t* size)
116 playing = false; 116 playing = false;
117 117
118 /* Nothing to play. */ 118 /* Nothing to play. */
119 *start = NULL;
120 *size = 0;
121 } 119 }
122} 120}
123 121
@@ -185,7 +183,7 @@ int rockbox_send_dacs(void)
185 if(!playing && outbuf_fill > 0) 183 if(!playing && outbuf_fill > 0)
186 { 184 {
187 /* Start playing. */ 185 /* Start playing. */
188 rb->pcm_play_data(pdbox_get_more, NULL, 0); 186 rb->pcm_play_data(pdbox_get_more, NULL, NULL, 0);
189 187
190 /* Set status flag. */ 188 /* Set status flag. */
191 playing = true; 189 playing = true;