From 50f8da044825d9c7248b4f74ca8d2300911e3f3e Mon Sep 17 00:00:00 2001 From: Christophe Massiot Date: Wed, 29 Nov 2000 17:33:24 +0000 Subject: [PATCH] Added hooks for the fothcoming YUV overlay support. --- include/video_output.h | 3 +++ src/video_output/video_output.c | 34 ++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/include/video_output.h b/include/video_output.h index 6f5c41bebe..69321d798e 100644 --- a/include/video_output.h +++ b/include/video_output.h @@ -144,6 +144,8 @@ typedef struct vout_thread_s int i_screen_depth; /* significant bpp: 8, 15, 16 or 24 */ int i_bytes_per_pixel;/* real screen depth: 1, 2, 3 or 4 */ 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 * initialization, shifts are calculated. A pixel color value can be @@ -202,6 +204,7 @@ typedef struct vout_thread_s subpicture_t p_subpicture[VOUT_MAX_PICTURES]; /* subpictures */ int i_pictures; /* current heap size */ vout_yuv_t yuv; /* translation tables */ + picture_t * p_rendered_pic; /* picture currently being rendered */ /* Bitmap fonts */ p_vout_font_t p_default_font; /* default font */ diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index 7c7c06e9c6..80859b5695 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -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_bytes_per_pixel = 2; p_vout->f_gamma = VOUT_GAMMA; + p_vout->b_need_render = 1; p_vout->b_grayscale = main_GetIntVariable( VOUT_GRAYSCALE_VAR, VOUT_GRAYSCALE_DEFAULT ); @@ -923,11 +924,14 @@ static int InitThread( vout_thread_t *p_vout ) return( 1 ); } - /* Initialize convertion tables and functions */ - if( vout_InitYUV( p_vout ) ) + if( p_vout->b_need_render ) { - intf_ErrMsg("error: can't allocate YUV translation tables\n"); - return( 1 ); + /* Initialize convertion tables and functions */ + if( vout_InitYUV( p_vout ) ) + { + intf_ErrMsg("error: can't allocate YUV translation tables\n"); + return( 1 ); + } } /* Mark thread as running and return */ @@ -1025,7 +1029,7 @@ static void RunThread( vout_thread_t *p_vout) "warning: late picture skipped (%p)\n", p_pic ); vlc_mutex_unlock( &p_vout->picture_lock ); - continue; + continue; } else if( display_date > current_date + VOUT_DISPLAY_DELAY ) { @@ -1060,8 +1064,11 @@ static void RunThread( vout_thread_t *p_vout) { b_display = p_vout->b_active; 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 */ SetBufferPicture( p_vout, p_pic ); @@ -1080,14 +1087,17 @@ static void RunThread( vout_thread_t *p_vout) } /* 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 ); } } - 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 */ ) { /* Interface has changed, so a new rendering is required - force @@ -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 */ - if( p_vout->init_display_date > 0) + if( p_vout->init_display_date > 0 && p_vout->b_need_render ) { if( p_vout->b_active && mdate()-p_vout->init_display_date < 5000000) @@ -1135,15 +1145,13 @@ static void RunThread( vout_thread_t *p_vout) } - - /* * Sleep, wake up and display rendered picture */ if( display_date != 0 ) { - /* Store render time */ + /* Store render time using Bresenham algorithm */ p_vout->render_time += mdate() - current_date; p_vout->render_time >>= 1; } -- 2.39.2