forked from len0rd/rockbox
Codec memory reorganization
Based on a patch by Tomasz Malesinski * Merge Codec buffer and Malloc buffer into one large buffer. * The new merged buffer is now 1MB on targets with lots of memory. * Renamed codec_get_memory to codec_get_buffer and made it behave more. like plugin_get_buffer. * Bumped Codec api and min api versions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18834 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0117705542
commit
2f50cd58b9
45 changed files with 66 additions and 57 deletions
|
@ -66,6 +66,8 @@ void sim_codec_close(void *pd);
|
|||
extern unsigned char codecbuf[];
|
||||
#endif
|
||||
|
||||
size_t codec_size;
|
||||
|
||||
extern void* plugin_get_audio_buffer(size_t *buffer_size);
|
||||
|
||||
struct codec_api ci = {
|
||||
|
@ -78,7 +80,7 @@ struct codec_api ci = {
|
|||
0, /* new_track */
|
||||
0, /* seek_time */
|
||||
NULL, /* struct dsp_config *dsp */
|
||||
NULL, /* get_codec_memory */
|
||||
NULL, /* codec_get_buffer */
|
||||
NULL, /* pcmbuf_insert */
|
||||
NULL, /* set_elapsed */
|
||||
NULL, /* read_filebuf */
|
||||
|
@ -193,6 +195,9 @@ static int codec_load_ram(int size, struct codec_api *api)
|
|||
logf("codec header error");
|
||||
return CODEC_ERROR;
|
||||
}
|
||||
|
||||
codec_size = hdr->end_addr - codecbuf;
|
||||
|
||||
#else /* SIMULATOR */
|
||||
void *pd;
|
||||
|
||||
|
@ -211,6 +216,9 @@ static int codec_load_ram(int size, struct codec_api *api)
|
|||
sim_codec_close(pd);
|
||||
return CODEC_ERROR;
|
||||
}
|
||||
|
||||
codec_size = codecbuf - codecbuf;
|
||||
|
||||
#endif /* SIMULATOR */
|
||||
if (hdr->api_version > CODEC_API_VERSION
|
||||
|| hdr->api_version < CODEC_MIN_API_VERSION) {
|
||||
|
@ -226,7 +234,8 @@ static int codec_load_ram(int size, struct codec_api *api)
|
|||
return status;
|
||||
}
|
||||
|
||||
int codec_load_buf(unsigned int hid, struct codec_api *api) {
|
||||
int codec_load_buf(unsigned int hid, struct codec_api *api)
|
||||
{
|
||||
int rc;
|
||||
rc = bufread(hid, CODEC_SIZE, codecbuf);
|
||||
if (rc < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue