Move implementation of codec_get_buffer() to codec.c, make related variables static.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29839 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2011-05-08 20:18:35 +00:00
parent b452fa061d
commit d68d02ec11
3 changed files with 23 additions and 21 deletions

View file

@ -61,12 +61,14 @@
#endif
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
#if CONFIG_CODEC == SWCODEC
unsigned char codecbuf[CODEC_SIZE];
#endif
/* For PLATFORM_HOSTED this buffer must be define here. */
static unsigned char codecbuf[CODEC_SIZE];
#else
/* For PLATFORM_NATIVE this buffer is defined in *.lds files. */
extern unsigned char codecbuf[];
#endif
size_t codec_size;
static size_t codec_size;
extern void* plugin_get_audio_buffer(size_t *buffer_size);
@ -171,6 +173,19 @@ void codec_get_full_path(char *path, const char *codec_root_fn)
CODECS_DIR, codec_root_fn);
}
/* Returns pointer to and size of free codec RAM. Aligns to CACHEALIGN_SIZE. */
void *codeclib_get_buffer(size_t *size)
{
void *buf = &codecbuf[codec_size];
*size = CODEC_SIZE - codec_size;
ALIGN_BUFFER(buf, *size, CACHEALIGN_SIZE);
if (*size <= 0)
return NULL;
return buf;
}
/** codec loading and call interface **/
static void *curr_handle = NULL;
static struct codec_header *c_hdr = NULL;