summaryrefslogtreecommitdiff
path: root/apps/codecs.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs.c')
-rw-r--r--apps/codecs.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/apps/codecs.c b/apps/codecs.c
index 25ace4969b..0fe848ecd3 100644
--- a/apps/codecs.c
+++ b/apps/codecs.c
@@ -61,12 +61,14 @@
61#endif 61#endif
62 62
63#if (CONFIG_PLATFORM & PLATFORM_HOSTED) 63#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
64#if CONFIG_CODEC == SWCODEC 64/* For PLATFORM_HOSTED this buffer must be define here. */
65unsigned char codecbuf[CODEC_SIZE]; 65static unsigned char codecbuf[CODEC_SIZE];
66#endif 66#else
67/* For PLATFORM_NATIVE this buffer is defined in *.lds files. */
68extern unsigned char codecbuf[];
67#endif 69#endif
68 70
69size_t codec_size; 71static size_t codec_size;
70 72
71extern void* plugin_get_audio_buffer(size_t *buffer_size); 73extern void* plugin_get_audio_buffer(size_t *buffer_size);
72 74
@@ -171,6 +173,19 @@ void codec_get_full_path(char *path, const char *codec_root_fn)
171 CODECS_DIR, codec_root_fn); 173 CODECS_DIR, codec_root_fn);
172} 174}
173 175
176/* Returns pointer to and size of free codec RAM. Aligns to CACHEALIGN_SIZE. */
177void *codeclib_get_buffer(size_t *size)
178{
179 void *buf = &codecbuf[codec_size];
180 *size = CODEC_SIZE - codec_size;
181 ALIGN_BUFFER(buf, *size, CACHEALIGN_SIZE);
182
183 if (*size <= 0)
184 return NULL;
185
186 return buf;
187}
188
174/** codec loading and call interface **/ 189/** codec loading and call interface **/
175static void *curr_handle = NULL; 190static void *curr_handle = NULL;
176static struct codec_header *c_hdr = NULL; 191static struct codec_header *c_hdr = NULL;