From: Joseph Tulou Date: Fri, 30 Jan 2009 16:30:29 +0000 (+0100) Subject: OpengGL support for the auto-scaling X-Git-Tag: 1.0.0-pre1~915 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=f04686fc573553671fa0d1c342087dcf1fb5a3d6;p=vlc OpengGL support for the auto-scaling Modifications by /me Signed-off-by: Jean-Baptiste Kempf --- diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c index 101a0de81b..c8a1cc04e0 100644 --- a/modules/video_output/opengl.c +++ b/modules/video_output/opengl.c @@ -225,12 +225,18 @@ static int CreateVout( vlc_object_t *p_this ) var_Create( p_sys->p_vout, "mouse-button-down", VLC_VAR_INTEGER ); var_Create( p_sys->p_vout, "video-on-top", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); + var_Create( p_sys->p_vout, "autoscale", + VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); + var_Create( p_sys->p_vout, "scale", + VLC_VAR_FLOAT | VLC_VAR_DOINHERIT ); var_AddCallback( p_sys->p_vout, "mouse-x", SendEvents, p_vout ); var_AddCallback( p_sys->p_vout, "mouse-y", SendEvents, p_vout ); var_AddCallback( p_sys->p_vout, "mouse-moved", SendEvents, p_vout ); var_AddCallback( p_sys->p_vout, "mouse-clicked", SendEvents, p_vout ); var_AddCallback( p_sys->p_vout, "mouse-button-down", SendEvents, p_vout ); + var_AddCallback( p_vout, "autoscale", SendEvents, p_sys->p_vout ); + var_AddCallback( p_vout, "scale", SendEvents, p_sys->p_vout ); return VLC_SUCCESS; } @@ -455,9 +461,27 @@ static int Manage( vout_thread_t *p_vout ) // to align in real time in OPENGL if (p_sys->p_vout->i_alignment != p_vout->i_alignment) { - p_vout->i_changes = VOUT_CROP_CHANGE; //to force change + p_vout->i_changes |= VOUT_CROP_CHANGE; //to force change p_sys->p_vout->i_alignment = p_vout->i_alignment; } + + /* forward signal that autoscale toggle has changed */ + if (p_vout->i_changes & VOUT_SCALE_CHANGE ) + { + p_vout->i_changes &= ~VOUT_SCALE_CHANGE; + + p_sys->p_vout->i_changes |= VOUT_SCALE_CHANGE; + } + + /* forward signal that scale has changed */ + if (p_vout->i_changes & VOUT_ZOOM_CHANGE ) + { + p_vout->i_changes &= ~VOUT_ZOOM_CHANGE; + + p_sys->p_vout->i_changes |= VOUT_ZOOM_CHANGE; + } + + return i_ret; }