OpengGL support for the auto-scaling
authorJoseph Tulou <brezhoneg1@yahoo.fr>
Fri, 30 Jan 2009 16:30:29 +0000 (17:30 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 2 Feb 2009 02:32:22 +0000 (03:32 +0100)
Modifications by /me
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/video_output/opengl.c

index 101a0de..c8a1cc0 100644 (file)
@@ -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, "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_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;
 }
 
     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)
     {
 // 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;    
     }
         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;
 }
 
     return i_ret;
 }