>From 7eac197afaf8f9750303c2bdd10258f651349206 Mon Sep 17 00:00:00 2001
From: Joseph Tulou <brezhoneg1@yahoo.fr>
Date: Fri, 30 Jan 2009 17:30:29 +0100
Subject: [PATCH] support opengl

---
 modules/video_output/opengl.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index 1e8121b..8ba59e1 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -190,7 +190,8 @@ static int CreateVout( vlc_object_t *p_this )
     p_sys->p_vout->render.i_aspect = p_vout->render.i_aspect;
     p_sys->p_vout->fmt_render = p_vout->fmt_render;
     p_sys->p_vout->fmt_in = p_vout->fmt_in;
-    p_sys->p_vout->b_scale = p_vout->b_scale;
+    p_sys->p_vout->b_autoscale = p_vout->b_autoscale;
+    p_sys->p_vout->ll_zoom = p_vout->ll_zoom;
     p_sys->p_vout->i_alignment = p_vout->i_alignment;
 
     psz = config_GetPsz( p_vout, "opengl-provider" );
@@ -224,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-factor",
+                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-factor", SendEvents, p_sys->p_vout );
 
     return VLC_SUCCESS;
 }
@@ -454,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-factor 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;
 }
 
-- 
1.5.2.5

