Commit cff02a62 authored by Gildas Bazin's avatar Gildas Bazin

* modules/video_output/directx/directx.c,...

* modules/video_output/directx/directx.c, modules/video_output/directx/glwin32.c, modules/video_output/opengl.c: support on-the-fly aspect-ratio changes.
parent 57807546
...@@ -539,16 +539,21 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -539,16 +539,21 @@ static int Manage( vout_thread_t *p_vout )
} }
} }
/* Check for cropping changes */ /* Check for cropping / aspect changes */
if( p_vout->fmt_out.i_x_offset != p_vout->fmt_in.i_x_offset || if( p_vout->i_changes & VOUT_CROP_CHANGE ||
p_vout->fmt_out.i_y_offset != p_vout->fmt_in.i_y_offset || p_vout->i_changes & VOUT_ASPECT_CHANGE )
p_vout->fmt_out.i_visible_width != p_vout->fmt_in.i_visible_width ||
p_vout->fmt_out.i_visible_height != p_vout->fmt_in.i_visible_height )
{ {
p_vout->i_changes &= ~VOUT_CROP_CHANGE;
p_vout->i_changes &= ~VOUT_ASPECT_CHANGE;
p_vout->fmt_out.i_x_offset = p_vout->fmt_in.i_x_offset; p_vout->fmt_out.i_x_offset = p_vout->fmt_in.i_x_offset;
p_vout->fmt_out.i_y_offset = p_vout->fmt_in.i_y_offset; p_vout->fmt_out.i_y_offset = p_vout->fmt_in.i_y_offset;
p_vout->fmt_out.i_visible_width = p_vout->fmt_in.i_visible_width; p_vout->fmt_out.i_visible_width = p_vout->fmt_in.i_visible_width;
p_vout->fmt_out.i_visible_height = p_vout->fmt_in.i_visible_height; p_vout->fmt_out.i_visible_height = p_vout->fmt_in.i_visible_height;
p_vout->fmt_out.i_aspect = p_vout->fmt_in.i_aspect;
p_vout->fmt_out.i_sar_num = p_vout->fmt_in.i_sar_num;
p_vout->fmt_out.i_sar_den = p_vout->fmt_in.i_sar_den;
p_vout->output.i_aspect = p_vout->fmt_in.i_aspect;
E_(DirectXUpdateRects)( p_vout, VLC_TRUE ); E_(DirectXUpdateRects)( p_vout, VLC_TRUE );
} }
......
...@@ -302,16 +302,21 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -302,16 +302,21 @@ static int Manage( vout_thread_t *p_vout )
vlc_mutex_unlock( &p_vout->p_sys->lock ); vlc_mutex_unlock( &p_vout->p_sys->lock );
} }
/* Check for cropping changes */ /* Check for cropping / aspect changes */
if( p_vout->fmt_out.i_x_offset != p_vout->fmt_in.i_x_offset || if( p_vout->i_changes & VOUT_CROP_CHANGE ||
p_vout->fmt_out.i_y_offset != p_vout->fmt_in.i_y_offset || p_vout->i_changes & VOUT_ASPECT_CHANGE )
p_vout->fmt_out.i_visible_width != p_vout->fmt_in.i_visible_width ||
p_vout->fmt_out.i_visible_height != p_vout->fmt_in.i_visible_height )
{ {
p_vout->i_changes &= ~VOUT_CROP_CHANGE;
p_vout->i_changes &= ~VOUT_ASPECT_CHANGE;
p_vout->fmt_out.i_x_offset = p_vout->fmt_in.i_x_offset; p_vout->fmt_out.i_x_offset = p_vout->fmt_in.i_x_offset;
p_vout->fmt_out.i_y_offset = p_vout->fmt_in.i_y_offset; p_vout->fmt_out.i_y_offset = p_vout->fmt_in.i_y_offset;
p_vout->fmt_out.i_visible_width = p_vout->fmt_in.i_visible_width; p_vout->fmt_out.i_visible_width = p_vout->fmt_in.i_visible_width;
p_vout->fmt_out.i_visible_height = p_vout->fmt_in.i_visible_height; p_vout->fmt_out.i_visible_height = p_vout->fmt_in.i_visible_height;
p_vout->fmt_out.i_aspect = p_vout->fmt_in.i_aspect;
p_vout->fmt_out.i_sar_num = p_vout->fmt_in.i_sar_num;
p_vout->fmt_out.i_sar_den = p_vout->fmt_in.i_sar_den;
p_vout->output.i_aspect = p_vout->fmt_in.i_aspect;
E_(DirectXUpdateRects)( p_vout, VLC_TRUE ); E_(DirectXUpdateRects)( p_vout, VLC_TRUE );
} }
......
...@@ -466,6 +466,13 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -466,6 +466,13 @@ static int Manage( vout_thread_t *p_vout )
p_vout->fmt_in.i_visible_width; p_vout->fmt_in.i_visible_width;
p_vout->fmt_out.i_visible_height = p_sys->p_vout->fmt_in.i_visible_height = p_vout->fmt_out.i_visible_height = p_sys->p_vout->fmt_in.i_visible_height =
p_vout->fmt_in.i_visible_height; p_vout->fmt_in.i_visible_height;
p_vout->fmt_out.i_aspect = p_sys->p_vout->fmt_in.i_aspect =
p_vout->fmt_in.i_aspect;
p_vout->fmt_out.i_sar_num = p_sys->p_vout->fmt_in.i_sar_num =
p_vout->fmt_in.i_sar_num;
p_vout->fmt_out.i_sar_den = p_sys->p_vout->fmt_in.i_sar_den =
p_vout->fmt_in.i_sar_den;
p_vout->output.i_aspect = p_vout->fmt_in.i_aspect;
p_sys->p_vout->i_changes = p_vout->i_changes; p_sys->p_vout->i_changes = p_vout->i_changes;
i_ret = p_sys->p_vout->pf_manage( p_sys->p_vout ); i_ret = p_sys->p_vout->pf_manage( p_sys->p_vout );
......
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