Vout: autoscaling support for windows
authorJoseph Tulou <brezhoneg1@yahoo.fr>
Fri, 30 Jan 2009 16:46:47 +0000 (17:46 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 2 Feb 2009 02:32:23 +0000 (03:32 +0100)
Modifications by /me
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/video_output/msw/direct3d.c
modules/video_output/msw/directx.c
modules/video_output/msw/glwin32.c
modules/video_output/msw/wingdi.c

index 5797927..1b15c01 100644 (file)
@@ -456,6 +456,28 @@ static int Manage( vout_thread_t *p_vout )
         p_vout->p_sys->i_changes &= ~DX_POSITION_CHANGE;
     }
 
+    /* autoscale toggle */
+    if( p_vout->i_changes & VOUT_SCALE_CHANGE )
+    {
+        p_vout->i_changes &= ~VOUT_SCALE_CHANGE;
+
+        p_vout->b_autoscale = var_GetBool( p_vout, "autoscale" );
+        p_vout->i_zoom = (int) ZOOM_FP_FACTOR;
+
+        UpdateRects( p_vout, true );
+    }
+
+    /* scaling factor */
+    if( p_vout->i_changes & VOUT_ZOOM_CHANGE )
+    {
+        p_vout->i_changes &= ~VOUT_ZOOM_CHANGE;
+
+        p_vout->b_autoscale = false;
+        p_vout->i_zoom =
+            (int)( ZOOM_FP_FACTOR * var_GetFloat( p_vout, "scale" ) );
+        UpdateRects( p_vout, true );
+    }
+
     /* Check for cropping / aspect changes */
     if( p_vout->i_changes & VOUT_CROP_CHANGE ||
         p_vout->i_changes & VOUT_ASPECT_CHANGE )
index a588ad4..737074c 100644 (file)
@@ -602,6 +602,28 @@ static int Manage( vout_thread_t *p_vout )
         }
     }
 
+    /* autoscale toggle */
+    if( p_vout->i_changes & VOUT_SCALE_CHANGE )
+    {
+        p_vout->i_changes &= ~VOUT_SCALE_CHANGE;
+
+        p_vout->b_autoscale = var_GetBool( p_vout, "autoscale" );
+        p_vout->i_zoom = (int) ZOOM_FP_FACTOR;
+
+        UpdateRects( p_vout, true );
+    }
+
+    /* scaling factor */
+    if( p_vout->i_changes & VOUT_ZOOM_CHANGE )
+    {
+        p_vout->i_changes &= ~VOUT_ZOOM_CHANGE;
+
+        p_vout->b_autoscale = false;
+        p_vout->i_zoom =
+            (int)( ZOOM_FP_FACTOR * var_GetFloat( p_vout, "scale" ) );
+        UpdateRects( p_vout, true );
+    }
+
     /* Check for cropping / aspect changes */
     if( p_vout->i_changes & VOUT_CROP_CHANGE ||
         p_vout->i_changes & VOUT_ASPECT_CHANGE )
index 10f6bd8..5248e99 100644 (file)
@@ -305,6 +305,28 @@ static int Manage( vout_thread_t *p_vout )
         vlc_mutex_unlock( &p_vout->p_sys->lock );
     }
 
+    /* autoscale toggle */
+    if( p_vout->i_changes & VOUT_SCALE_CHANGE )
+    {
+        p_vout->i_changes &= ~VOUT_SCALE_CHANGE;
+
+        p_vout->b_autoscale = var_GetBool( p_vout, "autoscale" );
+        p_vout->i_zoom = (int) ZOOM_FP_FACTOR;
+
+        UpdateRects( p_vout, true );
+    }
+
+    /* scaling factor */
+    if( p_vout->i_changes & VOUT_ZOOM_CHANGE )
+    {
+        p_vout->i_changes &= ~VOUT_ZOOM_CHANGE;
+
+        p_vout->b_autoscale = false;
+        p_vout->i_zoom =
+            (int)( ZOOM_FP_FACTOR * var_GetFloat( p_vout, "scale" ) );
+        UpdateRects( p_vout, true );
+    }
+
     /* Check for cropping / aspect changes */
     if( p_vout->i_changes & VOUT_CROP_CHANGE ||
         p_vout->i_changes & VOUT_ASPECT_CHANGE )
index ef41f3f..af58156 100644 (file)
@@ -522,6 +522,28 @@ static int Manage( vout_thread_t *p_vout )
         vlc_mutex_unlock( &p_vout->p_sys->lock );
     }
 
+    /* autoscale toggle */
+    if( p_vout->i_changes & VOUT_SCALE_CHANGE )
+    {
+        p_vout->i_changes &= ~VOUT_SCALE_CHANGE;
+
+        p_vout->b_autoscale = var_GetBool( p_vout, "autoscale" );
+        p_vout->i_zoom = (int) ZOOM_FP_FACTOR;
+
+        UpdateRects( p_vout, true );
+    }
+
+    /* scaling factor */
+    if( p_vout->i_changes & VOUT_ZOOM_CHANGE )
+    {
+        p_vout->i_changes &= ~VOUT_ZOOM_CHANGE;
+
+        p_vout->b_autoscale = false;
+        p_vout->i_zoom =
+            (int)( ZOOM_FP_FACTOR * var_GetFloat( p_vout, "scale" ) );
+        UpdateRects( p_vout, true );
+    }
+
     /* Check for cropping / aspect changes */
     if( p_vout->i_changes & VOUT_CROP_CHANGE ||
         p_vout->i_changes & VOUT_ASPECT_CHANGE )