diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/battery_test.c | 2 | ||||
-rw-r--r-- | apps/plugins/jpeg.c | 2 | ||||
-rw-r--r-- | apps/plugins/lib/xxx2wav.c | 14 | ||||
-rw-r--r-- | apps/plugins/rockboy.c | 9 | ||||
-rw-r--r-- | apps/plugins/rockboy/rockboy.c | 34 | ||||
-rw-r--r-- | apps/plugins/sort.c | 2 | ||||
-rw-r--r-- | apps/plugins/vbrfix.c | 26 | ||||
-rw-r--r-- | apps/plugins/video.c | 2 |
8 files changed, 46 insertions, 45 deletions
diff --git a/apps/plugins/battery_test.c b/apps/plugins/battery_test.c index 73affddf8b..47042e6cf0 100644 --- a/apps/plugins/battery_test.c +++ b/apps/plugins/battery_test.c | |||
@@ -48,7 +48,7 @@ int buffersize; | |||
48 | int init(void) | 48 | int init(void) |
49 | { | 49 | { |
50 | int f; | 50 | int f; |
51 | buffer = rb->plugin_get_mp3_buffer(&buffersize); | 51 | buffer = rb->plugin_get_audio_buffer(&buffersize); |
52 | 52 | ||
53 | #ifdef HAVE_MMC | 53 | #ifdef HAVE_MMC |
54 | /* present info what's going on. MMC is slow. */ | 54 | /* present info what's going on. MMC is slow. */ |
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c index f705271240..7ca59b29cd 100644 --- a/apps/plugins/jpeg.c +++ b/apps/plugins/jpeg.c | |||
@@ -1824,7 +1824,7 @@ int main(char* filename) | |||
1824 | 1824 | ||
1825 | rb->memset(&disp, 0, sizeof(disp)); | 1825 | rb->memset(&disp, 0, sizeof(disp)); |
1826 | 1826 | ||
1827 | buf = rb->plugin_get_mp3_buffer(&buf_size); /* start munching memory */ | 1827 | buf = rb->plugin_get_audio_buffer(&buf_size); /* start munching memory */ |
1828 | 1828 | ||
1829 | 1829 | ||
1830 | /* initialize the grayscale buffer: | 1830 | /* initialize the grayscale buffer: |
diff --git a/apps/plugins/lib/xxx2wav.c b/apps/plugins/lib/xxx2wav.c index 4d0c139f1b..d864527fc2 100644 --- a/apps/plugins/lib/xxx2wav.c +++ b/apps/plugins/lib/xxx2wav.c | |||
@@ -29,9 +29,9 @@ static struct plugin_api* local_rb; | |||
29 | 29 | ||
30 | int mem_ptr; | 30 | int mem_ptr; |
31 | int bufsize; | 31 | int bufsize; |
32 | unsigned char* mp3buf; // The actual MP3 buffer from Rockbox | 32 | unsigned char* audiobuf; // The actual audio buffer from Rockbox |
33 | unsigned char* mallocbuf; // 512K from the start of MP3 buffer | 33 | unsigned char* mallocbuf; // 512K from the start of audio buffer |
34 | unsigned char* filebuf; // The rest of the MP3 buffer | 34 | unsigned char* filebuf; // The rest of the audio buffer |
35 | 35 | ||
36 | void* codec_malloc(size_t size) { | 36 | void* codec_malloc(size_t size) { |
37 | void* x; | 37 | void* x; |
@@ -169,11 +169,11 @@ int local_init(char* infilename, char* outfilename, file_info_struct* file_info, | |||
169 | local_rb=rb; | 169 | local_rb=rb; |
170 | 170 | ||
171 | mem_ptr=0; | 171 | mem_ptr=0; |
172 | mp3buf=local_rb->plugin_get_mp3_buffer(&bufsize); | 172 | audiobuf=local_rb->plugin_get_audio_buffer(&bufsize); |
173 | mallocbuf=mp3buf; | 173 | mallocbuf=audiobuf; |
174 | filebuf=&mp3buf[MALLOC_BUFSIZE]; | 174 | filebuf=&audiobuf[MALLOC_BUFSIZE]; |
175 | 175 | ||
176 | local_rb->snprintf(s,32,"mp3 bufsize: %d",bufsize); | 176 | local_rb->snprintf(s,32,"audio bufsize: %d",bufsize); |
177 | local_rb->lcd_putsxy(0,100,s); | 177 | local_rb->lcd_putsxy(0,100,s); |
178 | local_rb->lcd_update(); | 178 | local_rb->lcd_update(); |
179 | 179 | ||
diff --git a/apps/plugins/rockboy.c b/apps/plugins/rockboy.c index 4778fa8ee6..d531c9405b 100644 --- a/apps/plugins/rockboy.c +++ b/apps/plugins/rockboy.c | |||
@@ -26,8 +26,8 @@ | |||
26 | #define OVL_DISPLAYNAME "RockBoy" | 26 | #define OVL_DISPLAYNAME "RockBoy" |
27 | 27 | ||
28 | struct plugin_api* rb; | 28 | struct plugin_api* rb; |
29 | unsigned char *mp3buf; | 29 | unsigned char *audiobuf; |
30 | int mp3buf_size; | 30 | int audiobuf_size; |
31 | 31 | ||
32 | /* this is the plugin entry point */ | 32 | /* this is the plugin entry point */ |
33 | enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | 33 | enum plugin_status plugin_start(struct plugin_api* api, void* parameter) |
@@ -60,8 +60,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
60 | return PLUGIN_ERROR; | 60 | return PLUGIN_ERROR; |
61 | } | 61 | } |
62 | 62 | ||
63 | mp3buf = rb->plugin_get_mp3_buffer(&mp3buf_size); | 63 | audiobuf = rb->plugin_get_audio_buffer(&audiobuf_size); |
64 | if (header.start_addr < mp3buf || header.end_addr > mp3buf + mp3buf_size) | 64 | if (header.start_addr < audiobuf || |
65 | header.end_addr > audiobuf + audiobuf_size) | ||
65 | { | 66 | { |
66 | rb->close(fh); | 67 | rb->close(fh); |
67 | rb->splash(2*HZ, true, OVL_DISPLAYNAME | 68 | rb->splash(2*HZ, true, OVL_DISPLAYNAME |
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index c6d006a131..1b4c0c7a7d 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c | |||
@@ -59,37 +59,37 @@ void die(char *message, ...) | |||
59 | errormsg=message; | 59 | errormsg=message; |
60 | } | 60 | } |
61 | 61 | ||
62 | void *mp3_bufferbase; | 62 | void *audio_bufferbase; |
63 | void *mp3_bufferpointer; | 63 | void *audio_bufferpointer; |
64 | unsigned int mp3_buffer_free; | 64 | unsigned int audio_buffer_free; |
65 | 65 | ||
66 | void *my_malloc(size_t size) | 66 | void *my_malloc(size_t size) |
67 | { | 67 | { |
68 | void *alloc; | 68 | void *alloc; |
69 | 69 | ||
70 | if (!mp3_bufferbase) | 70 | if (!audio_bufferbase) |
71 | { | 71 | { |
72 | mp3_bufferbase = mp3_bufferpointer | 72 | audio_bufferbase = audio_bufferpointer |
73 | = rb->plugin_get_mp3_buffer(&mp3_buffer_free); | 73 | = rb->plugin_get_audio_buffer(&audio_buffer_free); |
74 | #if MEM <= 8 && !defined(SIMULATOR) | 74 | #if MEM <= 8 && !defined(SIMULATOR) |
75 | /* loaded as an overlay, protect from overwriting ourselves */ | 75 | /* loaded as an overlay, protect from overwriting ourselves */ |
76 | if ((unsigned)(ovl_start_addr - (unsigned char *)mp3_bufferbase) | 76 | if ((unsigned)(ovl_start_addr - (unsigned char *)audio_bufferbase) |
77 | < mp3_buffer_free) | 77 | < audio_buffer_free) |
78 | mp3_buffer_free = ovl_start_addr - (unsigned char *)mp3_bufferbase; | 78 | audio_buffer_free = ovl_start_addr - (unsigned char *)audio_bufferbase; |
79 | #endif | 79 | #endif |
80 | } | 80 | } |
81 | if (size + 4 > mp3_buffer_free) | 81 | if (size + 4 > audio_buffer_free) |
82 | return 0; | 82 | return 0; |
83 | alloc = mp3_bufferpointer; | 83 | alloc = audio_bufferpointer; |
84 | mp3_bufferpointer += size + 4; | 84 | audio_bufferpointer += size + 4; |
85 | mp3_buffer_free -= size + 4; | 85 | audio_buffer_free -= size + 4; |
86 | return alloc; | 86 | return alloc; |
87 | } | 87 | } |
88 | 88 | ||
89 | void setmallocpos(void *pointer) | 89 | void setmallocpos(void *pointer) |
90 | { | 90 | { |
91 | mp3_bufferpointer = pointer; | 91 | audio_bufferpointer = pointer; |
92 | mp3_buffer_free = mp3_bufferpointer - mp3_bufferbase; | 92 | audio_buffer_free = audio_bufferpointer - audio_bufferbase; |
93 | } | 93 | } |
94 | 94 | ||
95 | /* this is the plugin entry point */ | 95 | /* this is the plugin entry point */ |
@@ -113,8 +113,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
113 | #endif | 113 | #endif |
114 | shut=0; | 114 | shut=0; |
115 | cleanshut=0; | 115 | cleanshut=0; |
116 | mp3_bufferbase=mp3_bufferpointer=0; | 116 | audio_bufferbase=audio_bufferpointer=0; |
117 | mp3_buffer_free=0; | 117 | audio_buffer_free=0; |
118 | 118 | ||
119 | /* now go ahead and have fun! */ | 119 | /* now go ahead and have fun! */ |
120 | /* rb->splash(HZ*2, true, "Rockboy v0.3"); */ | 120 | /* rb->splash(HZ*2, true, "Rockboy v0.3"); */ |
diff --git a/apps/plugins/sort.c b/apps/plugins/sort.c index b17f5a441a..cf91dbb4dd 100644 --- a/apps/plugins/sort.c +++ b/apps/plugins/sort.c | |||
@@ -184,7 +184,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
184 | 184 | ||
185 | rb = api; | 185 | rb = api; |
186 | 186 | ||
187 | buf = rb->plugin_get_mp3_buffer(&buf_size); /* start munching memory */ | 187 | buf = rb->plugin_get_audio_buffer(&buf_size); /* start munching memory */ |
188 | 188 | ||
189 | stringbuffer = buf; | 189 | stringbuffer = buf; |
190 | pointers = (char **)(buf + buf_size - sizeof(int)); | 190 | pointers = (char **)(buf + buf_size - sizeof(int)); |
diff --git a/apps/plugins/vbrfix.c b/apps/plugins/vbrfix.c index 0077340ec9..7fb072c656 100644 --- a/apps/plugins/vbrfix.c +++ b/apps/plugins/vbrfix.c | |||
@@ -20,8 +20,8 @@ | |||
20 | 20 | ||
21 | static struct plugin_api* rb; | 21 | static struct plugin_api* rb; |
22 | 22 | ||
23 | static char *mp3buf; | 23 | static char *audiobuf; |
24 | static int mp3buflen; | 24 | static int audiobuflen; |
25 | 25 | ||
26 | static void xingupdate(int percent) | 26 | static void xingupdate(int percent) |
27 | { | 27 | { |
@@ -56,14 +56,14 @@ static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes) | |||
56 | 56 | ||
57 | /* First, copy the initial portion (the ID3 tag) */ | 57 | /* First, copy the initial portion (the ID3 tag) */ |
58 | if(fpos) { | 58 | if(fpos) { |
59 | readlen = rb->read(orig_fd, mp3buf, fpos); | 59 | readlen = rb->read(orig_fd, audiobuf, fpos); |
60 | if(readlen < 0) { | 60 | if(readlen < 0) { |
61 | rb->close(fd); | 61 | rb->close(fd); |
62 | rb->close(orig_fd); | 62 | rb->close(orig_fd); |
63 | return 10*readlen - 3; | 63 | return 10*readlen - 3; |
64 | } | 64 | } |
65 | 65 | ||
66 | rc = rb->write(fd, mp3buf, readlen); | 66 | rc = rb->write(fd, audiobuf, readlen); |
67 | if(rc < 0) { | 67 | if(rc < 0) { |
68 | rb->close(fd); | 68 | rb->close(fd); |
69 | rb->close(orig_fd); | 69 | rb->close(orig_fd); |
@@ -81,14 +81,14 @@ static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes) | |||
81 | 81 | ||
82 | /* Copy the file */ | 82 | /* Copy the file */ |
83 | do { | 83 | do { |
84 | readlen = rb->read(orig_fd, mp3buf, mp3buflen); | 84 | readlen = rb->read(orig_fd, audiobuf, audiobuflen); |
85 | if(readlen < 0) { | 85 | if(readlen < 0) { |
86 | rb->close(fd); | 86 | rb->close(fd); |
87 | rb->close(orig_fd); | 87 | rb->close(orig_fd); |
88 | return 10*readlen - 7; | 88 | return 10*readlen - 7; |
89 | } | 89 | } |
90 | 90 | ||
91 | rc = rb->write(fd, mp3buf, readlen); | 91 | rc = rb->write(fd, audiobuf, readlen); |
92 | if(rc < 0) { | 92 | if(rc < 0) { |
93 | rb->close(fd); | 93 | rb->close(fd); |
94 | rb->close(orig_fd); | 94 | rb->close(orig_fd); |
@@ -193,8 +193,8 @@ static bool vbr_fix(char *selected_file) | |||
193 | and write it to the file */ | 193 | and write it to the file */ |
194 | if(unused_space) | 194 | if(unused_space) |
195 | { | 195 | { |
196 | rb->memset(mp3buf, 0, unused_space); | 196 | rb->memset(audiobuf, 0, unused_space); |
197 | rc = rb->write(fd, mp3buf, unused_space); | 197 | rc = rb->write(fd, audiobuf, unused_space); |
198 | if(rc < 0) { | 198 | if(rc < 0) { |
199 | rb->close(fd); | 199 | rb->close(fd); |
200 | fileerror(rc); | 200 | fileerror(rc); |
@@ -230,20 +230,20 @@ static bool vbr_fix(char *selected_file) | |||
230 | DEBUGF("Inserting 4096+%d bytes\n", framelen); | 230 | DEBUGF("Inserting 4096+%d bytes\n", framelen); |
231 | numbytes = 4096 + framelen; | 231 | numbytes = 4096 + framelen; |
232 | 232 | ||
233 | rb->memset(mp3buf + 0x100000, 0, numbytes); | 233 | rb->memset(audiobuf + 0x100000, 0, numbytes); |
234 | 234 | ||
235 | /* Insert the ID3 header */ | 235 | /* Insert the ID3 header */ |
236 | rb->memcpy(mp3buf + 0x100000, empty_id3_header, | 236 | rb->memcpy(audiobuf + 0x100000, empty_id3_header, |
237 | sizeof(empty_id3_header)); | 237 | sizeof(empty_id3_header)); |
238 | } | 238 | } |
239 | 239 | ||
240 | /* Copy the Xing header */ | 240 | /* Copy the Xing header */ |
241 | rb->memcpy(mp3buf + 0x100000 + numbytes - framelen, | 241 | rb->memcpy(audiobuf + 0x100000 + numbytes - framelen, |
242 | xingbuf, framelen); | 242 | xingbuf, framelen); |
243 | 243 | ||
244 | rc = insert_data_in_file(selected_file, | 244 | rc = insert_data_in_file(selected_file, |
245 | entry.first_frame_offset, | 245 | entry.first_frame_offset, |
246 | mp3buf + 0x100000, numbytes); | 246 | audiobuf + 0x100000, numbytes); |
247 | 247 | ||
248 | if(rc < 0) { | 248 | if(rc < 0) { |
249 | fileerror(rc); | 249 | fileerror(rc); |
@@ -272,7 +272,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void *parameter) | |||
272 | if (!parameter) | 272 | if (!parameter) |
273 | return PLUGIN_ERROR; | 273 | return PLUGIN_ERROR; |
274 | 274 | ||
275 | mp3buf = rb->plugin_get_mp3_buffer(&mp3buflen); | 275 | audiobuf = rb->plugin_get_audio_buffer(&audiobuflen); |
276 | 276 | ||
277 | vbr_fix(parameter); | 277 | vbr_fix(parameter); |
278 | 278 | ||
diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 0257ad26b7..db371392d5 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c | |||
@@ -864,7 +864,7 @@ int main(char* filename) | |||
864 | // init buffer | 864 | // init buffer |
865 | rb->memset(&gBuf, 0, sizeof(gBuf)); | 865 | rb->memset(&gBuf, 0, sizeof(gBuf)); |
866 | gBuf.pOSD = rb->lcd_framebuffer + LCD_WIDTH*7; // last screen line | 866 | gBuf.pOSD = rb->lcd_framebuffer + LCD_WIDTH*7; // last screen line |
867 | gBuf.pBufStart = rb->plugin_get_mp3_buffer(&gBuf.bufsize); | 867 | gBuf.pBufStart = rb->plugin_get_audio_buffer(&gBuf.bufsize); |
868 | //gBuf.bufsize = 1700*1024; // test, like 2MB version!!!! | 868 | //gBuf.bufsize = 1700*1024; // test, like 2MB version!!!! |
869 | gBuf.pBufFill = gBuf.pBufStart; // all empty | 869 | gBuf.pBufFill = gBuf.pBufStart; // all empty |
870 | 870 | ||