summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-10-25 21:27:45 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-10-25 21:27:45 +0000
commit3e3c43c74712e02226f157ecc325ff3302417c6f (patch)
tree9739339d7815501060e87315739881c588f05a9f /apps/debug_menu.c
parentccbe242453112054e5219615e112b0d1cb518063 (diff)
downloadrockbox-3e3c43c74712e02226f157ecc325ff3302417c6f.tar.gz
rockbox-3e3c43c74712e02226f157ecc325ff3302417c6f.zip
Finally commit Metadata on Buffer!
buffering.c and buffering.h implement the new buffering API. playback.c is translated to that API. For more information about the whole concept, see http://www.rockbox.org/wiki/MetadataOnBuffer. There should be no major visible changes, but most existing bugs remain (though fixing them should be easier now that playback.c is a bit less complex) and there probably will be new ones. Please report any problem! Next step is to adapt cuesheet support, which is partly disabled here, and of course fix as much bugs as possible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15306 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c51
1 files changed, 42 insertions, 9 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index de40226758..c9d962ece4 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -75,6 +75,7 @@
75#include "logfdisp.h" 75#include "logfdisp.h"
76#if CONFIG_CODEC == SWCODEC 76#if CONFIG_CODEC == SWCODEC
77#include "pcmbuf.h" 77#include "pcmbuf.h"
78#include "buffering.h"
78#if defined(HAVE_SPDIF_OUT) || defined(HAVE_SPDIF_IN) 79#if defined(HAVE_SPDIF_OUT) || defined(HAVE_SPDIF_IN)
79#include "spdif.h" 80#include "spdif.h"
80#endif 81#endif
@@ -261,7 +262,7 @@ static void dbg_audio_task(void)
261 ticks++; 262 ticks++;
262} 263}
263 264
264static bool dbg_audio_thread(void) 265static bool dbg_buffering_thread(void)
265{ 266{
266 char buf[32]; 267 char buf[32];
267 int button; 268 int button;
@@ -270,6 +271,7 @@ static bool dbg_audio_thread(void)
270 size_t bufused; 271 size_t bufused;
271 size_t bufsize = pcmbuf_get_bufsize(); 272 size_t bufsize = pcmbuf_get_bufsize();
272 int pcmbufdescs = pcmbuf_descs(); 273 int pcmbufdescs = pcmbuf_descs();
274 struct buffering_debug d;
273 275
274 ticks = boost_ticks = 0; 276 ticks = boost_ticks = 0;
275 277
@@ -292,6 +294,9 @@ static bool dbg_audio_thread(void)
292 done = true; 294 done = true;
293 break; 295 break;
294 } 296 }
297
298 buffering_get_debugdata(&d);
299
295 line = 0; 300 line = 0;
296 lcd_clear_display(); 301 lcd_clear_display();
297 302
@@ -300,19 +305,45 @@ static bool dbg_audio_thread(void)
300 snprintf(buf, sizeof(buf), "pcm: %7ld/%7ld", (long) bufused, (long) bufsize); 305 snprintf(buf, sizeof(buf), "pcm: %7ld/%7ld", (long) bufused, (long) bufsize);
301 lcd_puts(0, line++, buf); 306 lcd_puts(0, line++, buf);
302 307
303 /* Playable space left */ 308 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6,
304 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6, bufsize, 0, bufused, HORIZONTAL); 309 bufsize, 0, bufused, HORIZONTAL);
305 line++; 310 line++;
306 311
307 snprintf(buf, sizeof(buf), "codec: %8ld/%8ld", audio_filebufused(), (long) filebuflen); 312 snprintf(buf, sizeof(buf), "alloc: %8ld/%8ld", audio_filebufused(),
313 (long) filebuflen);
308 lcd_puts(0, line++, buf); 314 lcd_puts(0, line++, buf);
309 315
310 /* Playable space left */ 316#if LCD_HEIGHT > 80
311 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6, filebuflen, 0, 317 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6,
312 audio_filebufused(), HORIZONTAL); 318 filebuflen, 0, audio_filebufused(), HORIZONTAL);
319 line++;
320
321 snprintf(buf, sizeof(buf), "real: %8ld/%8ld", (long)d.buffered_data,
322 (long)filebuflen);
323 lcd_puts(0, line++, buf);
324
325 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6,
326 filebuflen, 0, (long)d.buffered_data, HORIZONTAL);
327 line++;
328#endif
329
330 snprintf(buf, sizeof(buf), "usefl: %8ld/%8ld", (long)(d.useful_data),
331 (long)filebuflen);
332 lcd_puts(0, line++, buf);
333
334#if LCD_HEIGHT > 80
335 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6,
336 filebuflen, 0, d.useful_data, HORIZONTAL);
313 line++; 337 line++;
338#endif
314 339
315 snprintf(buf, sizeof(buf), "track count: %2d", audio_track_count()); 340 snprintf(buf, sizeof(buf), "data_rem: %ld", (long)d.data_rem);
341 lcd_puts(0, line++, buf);
342
343 snprintf(buf, sizeof(buf), "track count: %2d", audio_track_count()-1);
344 lcd_puts(0, line++, buf);
345
346 snprintf(buf, sizeof(buf), "handle count: %d", (int)d.num_handles);
316 lcd_puts(0, line++, buf); 347 lcd_puts(0, line++, buf);
317 348
318#ifndef SIMULATOR 349#ifndef SIMULATOR
@@ -2241,7 +2272,9 @@ static const struct the_menu_item menuitems[] = {
2241 { "View database info", dbg_tagcache_info }, 2272 { "View database info", dbg_tagcache_info },
2242#endif 2273#endif
2243#ifdef HAVE_LCD_BITMAP 2274#ifdef HAVE_LCD_BITMAP
2244#if CONFIG_CODEC == SWCODEC || !defined(SIMULATOR) 2275#if CONFIG_CODEC == SWCODEC
2276 { "View buffering thread", dbg_buffering_thread },
2277#elif !defined(SIMULATOR)
2245 { "View audio thread", dbg_audio_thread }, 2278 { "View audio thread", dbg_audio_thread },
2246#endif 2279#endif
2247#ifdef PM_DEBUG 2280#ifdef PM_DEBUG