>From 4e6e9ad7d152154037ec2157fb71030159b9e8dd Mon Sep 17 00:00:00 2001
From: Joseph Tulou <brezhoneg1@yahoo.fr>
Date: Fri, 30 Jan 2009 17:46:47 +0100
Subject: [PATCH] support for windows

---
 modules/video_output/msw/direct3d.c |   22 ++++++++++++++++++++++
 modules/video_output/msw/directx.c  |   22 ++++++++++++++++++++++
 modules/video_output/msw/glwin32.c  |   22 ++++++++++++++++++++++
 modules/video_output/msw/wingdi.c   |   22 ++++++++++++++++++++++
 4 files changed, 88 insertions(+), 0 deletions(-)

diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index 5797927..0f9610f 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -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->ll_zoom = (uint64_t) 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->ll_zoom =
+            (uint64_t)( ZOOM_FP_FACTOR * var_GetFloat( p_vout, "scale-factor" ) );
+        UpdateRects( p_vout, true );
+    }
+
     /* Check for cropping / aspect changes */
     if( p_vout->i_changes & VOUT_CROP_CHANGE ||
         p_vout->i_changes & VOUT_ASPECT_CHANGE )
diff --git a/modules/video_output/msw/directx.c b/modules/video_output/msw/directx.c
index a588ad4..558d6ac 100644
--- a/modules/video_output/msw/directx.c
+++ b/modules/video_output/msw/directx.c
@@ -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->ll_zoom = (uint64_t) 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->ll_zoom =
+            (uint64_t)( ZOOM_FP_FACTOR * var_GetFloat( p_vout, "scale-factor" ) );
+        UpdateRects( p_vout, true );
+    }
+
     /* Check for cropping / aspect changes */
     if( p_vout->i_changes & VOUT_CROP_CHANGE ||
         p_vout->i_changes & VOUT_ASPECT_CHANGE )
diff --git a/modules/video_output/msw/glwin32.c b/modules/video_output/msw/glwin32.c
index 10f6bd8..f2986da 100644
--- a/modules/video_output/msw/glwin32.c
+++ b/modules/video_output/msw/glwin32.c
@@ -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->ll_zoom = (uint64_t) 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->ll_zoom =
+            (uint64_t)( ZOOM_FP_FACTOR * var_GetFloat( p_vout, "scale-factor" ) );
+        UpdateRects( p_vout, true );
+    }
+
     /* Check for cropping / aspect changes */
     if( p_vout->i_changes & VOUT_CROP_CHANGE ||
         p_vout->i_changes & VOUT_ASPECT_CHANGE )
diff --git a/modules/video_output/msw/wingdi.c b/modules/video_output/msw/wingdi.c
index ef41f3f..0d9ca30 100644
--- a/modules/video_output/msw/wingdi.c
+++ b/modules/video_output/msw/wingdi.c
@@ -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->ll_zoom = (uint64_t) 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->ll_zoom =
+            (uint64_t)( ZOOM_FP_FACTOR * var_GetFloat( p_vout, "scale-factor" ) );
+        UpdateRects( p_vout, true );
+    }
+
     /* Check for cropping / aspect changes */
     if( p_vout->i_changes & VOUT_CROP_CHANGE ||
         p_vout->i_changes & VOUT_ASPECT_CHANGE )
-- 
1.5.2.5

