summaryrefslogtreecommitdiff
path: root/apps/codecs.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs.h')
-rw-r--r--apps/codecs.h52
1 files changed, 27 insertions, 25 deletions
diff --git a/apps/codecs.h b/apps/codecs.h
index ad6b831b61..fb5675fd84 100644
--- a/apps/codecs.h
+++ b/apps/codecs.h
@@ -80,12 +80,12 @@
80#define CODEC_ENC_MAGIC 0x52454E43 /* RENC */ 80#define CODEC_ENC_MAGIC 0x52454E43 /* RENC */
81 81
82/* increase this every time the api struct changes */ 82/* increase this every time the api struct changes */
83#define CODEC_API_VERSION 22 83#define CODEC_API_VERSION 23
84 84
85/* update this to latest version if a change to the api struct breaks 85/* update this to latest version if a change to the api struct breaks
86 backwards compatibility (and please take the opportunity to sort in any 86 backwards compatibility (and please take the opportunity to sort in any
87 new function which are "waiting" at the end of the function table) */ 87 new function which are "waiting" at the end of the function table) */
88#define CODEC_MIN_API_VERSION 22 88#define CODEC_MIN_API_VERSION 23
89 89
90/* codec return codes */ 90/* codec return codes */
91enum codec_status { 91enum codec_status {
@@ -118,6 +118,9 @@ struct codec_api {
118 /* If seek_time != 0, codec should seek to that song position (in ms) 118 /* If seek_time != 0, codec should seek to that song position (in ms)
119 if codec supports seeking. */ 119 if codec supports seeking. */
120 long seek_time; 120 long seek_time;
121
122 /* The dsp instance to be used for audio output */
123 struct dsp_config *dsp;
121 124
122 /* Returns buffer to malloc array. Only codeclib should need this. */ 125 /* Returns buffer to malloc array. Only codeclib should need this. */
123 void* (*get_codec_memory)(size_t *size); 126 void* (*get_codec_memory)(size_t *size);
@@ -160,6 +163,28 @@ struct codec_api {
160 void (*PREFIX(sleep))(int ticks); 163 void (*PREFIX(sleep))(int ticks);
161 void (*yield)(void); 164 void (*yield)(void);
162 165
166#if NUM_CORES > 1
167 struct thread_entry *
168 (*create_thread)(void (*function)(void), void* stack,
169 size_t stack_size, unsigned flags, const char *name
170 IF_PRIO(, int priority)
171 IF_COP(, unsigned int core));
172
173 void (*thread_thaw)(struct thread_entry *thread);
174 void (*thread_wait)(struct thread_entry *thread);
175 void (*semaphore_init)(struct semaphore *s, int max, int start);
176 void (*semaphore_wait)(struct semaphore *s);
177 void (*semaphore_release)(struct semaphore *s);
178 void (*event_init)(struct event *e, unsigned int flags);
179 void (*event_wait)(struct event *e, unsigned int for_state);
180 void (*event_set_state)(struct event *e, unsigned int state);
181#endif /* NUM_CORES */
182
183#ifdef CACHE_FUNCTIONS_AS_CALL
184 void (*flush_icache)(void);
185 void (*invalidate_icache)(void);
186#endif
187
163 /* strings and memory */ 188 /* strings and memory */
164 char* (*strcpy)(char *dst, const char *src); 189 char* (*strcpy)(char *dst, const char *src);
165 char* (*strncpy)(char *dst, const char *src, size_t length); 190 char* (*strncpy)(char *dst, const char *src, size_t length);
@@ -218,29 +243,6 @@ struct codec_api {
218 /* new stuff at the end, sort into place next time 243 /* new stuff at the end, sort into place next time
219 the API gets incompatible */ 244 the API gets incompatible */
220 245
221#ifdef CACHE_FUNCTIONS_AS_CALL
222 void (*flush_icache)(void);
223 void (*invalidate_icache)(void);
224#endif
225
226 struct dsp_config *dsp;
227
228#if NUM_CORES > 1
229 struct thread_entry *
230 (*create_thread)(void (*function)(void), void* stack,
231 int stack_size, unsigned flags, const char *name
232 IF_PRIO(, int priority)
233 IF_COP(, unsigned int core));
234
235 void (*thread_thaw)(struct thread_entry *thread);
236 void (*thread_wait)(struct thread_entry *thread);
237 void (*semaphore_init)(struct semaphore *s, int max, int start);
238 void (*semaphore_wait)(struct semaphore *s);
239 void (*semaphore_release)(struct semaphore *s);
240 void (*event_init)(struct event *e, unsigned int flags);
241 void (*event_wait)(struct event *e, unsigned int for_state);
242 void (*event_set_state)(struct event *e, unsigned int state);
243#endif /* NUM_CORES */
244}; 246};
245 247
246/* codec header */ 248/* codec header */