Commit 50f8da04 authored by Christophe Massiot's avatar Christophe Massiot

Added hooks for the fothcoming YUV overlay support.

parent 266e3eab
...@@ -144,6 +144,8 @@ typedef struct vout_thread_s ...@@ -144,6 +144,8 @@ typedef struct vout_thread_s
int i_screen_depth; /* significant bpp: 8, 15, 16 or 24 */ int i_screen_depth; /* significant bpp: 8, 15, 16 or 24 */
int i_bytes_per_pixel;/* real screen depth: 1, 2, 3 or 4 */ int i_bytes_per_pixel;/* real screen depth: 1, 2, 3 or 4 */
float f_gamma; /* gamma */ float f_gamma; /* gamma */
boolean_t b_need_render; /* does the output method need a YUV
* conversion ? */
/* Color masks and shifts in RGB mode - masks are set by system /* Color masks and shifts in RGB mode - masks are set by system
* initialization, shifts are calculated. A pixel color value can be * initialization, shifts are calculated. A pixel color value can be
...@@ -202,6 +204,7 @@ typedef struct vout_thread_s ...@@ -202,6 +204,7 @@ typedef struct vout_thread_s
subpicture_t p_subpicture[VOUT_MAX_PICTURES]; /* subpictures */ subpicture_t p_subpicture[VOUT_MAX_PICTURES]; /* subpictures */
int i_pictures; /* current heap size */ int i_pictures; /* current heap size */
vout_yuv_t yuv; /* translation tables */ vout_yuv_t yuv; /* translation tables */
picture_t * p_rendered_pic; /* picture currently being rendered */
/* Bitmap fonts */ /* Bitmap fonts */
p_vout_font_t p_default_font; /* default font */ p_vout_font_t p_default_font; /* default font */
......
...@@ -158,6 +158,7 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window, ...@@ -158,6 +158,7 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window,
p_vout->i_screen_depth = 15; p_vout->i_screen_depth = 15;
p_vout->i_bytes_per_pixel = 2; p_vout->i_bytes_per_pixel = 2;
p_vout->f_gamma = VOUT_GAMMA; p_vout->f_gamma = VOUT_GAMMA;
p_vout->b_need_render = 1;
p_vout->b_grayscale = main_GetIntVariable( VOUT_GRAYSCALE_VAR, p_vout->b_grayscale = main_GetIntVariable( VOUT_GRAYSCALE_VAR,
VOUT_GRAYSCALE_DEFAULT ); VOUT_GRAYSCALE_DEFAULT );
...@@ -923,12 +924,15 @@ static int InitThread( vout_thread_t *p_vout ) ...@@ -923,12 +924,15 @@ static int InitThread( vout_thread_t *p_vout )
return( 1 ); return( 1 );
} }
if( p_vout->b_need_render )
{
/* Initialize convertion tables and functions */ /* Initialize convertion tables and functions */
if( vout_InitYUV( p_vout ) ) if( vout_InitYUV( p_vout ) )
{ {
intf_ErrMsg("error: can't allocate YUV translation tables\n"); intf_ErrMsg("error: can't allocate YUV translation tables\n");
return( 1 ); return( 1 );
} }
}
/* Mark thread as running and return */ /* Mark thread as running and return */
p_vout->b_active = 1; p_vout->b_active = 1;
...@@ -1060,8 +1064,11 @@ static void RunThread( vout_thread_t *p_vout) ...@@ -1060,8 +1064,11 @@ static void RunThread( vout_thread_t *p_vout)
{ {
b_display = p_vout->b_active; b_display = p_vout->b_active;
p_vout->last_display_date = display_date; p_vout->last_display_date = display_date;
p_vout->p_rendered_pic = p_pic;
if( b_display ) /* FIXME: if b_need_render == 0 we need to do something with
* the subpictures one day. */
if( p_vout->b_need_render && b_display )
{ {
/* Set picture dimensions and clear buffer */ /* Set picture dimensions and clear buffer */
SetBufferPicture( p_vout, p_pic ); SetBufferPicture( p_vout, p_pic );
...@@ -1080,14 +1087,17 @@ static void RunThread( vout_thread_t *p_vout) ...@@ -1080,14 +1087,17 @@ static void RunThread( vout_thread_t *p_vout)
} }
/* Render interface and subpicture */ /* Render interface and subpicture */
if( b_display && p_vout->b_interface ) if( b_display && p_vout->b_interface && p_vout->b_need_render )
{ {
RenderInterface( p_vout ); RenderInterface( p_vout );
} }
} }
else if( p_vout->b_active && p_vout->init_display_date == 0) /* idle or interface screen alone */ else if( p_vout->b_active && p_vout->b_need_render
&& p_vout->init_display_date == 0)
{ {
/* Idle or interface screen alone */
if( p_vout->b_interface && 0 /* && XXX?? intf_change */ ) if( p_vout->b_interface && 0 /* && XXX?? intf_change */ )
{ {
/* Interface has changed, so a new rendering is required - force /* Interface has changed, so a new rendering is required - force
...@@ -1115,10 +1125,10 @@ static void RunThread( vout_thread_t *p_vout) ...@@ -1115,10 +1125,10 @@ static void RunThread( vout_thread_t *p_vout)
/* /*
* chech for the current time and * Check for the current time and
* display splash screen if everything is on time * display splash screen if everything is on time
*/ */
if( p_vout->init_display_date > 0) if( p_vout->init_display_date > 0 && p_vout->b_need_render )
{ {
if( p_vout->b_active && if( p_vout->b_active &&
mdate()-p_vout->init_display_date < 5000000) mdate()-p_vout->init_display_date < 5000000)
...@@ -1135,15 +1145,13 @@ static void RunThread( vout_thread_t *p_vout) ...@@ -1135,15 +1145,13 @@ static void RunThread( vout_thread_t *p_vout)
} }
/* /*
* Sleep, wake up and display rendered picture * Sleep, wake up and display rendered picture
*/ */
if( display_date != 0 ) if( display_date != 0 )
{ {
/* Store render time */ /* Store render time using Bresenham algorithm */
p_vout->render_time += mdate() - current_date; p_vout->render_time += mdate() - current_date;
p_vout->render_time >>= 1; p_vout->render_time >>= 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment