summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-04-01 05:17:20 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-04-01 05:17:20 +0000
commit8580674b10072b43531660652ff8103c6a980157 (patch)
tree111f6e9278413372812061c8c9f6bd3edf12d572 /apps
parentf047e3aee92a929cbfd6ff0faf12d82c3b468844 (diff)
downloadrockbox-8580674b10072b43531660652ff8103c6a980157.tar.gz
rockbox-8580674b10072b43531660652ff8103c6a980157.zip
Add initial support for changing the LCD mode in MPEG player for hardware YUV conversion (256 color palette mode will also be added for doom and rockboy). This fixes the LCD mode/colors when MPEGPlayer exits.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20600 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugin.c4
-rw-r--r--apps/plugin.h4
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c15
3 files changed, 23 insertions, 0 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index b909a55f46..2126641572 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -633,6 +633,10 @@ static const struct plugin_api rockbox_api = {
633 appsversion, 633 appsversion,
634 /* new stuff at the end, sort into place next time 634 /* new stuff at the end, sort into place next time
635 the API gets incompatible */ 635 the API gets incompatible */
636
637#if defined(HAVE_LCD_MODES)
638 lcd_set_mode,
639#endif
636}; 640};
637 641
638int plugin_load(const char* plugin, const void* parameter) 642int plugin_load(const char* plugin, const void* parameter)
diff --git a/apps/plugin.h b/apps/plugin.h
index 06d8abaaee..8954373d23 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -791,6 +791,10 @@ struct plugin_api {
791 const char *appsversion; 791 const char *appsversion;
792 /* new stuff at the end, sort into place next time 792 /* new stuff at the end, sort into place next time
793 the API gets incompatible */ 793 the API gets incompatible */
794
795#if defined(HAVE_LCD_MODES)
796 void (*lcd_set_mode)(int mode);
797#endif
794}; 798};
795 799
796/* plugin header */ 800/* plugin header */
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 82ebfb1111..055c1b2b84 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -1459,6 +1459,10 @@ static void button_loop(void)
1459 rb->lcd_clear_display(); 1459 rb->lcd_clear_display();
1460 rb->lcd_update(); 1460 rb->lcd_update();
1461 1461
1462#if (HAVE_LCD_MODES & LCD_MODE_YUV)
1463 rb->lcd_set_mode(LCD_MODE_YUV);
1464#endif
1465
1462 wvs_init(); 1466 wvs_init();
1463 1467
1464 /* Start playback at the specified starting time */ 1468 /* Start playback at the specified starting time */
@@ -1537,6 +1541,10 @@ static void button_loop(void)
1537 stream_show_vo(false); 1541 stream_show_vo(false);
1538 wvs_backlight_brightness_video_mode(false); 1542 wvs_backlight_brightness_video_mode(false);
1539 1543
1544#if (HAVE_LCD_MODES & LCD_MODE_YUV)
1545 rb->lcd_set_mode(LCD_MODE_RGB565);
1546#endif
1547
1540 result = mpeg_menu(0); 1548 result = mpeg_menu(0);
1541 1549
1542 /* The menu can change the font, so restore */ 1550 /* The menu can change the font, so restore */
@@ -1549,6 +1557,9 @@ static void button_loop(void)
1549 break; 1557 break;
1550 1558
1551 default: 1559 default:
1560#if (HAVE_LCD_MODES & LCD_MODE_YUV)
1561 rb->lcd_set_mode(LCD_MODE_YUV);
1562#endif
1552 /* If not stopped, show video again */ 1563 /* If not stopped, show video again */
1553 if (state != STREAM_STOPPED) { 1564 if (state != STREAM_STOPPED) {
1554 wvs_show(WVS_SHOW); 1565 wvs_show(WVS_SHOW);
@@ -1707,6 +1718,10 @@ enum plugin_status plugin_start(const void* parameter)
1707 rb->splashf(HZ*2, errstring, err); 1718 rb->splashf(HZ*2, errstring, err);
1708 } 1719 }
1709 } 1720 }
1721
1722#if (HAVE_LCD_MODES & LCD_MODE_YUV)
1723 rb->lcd_set_mode(LCD_MODE_RGB565);
1724#endif
1710 1725
1711 stream_exit(); 1726 stream_exit();
1712 1727