diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2012-02-23 08:14:46 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2012-03-03 07:23:38 +0100 |
commit | 286a4c5caa1945c8d1cb365a3d90fb09d5700cb2 (patch) | |
tree | 4835f46d16ec78d035ec9f49333079fe618384c1 /apps/plugin.h | |
parent | 3f82f3aca14eb954e55f761721ffdd2684f0e812 (diff) | |
download | rockbox-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/plugin.h')
-rw-r--r-- | apps/plugin.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/plugin.h b/apps/plugin.h index 2fb085de6d..e07ec92c08 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -153,12 +153,12 @@ void* plugin_get_buffer(size_t *buffer_size); | |||
153 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 153 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
154 | 154 | ||
155 | /* increase this every time the api struct changes */ | 155 | /* increase this every time the api struct changes */ |
156 | #define PLUGIN_API_VERSION 216 | 156 | #define PLUGIN_API_VERSION 217 |
157 | 157 | ||
158 | /* update this to latest version if a change to the api struct breaks | 158 | /* update this to latest version if a change to the api struct breaks |
159 | backwards compatibility (and please take the opportunity to sort in any | 159 | backwards compatibility (and please take the opportunity to sort in any |
160 | new function which are "waiting" at the end of the function table) */ | 160 | new function which are "waiting" at the end of the function table) */ |
161 | #define PLUGIN_MIN_API_VERSION 216 | 161 | #define PLUGIN_MIN_API_VERSION 217 |
162 | 162 | ||
163 | /* plugin return codes */ | 163 | /* plugin return codes */ |
164 | /* internal returns start at 0x100 to make exit(1..255) work */ | 164 | /* internal returns start at 0x100 to make exit(1..255) work */ |
@@ -651,7 +651,8 @@ struct plugin_api { | |||
651 | const unsigned long *hw_freq_sampr; | 651 | const unsigned long *hw_freq_sampr; |
652 | void (*pcm_apply_settings)(void); | 652 | void (*pcm_apply_settings)(void); |
653 | void (*pcm_play_data)(pcm_play_callback_type get_more, | 653 | void (*pcm_play_data)(pcm_play_callback_type get_more, |
654 | unsigned char* start, size_t size); | 654 | pcm_status_callback_type status_cb, |
655 | const void *start, size_t size); | ||
655 | void (*pcm_play_stop)(void); | 656 | void (*pcm_play_stop)(void); |
656 | void (*pcm_set_frequency)(unsigned int frequency); | 657 | void (*pcm_set_frequency)(unsigned int frequency); |
657 | bool (*pcm_is_playing)(void); | 658 | bool (*pcm_is_playing)(void); |
@@ -669,6 +670,7 @@ struct plugin_api { | |||
669 | void (*pcm_init_recording)(void); | 670 | void (*pcm_init_recording)(void); |
670 | void (*pcm_close_recording)(void); | 671 | void (*pcm_close_recording)(void); |
671 | void (*pcm_record_data)(pcm_rec_callback_type more_ready, | 672 | void (*pcm_record_data)(pcm_rec_callback_type more_ready, |
673 | pcm_status_callback_type status_cb, | ||
672 | void *start, size_t size); | 674 | void *start, size_t size); |
673 | void (*pcm_stop_recording)(void); | 675 | void (*pcm_stop_recording)(void); |
674 | void (*pcm_calculate_rec_peaks)(int *left, int *right); | 676 | void (*pcm_calculate_rec_peaks)(int *left, int *right); |
@@ -689,12 +691,13 @@ struct plugin_api { | |||
689 | int (*dsp_output_count)(struct dsp_config *dsp, int count); | 691 | int (*dsp_output_count)(struct dsp_config *dsp, int count); |
690 | 692 | ||
691 | enum channel_status (*mixer_channel_status)(enum pcm_mixer_channel channel); | 693 | enum channel_status (*mixer_channel_status)(enum pcm_mixer_channel channel); |
692 | void * (*mixer_channel_get_buffer)(enum pcm_mixer_channel channel, int *count); | 694 | const void * (*mixer_channel_get_buffer)(enum pcm_mixer_channel channel, |
695 | int *count); | ||
693 | void (*mixer_channel_calculate_peaks)(enum pcm_mixer_channel channel, | 696 | void (*mixer_channel_calculate_peaks)(enum pcm_mixer_channel channel, |
694 | int *left, int *right); | 697 | int *left, int *right); |
695 | void (*mixer_channel_play_data)(enum pcm_mixer_channel channel, | 698 | void (*mixer_channel_play_data)(enum pcm_mixer_channel channel, |
696 | pcm_play_callback_type get_more, | 699 | pcm_play_callback_type get_more, |
697 | unsigned char *start, size_t size); | 700 | const void *start, size_t size); |
698 | void (*mixer_channel_play_pause)(enum pcm_mixer_channel channel, bool play); | 701 | void (*mixer_channel_play_pause)(enum pcm_mixer_channel channel, bool play); |
699 | void (*mixer_channel_stop)(enum pcm_mixer_channel channel); | 702 | void (*mixer_channel_stop)(enum pcm_mixer_channel channel); |
700 | void (*mixer_channel_set_amplitude)(enum pcm_mixer_channel channel, | 703 | void (*mixer_channel_set_amplitude)(enum pcm_mixer_channel channel, |