forked from len0rd/rockbox
Greyscale mpegplayer: * Use uncached greyscale buffers on dual core targets, removing the need for special cache handling. * Make the OSD properly disappear when viewing a widescreen or small video.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16052 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
59f0e7023c
commit
753b65737f
7 changed files with 9 additions and 96 deletions
|
@ -1032,28 +1032,7 @@ intptr_t parser_send_video_msg(long id, intptr_t data)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (id)
|
retval = str_send_msg(&video_str, id, data);
|
||||||
{
|
|
||||||
#ifdef GRAY_CACHE_MAINT
|
|
||||||
/* This must be done internally here or refresh may be delayed far
|
|
||||||
* too long */
|
|
||||||
case VIDEO_DISPLAY_SHOW:
|
|
||||||
case VIDEO_PRINT_FRAME:
|
|
||||||
case VIDEO_PRINT_THUMBNAIL:
|
|
||||||
stream_gray_pause(true);
|
|
||||||
|
|
||||||
GRAY_INVALIDATE_ICACHE();
|
|
||||||
|
|
||||||
retval = str_send_msg(&video_str, id, data);
|
|
||||||
|
|
||||||
GRAY_VIDEO_FLUSH_ICACHE();
|
|
||||||
|
|
||||||
stream_gray_pause(false);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
default:
|
|
||||||
retval = str_send_msg(&video_str, id, data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
@ -944,16 +944,13 @@ static void wvs_show(unsigned show)
|
||||||
|
|
||||||
stream_vo_set_clip(NULL);
|
stream_vo_set_clip(NULL);
|
||||||
|
|
||||||
#ifdef HAVE_LCD_COLOR
|
|
||||||
draw_clear_area(0, 0, wvs.width, wvs.height);
|
draw_clear_area(0, 0, wvs.width, wvs.height);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!(show & WVS_NODRAW)) {
|
if (!(show & WVS_NODRAW)) {
|
||||||
#ifdef HAVE_LCD_COLOR
|
|
||||||
vo_lock();
|
vo_lock();
|
||||||
draw_update_rect(0, 0, wvs.width, wvs.height);
|
draw_update_rect(0, 0, wvs.width, wvs.height);
|
||||||
vo_unlock();
|
vo_unlock();
|
||||||
#endif
|
|
||||||
stream_draw_frame(false);
|
stream_draw_frame(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,25 +89,6 @@ enum mpeg_malloc_reason_t
|
||||||
#define DRAW_WHITE GREY_WHITE
|
#define DRAW_WHITE GREY_WHITE
|
||||||
#define lcd_(fn) grey_##fn
|
#define lcd_(fn) grey_##fn
|
||||||
|
|
||||||
#if defined(CPU_PP) && NUM_CORES > 1
|
|
||||||
#define GRAY_FLUSH_ICACHE() \
|
|
||||||
IF_COP(flush_icache())
|
|
||||||
#define GRAY_INVALIDATE_ICACHE() \
|
|
||||||
IF_COP(invalidate_icache())
|
|
||||||
#define GRAY_VIDEO_FLUSH_ICACHE() \
|
|
||||||
IF_COP(parser_send_video_msg(VIDEO_GRAY_CACHEOP, 0))
|
|
||||||
#define GRAY_VIDEO_INVALIDATE_ICACHE() \
|
|
||||||
IF_COP(parser_send_video_msg(VIDEO_GRAY_CACHEOP, 1))
|
|
||||||
|
|
||||||
#define GRAY_CACHE_MAINT
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef GRAY_CACHE_MAINT
|
|
||||||
#define GRAY_FLUSH_ICACHE()
|
|
||||||
#define GRAY_INVALIDATE_ICACHE()
|
|
||||||
#define GRAY_VIDEO_FLUSH_ICACHE()
|
|
||||||
#define GRAY_VIDEO_INVALIDATE_ICACHE()
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mpeg2.h"
|
#include "mpeg2.h"
|
||||||
|
|
|
@ -661,12 +661,7 @@ bool stream_show_vo(bool show)
|
||||||
|
|
||||||
vis = parser_send_video_msg(VIDEO_DISPLAY_SHOW, show);
|
vis = parser_send_video_msg(VIDEO_DISPLAY_SHOW, show);
|
||||||
#ifndef HAVE_LCD_COLOR
|
#ifndef HAVE_LCD_COLOR
|
||||||
GRAY_VIDEO_INVALIDATE_ICACHE();
|
|
||||||
GRAY_INVALIDATE_ICACHE();
|
|
||||||
|
|
||||||
grey_show(show);
|
grey_show(show);
|
||||||
|
|
||||||
GRAY_FLUSH_ICACHE();
|
|
||||||
#endif
|
#endif
|
||||||
stream_mgr_unlock();
|
stream_mgr_unlock();
|
||||||
|
|
||||||
|
@ -722,42 +717,11 @@ void stream_gray_show(bool show)
|
||||||
{
|
{
|
||||||
stream_mgr_lock();
|
stream_mgr_lock();
|
||||||
|
|
||||||
GRAY_VIDEO_INVALIDATE_ICACHE();
|
|
||||||
GRAY_INVALIDATE_ICACHE();
|
|
||||||
|
|
||||||
grey_show(show);
|
grey_show(show);
|
||||||
|
|
||||||
GRAY_FLUSH_ICACHE();
|
|
||||||
|
|
||||||
stream_mgr_unlock();
|
stream_mgr_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GRAY_CACHE_MAINT
|
|
||||||
void stream_gray_pause(bool pause)
|
|
||||||
{
|
|
||||||
static bool gray_paused = false;
|
|
||||||
|
|
||||||
if (pause && !gray_paused)
|
|
||||||
{
|
|
||||||
if (_grey_info.flags & _GREY_RUNNING)
|
|
||||||
{
|
|
||||||
rb->timer_unregister();
|
|
||||||
#if defined(CPU_PP) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
|
|
||||||
rb->cpu_boost(false);
|
|
||||||
#endif
|
|
||||||
_grey_info.flags &= ~_GREY_RUNNING;
|
|
||||||
rb->screen_dump_set_hook(NULL);
|
|
||||||
gray_paused = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!pause && gray_paused)
|
|
||||||
{
|
|
||||||
gray_paused = false;
|
|
||||||
grey_show(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* !HAVE_LCD_COLOR */
|
#endif /* !HAVE_LCD_COLOR */
|
||||||
|
|
||||||
/* Display a thumbnail at the last seek point */
|
/* Display a thumbnail at the last seek point */
|
||||||
|
@ -1013,11 +977,17 @@ int stream_init(void)
|
||||||
#ifndef HAVE_LCD_COLOR
|
#ifndef HAVE_LCD_COLOR
|
||||||
bool success;
|
bool success;
|
||||||
long graysize;
|
long graysize;
|
||||||
|
void *graymem;
|
||||||
|
|
||||||
|
#ifdef PROC_NEEDS_CACHEALIGN
|
||||||
/* This can run on another processor - align data */
|
/* This can run on another processor - align data */
|
||||||
memsize = CACHEALIGN_BUFFER(&mem, memsize);
|
memsize = CACHEALIGN_BUFFER(&mem, memsize);
|
||||||
|
graymem = UNCACHED_ADDR(mem);
|
||||||
|
#else
|
||||||
|
graymem = mem;
|
||||||
|
#endif
|
||||||
|
|
||||||
success = grey_init(rb, mem, memsize, true, LCD_WIDTH,
|
success = grey_init(rb, graymem, memsize, true, LCD_WIDTH,
|
||||||
LCD_HEIGHT, &graysize);
|
LCD_HEIGHT, &graysize);
|
||||||
|
|
||||||
/* This can run on another processor - align size */
|
/* This can run on another processor - align size */
|
||||||
|
|
|
@ -106,9 +106,6 @@ void stream_vo_set_clip(const struct vo_rect *rc);
|
||||||
|
|
||||||
#ifndef HAVE_LCD_COLOR
|
#ifndef HAVE_LCD_COLOR
|
||||||
void stream_gray_show(bool show);
|
void stream_gray_show(bool show);
|
||||||
#ifdef GRAY_CACHE_MAINT
|
|
||||||
void stream_gray_pause(bool pause);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Display thumbnail of the current seekpoint */
|
/* Display thumbnail of the current seekpoint */
|
||||||
|
|
|
@ -107,9 +107,6 @@ enum stream_message
|
||||||
VIDEO_PRINT_FRAME, /* Print the frame at the current position */
|
VIDEO_PRINT_FRAME, /* Print the frame at the current position */
|
||||||
VIDEO_PRINT_THUMBNAIL, /* Print a thumbnail of the current position */
|
VIDEO_PRINT_THUMBNAIL, /* Print a thumbnail of the current position */
|
||||||
VIDEO_SET_CLIP_RECT, /* Set the visible video area */
|
VIDEO_SET_CLIP_RECT, /* Set the visible video area */
|
||||||
#ifdef GRAY_CACHE_MAINT
|
|
||||||
VIDEO_GRAY_CACHEOP,
|
|
||||||
#endif
|
|
||||||
STREAM_MESSAGE_LAST,
|
STREAM_MESSAGE_LAST,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -612,14 +612,6 @@ static void video_thread_msg(struct video_thread_data *td)
|
||||||
reply = video_str_scan(td, (struct str_sync_data *)td->ev.data);
|
reply = video_str_scan(td, (struct str_sync_data *)td->ev.data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef GRAY_CACHE_MAINT
|
|
||||||
case VIDEO_GRAY_CACHEOP:
|
|
||||||
td->ev.data ?
|
|
||||||
GRAY_INVALIDATE_ICACHE() :
|
|
||||||
GRAY_FLUSH_ICACHE();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case STREAM_QUIT:
|
case STREAM_QUIT:
|
||||||
/* Time to go - make thread exit */
|
/* Time to go - make thread exit */
|
||||||
td->state = TSTATE_EOS;
|
td->state = TSTATE_EOS;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue