summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2006-02-03 00:12:11 +0000
committerBrandon Low <lostlogic@rockbox.org>2006-02-03 00:12:11 +0000
commitd2e75bf02d1ad91fca0e283e8c71b1091ec85a80 (patch)
tree49e59cc25f26b9bd9c97bcb37adfe05204b70119
parent9b0822d76a6f2f2dd1e28cef4a525d0fb752278e (diff)
downloadrockbox-d2e75bf02d1ad91fca0e283e8c71b1091ec85a80.tar.gz
rockbox-d2e75bf02d1ad91fca0e283e8c71b1091ec85a80.zip
Remove exported pcm functions. Codecs should never be allowed to access
the pcm directly. Only through the callbacks in playback.c. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8544 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs.c16
-rw-r--r--apps/codecs.h17
2 files changed, 8 insertions, 25 deletions
diff --git a/apps/codecs.c b/apps/codecs.c
index 6720de909c..380816ba40 100644
--- a/apps/codecs.c
+++ b/apps/codecs.c
@@ -50,10 +50,6 @@
50#include "database.h" 50#include "database.h"
51#include "splash.h" 51#include "splash.h"
52 52
53#if (CONFIG_CODEC == SWCODEC)
54#include "pcm_playback.h"
55#endif
56
57#ifdef SIMULATOR 53#ifdef SIMULATOR
58#if CONFIG_CODEC == SWCODEC 54#if CONFIG_CODEC == SWCODEC
59unsigned char codecbuf[CODEC_SIZE]; 55unsigned char codecbuf[CODEC_SIZE];
@@ -162,13 +158,6 @@ struct codec_api ci = {
162 mp3_play_pause, 158 mp3_play_pause,
163 mp3_play_stop, 159 mp3_play_stop,
164 mp3_is_playing, 160 mp3_is_playing,
165#if CONFIG_CODEC == SWCODEC
166 pcm_play_data,
167 pcm_play_stop,
168 pcm_set_frequency,
169 pcm_is_playing,
170 pcm_play_pause,
171#endif
172#endif 161#endif
173 162
174 /* playback control */ 163 /* playback control */
@@ -216,8 +205,6 @@ struct codec_api ci = {
216 battery_level, 205 battery_level,
217 battery_level_safe, 206 battery_level_safe,
218 207
219 /* new stuff at the end, sort into place next time
220 the API gets incompatible */
221#ifdef RB_PROFILE 208#ifdef RB_PROFILE
222 profile_thread, 209 profile_thread,
223 profstop, 210 profstop,
@@ -225,6 +212,9 @@ struct codec_api ci = {
225 profile_func_exit, 212 profile_func_exit,
226#endif 213#endif
227 214
215 /* new stuff at the end, sort into place next time
216 the API gets incompatible */
217
228}; 218};
229 219
230int codec_load_ram(char* codecptr, int size, void* ptr2, int bufwrap, 220int codec_load_ram(char* codecptr, int size, void* ptr2, int bufwrap,
diff --git a/apps/codecs.h b/apps/codecs.h
index 70799f790e..6e2ef9882c 100644
--- a/apps/codecs.h
+++ b/apps/codecs.h
@@ -48,7 +48,6 @@
48#endif 48#endif
49#if (CONFIG_CODEC == SWCODEC) 49#if (CONFIG_CODEC == SWCODEC)
50#include "dsp.h" 50#include "dsp.h"
51#include "pcm_playback.h"
52#include "playback.h" 51#include "playback.h"
53#endif 52#endif
54#include "settings.h" 53#include "settings.h"
@@ -86,12 +85,12 @@
86#define CODEC_MAGIC 0x52434F44 /* RCOD */ 85#define CODEC_MAGIC 0x52434F44 /* RCOD */
87 86
88/* increase this every time the api struct changes */ 87/* increase this every time the api struct changes */
89#define CODEC_API_VERSION 2 88#define CODEC_API_VERSION 3
90 89
91/* update this to latest version if a change to the api struct breaks 90/* update this to latest version if a change to the api struct breaks
92 backwards compatibility (and please take the opportunity to sort in any 91 backwards compatibility (and please take the opportunity to sort in any
93 new function which are "waiting" at the end of the function table) */ 92 new function which are "waiting" at the end of the function table) */
94#define CODEC_MIN_API_VERSION 1 93#define CODEC_MIN_API_VERSION 3
95 94
96/* codec return codes */ 95/* codec return codes */
97enum codec_status { 96enum codec_status {
@@ -230,13 +229,6 @@ struct codec_api {
230 void (*mp3_play_pause)(bool play); 229 void (*mp3_play_pause)(bool play);
231 void (*mp3_play_stop)(void); 230 void (*mp3_play_stop)(void);
232 bool (*mp3_is_playing)(void); 231 bool (*mp3_is_playing)(void);
233#if CONFIG_CODEC == SWCODEC
234 void (*pcm_play_data)(void (*get_more)(unsigned char** start, long*size));
235 void (*pcm_play_stop)(void);
236 void (*pcm_set_frequency)(unsigned int frequency);
237 bool (*pcm_is_playing)(void);
238 void (*pcm_play_pause)(bool play);
239#endif
240#endif /* !SIMULATOR */ 232#endif /* !SIMULATOR */
241 233
242 /* playback control */ 234 /* playback control */
@@ -290,8 +282,6 @@ struct codec_api {
290 int (*battery_level)(void); 282 int (*battery_level)(void);
291 bool (*battery_level_safe)(void); 283 bool (*battery_level_safe)(void);
292 284
293 /* new stuff at the end, sort into place next time
294 the API gets incompatible */
295#ifdef RB_PROFILE 285#ifdef RB_PROFILE
296 void (*profile_thread)(void); 286 void (*profile_thread)(void);
297 void (*profstop)(void); 287 void (*profstop)(void);
@@ -299,6 +289,9 @@ struct codec_api {
299 void (*profile_func_exit)(void *this_fn, void *call_site); 289 void (*profile_func_exit)(void *this_fn, void *call_site);
300#endif 290#endif
301 291
292 /* new stuff at the end, sort into place next time
293 the API gets incompatible */
294
302}; 295};
303 296
304/* codec header */ 297/* codec header */