Commit 8d068982 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Compile XvMC. Disabled the subtitles part for that. Commented a few things....

Compile XvMC. Disabled the subtitles part for that. Commented a few things. This can't be good, but at least it compiles (not link yet).
parent eb88f342
...@@ -430,6 +430,7 @@ int E_(Activate) ( vlc_object_t *p_this ) ...@@ -430,6 +430,7 @@ int E_(Activate) ( vlc_object_t *p_this )
E_(Deactivate)( p_vout ); E_(Deactivate)( p_vout );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
subpicture_t sub_pic;
sub_pic.p_sys = NULL; sub_pic.p_sys = NULL;
p_vout->p_sys->last_date = 0; p_vout->p_sys->last_date = 0;
#endif #endif
...@@ -597,11 +598,11 @@ static void RenderVideo( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -597,11 +598,11 @@ static void RenderVideo( vout_thread_t *p_vout, picture_t *p_pic )
return; return;
} }
#if 0
vlc_mutex_lock( &p_vout->lastsubtitle_lock ); vlc_mutex_lock( &p_vout->lastsubtitle_lock );
if (p_vout->p_sys->p_last_subtitle != NULL)
if (p_vout->p_last_subtitle != NULL)
{ {
if( p_vout->p_sys->p_last_subtitle_save != p_vout->p_last_subtitle ) if( p_vout->p_sys->p_last_subtitle_save != p_vout->p_sys->p_last_subtitle )
{ {
p_vout->p_sys->new_subpic = p_vout->p_sys->new_subpic =
xxmc_xvmc_alloc_subpicture( p_vout, &p_vout->p_sys->context, xxmc_xvmc_alloc_subpicture( p_vout, &p_vout->p_sys->context,
...@@ -755,6 +756,7 @@ static void RenderVideo( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -755,6 +756,7 @@ static void RenderVideo( vout_thread_t *p_vout, picture_t *p_pic )
p_vout->p_sys->p_last_subtitle_save = p_vout->p_last_subtitle; p_vout->p_sys->p_last_subtitle_save = p_vout->p_last_subtitle;
vlc_mutex_unlock( &p_vout->lastsubtitle_lock ); vlc_mutex_unlock( &p_vout->lastsubtitle_lock );
#endif
xvmc_context_reader_unlock( &p_vout->p_sys->xvmc_lock ); xvmc_context_reader_unlock( &p_vout->p_sys->xvmc_lock );
vlc_mutex_unlock( &p_vout->p_sys->lock ); vlc_mutex_unlock( &p_vout->p_sys->lock );
...@@ -965,20 +967,21 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -965,20 +967,21 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic )
#ifdef MODULE_NAME_IS_xvmc #ifdef MODULE_NAME_IS_xvmc
xvmc_context_reader_lock( &p_vout->p_sys->xvmc_lock ); xvmc_context_reader_lock( &p_vout->p_sys->xvmc_lock );
vlc_xxmc_t *xxmc = &p_picture->p_sys->xxmc_data; vlc_xxmc_t *xxmc = &p_pic->p_sys->xxmc_data;
if( !xxmc->decoded || if( !xxmc->decoded ||
!xxmc_xvmc_surface_valid( p_vout, p_picture->p_sys->xvmc_surf ) ) !xxmc_xvmc_surface_valid( p_vout, p_pic->p_sys->xvmc_surf ) )
{ {
msg_Dbg( p_vout, "DisplayVideo decoded=%d\tsurfacevalid=%d", msg_Dbg( p_vout, "DisplayVideo decoded=%d\tsurfacevalid=%d",
xxmc->decoded, xxmc->decoded,
xxmc_xvmc_surface_valid( p_vout, p_picture->p_sys->xvmc_surf ) ); xxmc_xvmc_surface_valid( p_vout, p_pic->p_sys->xvmc_surf ) );
vlc_mutex_unlock( &p_vout->p_sys->lock ); vlc_mutex_unlock( &p_vout->p_sys->lock );
xvmc_context_reader_unlock( &p_vout->p_sys->xvmc_lock ); xvmc_context_reader_unlock( &p_vout->p_sys->xvmc_lock );
return; return;
} }
src_width = p_vout->output.i_width; int src_width = p_vout->output.i_width;
src_height = p_vout->output.i_height; int src_height = p_vout->output.i_height;
int src_x, src_y;
if( p_vout->p_sys->xvmc_crop_style == 1 ) if( p_vout->p_sys->xvmc_crop_style == 1 )
{ {
...@@ -1007,17 +1010,18 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1007,17 +1010,18 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic )
src_y = 0; src_y = 0;
} }
int first_field;
if( p_vout->p_sys->xvmc_deinterlace_method > 0 ) if( p_vout->p_sys->xvmc_deinterlace_method > 0 )
{ /* BOB DEINTERLACE */ { /* BOB DEINTERLACE */
if( (p_picture->p_sys->nb_display == 0) || if( (p_pic->p_sys->nb_display == 0) ||
(p_vout->p_sys->xvmc_deinterlace_method == 1) ) (p_vout->p_sys->xvmc_deinterlace_method == 1) )
{ {
first_field = (p_picture->b_top_field_first) ? first_field = (p_pic->b_top_field_first) ?
XVMC_BOTTOM_FIELD : XVMC_TOP_FIELD; XVMC_BOTTOM_FIELD : XVMC_TOP_FIELD;
} }
else else
{ {
first_field = (p_picture->b_top_field_first) ? first_field = (p_pic->b_top_field_first) ?
XVMC_TOP_FIELD : XVMC_BOTTOM_FIELD; XVMC_TOP_FIELD : XVMC_BOTTOM_FIELD;
} }
} }
...@@ -1027,10 +1031,10 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1027,10 +1031,10 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic )
} }
XVMCLOCKDISPLAY( p_vout->p_sys->p_display ); XVMCLOCKDISPLAY( p_vout->p_sys->p_display );
XvMCFlushSurface( p_vout->p_sys->p_display, p_picture->p_sys->xvmc_surf ); XvMCFlushSurface( p_vout->p_sys->p_display, p_pic->p_sys->xvmc_surf );
/* XvMCSyncSurface(p_vout->p_sys->p_display, p_picture->p_sys->xvmc_surf); */ /* XvMCSyncSurface(p_vout->p_sys->p_display, p_picture->p_sys->xvmc_surf); */
XvMCPutSurface( p_vout->p_sys->p_display, XvMCPutSurface( p_vout->p_sys->p_display,
p_picture->p_sys->xvmc_surf, p_pic->p_sys->xvmc_surf,
p_vout->p_sys->p_win->video_window, p_vout->p_sys->p_win->video_window,
src_x, src_x,
src_y, src_y,
...@@ -1045,29 +1049,29 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1045,29 +1049,29 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic )
XVMCUNLOCKDISPLAY( p_vout->p_sys->p_display ); XVMCUNLOCKDISPLAY( p_vout->p_sys->p_display );
if( p_vout->p_sys->xvmc_deinterlace_method == 2 ) if( p_vout->p_sys->xvmc_deinterlace_method == 2 )
{ /* BOB DEINTERLACE */ { /* BOB DEINTERLACE */
if( p_picture->p_sys->nb_display == 0 )/* && ((t2-t1) < 15000)) */ if( p_pic->p_sys->nb_display == 0 )/* && ((t2-t1) < 15000)) */
{ {
mtime_t last_date = p_picture->date; mtime_t last_date = p_pic->date;
vlc_mutex_lock( &p_vout->picture_lock ); vlc_mutex_lock( &p_vout->picture_lock );
if( !p_vout->p_sys->last_date ) if( !p_vout->p_sys->last_date )
{ {
p_picture->date += 20000; p_pic->date += 20000;
} }
else else
{ {
p_picture->date = ((3 * p_picture->date - p_pic->date = ((3 * p_pic->date -
p_vout->p_sys->last_date) / 2 ); p_vout->p_sys->last_date) / 2 );
} }
p_vout->p_sys->last_date = last_date; p_vout->p_sys->last_date = last_date;
p_picture->b_force = 1; p_pic->b_force = 1;
p_picture->p_sys->nb_display = 1; p_pic->p_sys->nb_display = 1;
vlc_mutex_unlock( &p_vout->picture_lock ); vlc_mutex_unlock( &p_vout->picture_lock );
} }
else else
{ {
p_picture->p_sys->nb_display = 0; p_pic->p_sys->nb_display = 0;
p_picture->b_force = 0; p_pic->b_force = 0;
} }
} }
xvmc_context_reader_unlock( &p_vout->p_sys->xvmc_lock ); xvmc_context_reader_unlock( &p_vout->p_sys->xvmc_lock );
...@@ -1902,7 +1906,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1902,7 +1906,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
p_pic->p_sys->xvmc_surf = NULL; p_pic->p_sys->xvmc_surf = NULL;
p_pic->p_sys->xxmc_data.decoded = 0; p_pic->p_sys->xxmc_data.decoded = 0;
p_pic->p_sys->xxmc_data.proc_xxmc_update_frame = xxmc_do_update_frame; p_pic->p_sys->xxmc_data.proc_xxmc_update_frame = xxmc_do_update_frame;
p_pic->p_accel_data = &p_pic->p_sys->xxmc_data; // p_pic->p_accel_data = &p_pic->p_sys->xxmc_data;
p_pic->p_sys->nb_display = 0; p_pic->p_sys->nb_display = 0;
#endif #endif
...@@ -3081,6 +3085,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args ) ...@@ -3081,6 +3085,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
vlc_mutex_lock( &p_vout->p_sys->lock ); vlc_mutex_lock( &p_vout->p_sys->lock );
if( i_query == VOUT_REPARENT ) d = (Drawable)va_arg( args, int ); if( i_query == VOUT_REPARENT ) d = (Drawable)va_arg( args, int );
if( !d ) if( !d )
{
#ifdef MODULE_NAME_IS_xvmc #ifdef MODULE_NAME_IS_xvmc
xvmc_context_reader_lock( &p_vout->p_sys->xvmc_lock ); xvmc_context_reader_lock( &p_vout->p_sys->xvmc_lock );
#endif #endif
...@@ -3088,6 +3093,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args ) ...@@ -3088,6 +3093,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
p_vout->p_sys->original_window.base_window, p_vout->p_sys->original_window.base_window,
DefaultRootWindow( p_vout->p_sys->p_display ), DefaultRootWindow( p_vout->p_sys->p_display ),
0, 0 ); 0, 0 );
}
else else
XReparentWindow( p_vout->p_sys->p_display, XReparentWindow( p_vout->p_sys->p_display,
p_vout->p_sys->original_window.base_window, p_vout->p_sys->original_window.base_window,
......
...@@ -339,7 +339,7 @@ void blend_xx44( uint8_t *dst_img, subpicture_t *sub_img, ...@@ -339,7 +339,7 @@ void blend_xx44( uint8_t *dst_img, subpicture_t *sub_img,
int clip_right; int clip_right;
int i_len, i_color; int i_len, i_color;
uint16_t *p_source = NULL; uint16_t *p_source = NULL;
#if 0
if (!sub_img) if (!sub_img)
return; return;
...@@ -468,6 +468,7 @@ void blend_xx44( uint8_t *dst_img, subpicture_t *sub_img, ...@@ -468,6 +468,7 @@ void blend_xx44( uint8_t *dst_img, subpicture_t *sub_img,
} }
dst_y += dst_pitch; dst_y += dst_pitch;
} }
#endif
} }
int xxmc_xvmc_surface_valid( vout_thread_t *p_vout, XvMCSurface *surf ) int xxmc_xvmc_surface_valid( vout_thread_t *p_vout, XvMCSurface *surf )
......
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