summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2010-11-22 02:22:56 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2010-11-22 02:22:56 +0000
commit7094181157731fa5f224393abae5a3d4353fc79c (patch)
tree7eb72806e8d87f8f2d3f4c3fe80bb7f11072f578 /apps/plugins
parent28ecf9b6d17b79c4b009aabf7b361a0ea734dd51 (diff)
downloadrockbox-7094181157731fa5f224393abae5a3d4353fc79c.zip
rockbox-7094181157731fa5f224393abae5a3d4353fc79c.tar.gz
rockbox-7094181157731fa5f224393abae5a3d4353fc79c.tar.bz2
rockbox-7094181157731fa5f224393abae5a3d4353fc79c.tar.xz
Add option to run test_codec unboosted on players with boosting.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28637 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/test_codec.c55
1 files changed, 47 insertions, 8 deletions
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c
index 91b83b5..c35ca93 100644
--- a/apps/plugins/test_codec.c
+++ b/apps/plugins/test_codec.c
@@ -40,6 +40,16 @@
#define TESTCODEC_EXITBUTTON BUTTON_SELECT
#endif
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+static unsigned int boost =1;
+
+static const struct opt_items boost_settings[2] = {
+ { "No", -1 },
+ { "Yes", -1 },
+};
+
+#endif
+
/* Log functions copied from test_disk.c */
static int line = 0;
static int max_line = 0;
@@ -759,7 +769,14 @@ static enum plugin_status test_track(const char* filename)
/* show effective clockrate in MHz needed for realtime decoding */
if (speed > 0)
{
- speed = CPUFREQ_MAX / speed;
+ int freq = CPUFREQ_MAX;
+
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+ if(!boost)
+ freq = CPUFREQ_NORMAL;
+#endif
+
+ speed = freq / speed;
rb->snprintf(str,sizeof(str),"%d.%02dMHz needed for realtime",
(int)speed/100,(int)speed%100);
log_text(str,true);
@@ -809,9 +826,6 @@ enum plugin_status plugin_start(const void* parameter)
audiobuf = SKIPBYTES(codec_mallocbuf, CODEC_SIZE);
audiosize -= CODEC_SIZE;
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
- rb->cpu_boost(true);
-#endif
rb->lcd_clear_display();
rb->lcd_update();
@@ -819,6 +833,9 @@ enum plugin_status plugin_start(const void* parameter)
{
SPEED_TEST = 0,
SPEED_TEST_DIR,
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+ BOOST,
+#endif
WRITE_WAV,
SPEED_TEST_WITH_DSP,
SPEED_TEST_DIR_WITH_DSP,
@@ -832,6 +849,9 @@ enum plugin_status plugin_start(const void* parameter)
menu, "test_codec", NULL,
"Speed test",
"Speed test folder",
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+ "Boosting",
+#endif
"Write WAV",
"Speed test with DSP",
"Speed test folder with DSP",
@@ -840,18 +860,35 @@ enum plugin_status plugin_start(const void* parameter)
"Checksum folder",
"Quit",
);
+
show_menu:
rb->lcd_clear_display();
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+menu:
result = rb->do_menu(&menu, &selection, NULL, false);
+
+ if (result == BOOST)
+ {
+ rb->set_option("Boosting", &boost, INT,
+ boost_settings, 2, NULL);
+ goto menu;
+ }
+#endif
+
if (result == QUIT)
{
res = PLUGIN_OK;
goto exit;
}
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+ if(boost)
+ rb->cpu_boost(true);
+#endif
+
scandir = 0;
if ((checksum = (result == CHECKSUM || result == CHECKSUM_DIR)))
@@ -927,15 +964,17 @@ show_menu:
}
while (rb->button_get(true) != TESTCODEC_EXITBUTTON);
}
+
+ #ifdef HAVE_ADJUSTABLE_CPU_FREQ
+ if(boost)
+ rb->cpu_boost(false);
+ #endif
+
rb->button_clear_queue();
goto show_menu;
exit:
log_close();
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
- rb->cpu_boost(false);
-#endif
-
return res;
}