From 8580674b10072b43531660652ff8103c6a980157 Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Wed, 1 Apr 2009 05:17:20 +0000 Subject: 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 --- apps/plugin.c | 4 ++++ apps/plugin.h | 4 ++++ apps/plugins/mpegplayer/mpegplayer.c | 15 +++++++++++++++ 3 files changed, 23 insertions(+) (limited to 'apps') 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 = { appsversion, /* new stuff at the end, sort into place next time the API gets incompatible */ + +#if defined(HAVE_LCD_MODES) + lcd_set_mode, +#endif }; int 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 { const char *appsversion; /* new stuff at the end, sort into place next time the API gets incompatible */ + +#if defined(HAVE_LCD_MODES) + void (*lcd_set_mode)(int mode); +#endif }; /* 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) rb->lcd_clear_display(); rb->lcd_update(); +#if (HAVE_LCD_MODES & LCD_MODE_YUV) + rb->lcd_set_mode(LCD_MODE_YUV); +#endif + wvs_init(); /* Start playback at the specified starting time */ @@ -1537,6 +1541,10 @@ static void button_loop(void) stream_show_vo(false); wvs_backlight_brightness_video_mode(false); +#if (HAVE_LCD_MODES & LCD_MODE_YUV) + rb->lcd_set_mode(LCD_MODE_RGB565); +#endif + result = mpeg_menu(0); /* The menu can change the font, so restore */ @@ -1549,6 +1557,9 @@ static void button_loop(void) break; default: +#if (HAVE_LCD_MODES & LCD_MODE_YUV) + rb->lcd_set_mode(LCD_MODE_YUV); +#endif /* If not stopped, show video again */ if (state != STREAM_STOPPED) { wvs_show(WVS_SHOW); @@ -1707,6 +1718,10 @@ enum plugin_status plugin_start(const void* parameter) rb->splashf(HZ*2, errstring, err); } } + +#if (HAVE_LCD_MODES & LCD_MODE_YUV) + rb->lcd_set_mode(LCD_MODE_RGB565); +#endif stream_exit(); -- cgit v1.2.3