]> git.sesse.net Git - vlc/commitdiff
* Something I forgot
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 26 Feb 2004 13:04:55 +0000 (13:04 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 26 Feb 2004 13:04:55 +0000 (13:04 +0000)
  --macosx-stretch mode. Ignore aspect ratio and stretch video to fill window.

modules/gui/macosx/macosx.m
modules/gui/macosx/vout.m

index fd0dc3ba22e550fc4ea49e0509c78c78a154c459..dcb3d07064c23267ddb680758ba1b99d423666cb 100644 (file)
@@ -2,7 +2,7 @@
  * macosx.m: MacOS X module for vlc
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: macosx.m,v 1.21 2004/02/09 17:42:12 titer Exp $
+ * $Id: macosx.m,v 1.22 2004/02/26 13:04:55 hartman Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Eugenio Jarosiewicz <ej0@cise.ufl.edu>
@@ -53,6 +53,11 @@ void E_(CloseVideo)   ( vlc_object_t * );
 #define OPAQUENESS_LONGTEXT N_( \
     "Set the transparency of the video output. 1 is non-transparent (default) " \
     "0 is fully transparent.")
+    
+#define STRETCH_TEXT N_("Stretch Aspect Ratio")
+#define STRETCH_LONGTEXT N_("Instead of keeping the aspect ratio " \
+        "of the movie when resizing the video, stretch the video " \
+        "to fill the entire window." )
 
 #define OPENGL_TEXT N_("Use OpenGL")
 #define OPENGL_LONGTEXT N_("Use OpenGL instead of QuickTime to " \
@@ -77,6 +82,8 @@ vlc_module_begin();
         set_callbacks( E_(OpenVideo), E_(CloseVideo) );
         add_integer( "macosx-vdev", 0, NULL, VDEV_TEXT, VDEV_LONGTEXT,
                      VLC_FALSE );
+        add_bool( "macosx-stretch", 0, NULL, STRETCH_TEXT, STRETCH_LONGTEXT,
+                     VLC_FALSE );
         add_float_with_range( "macosx-opaqueness", 1, 0, 1, NULL,
                 OPAQUENESS_TEXT, OPAQUENESS_LONGTEXT, VLC_TRUE );
         add_bool( "macosx-opengl", 0, NULL, OPENGL_TEXT,
index 1a68a800e789a6813338afbeefff7679ea2b8e12..a0b227fcbdd5b0a20981489ac421c58702ccbf30 100644 (file)
@@ -2,7 +2,7 @@
  * vout.m: MacOS X video output module
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: vout.m,v 1.82 2004/02/25 19:27:23 titer Exp $
+ * $Id: vout.m,v 1.83 2004/02/26 13:04:55 hartman Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -657,7 +657,15 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
     i_width = s_rect.right - s_rect.left;
     i_height = s_rect.bottom - s_rect.top;
 
-    if( i_height * p_vout->output.i_aspect < i_width * VOUT_ASPECT_FACTOR )
+    if( config_GetInt( p_vout, "macosx-stretch" ) )
+    {
+        factor_x = FixDiv( Long2Fix( i_width ),
+                           Long2Fix( p_vout->output.i_width ) );
+        factor_y = FixDiv( Long2Fix( i_height ),
+                           Long2Fix( p_vout->output.i_height ) );
+                           
+    }
+    else if( i_height * p_vout->output.i_aspect < i_width * VOUT_ASPECT_FACTOR )
     {
         int i_adj_width = i_height * p_vout->output.i_aspect /
                           VOUT_ASPECT_FACTOR;
@@ -686,12 +694,7 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
 
     ScaleMatrix( p_vout->p_sys->p_matrix,
                  factor_x, factor_y,
-                 Long2Fix(0), Long2Fix(0) );            
-
-    TranslateMatrix( p_vout->p_sys->p_matrix, 
-                     Long2Fix(i_offset_x), 
-                     Long2Fix(i_offset_y) );
-
+                 Long2Fix(i_offset_x), Long2Fix(i_offset_y) );
 }
 
 /*****************************************************************************
@@ -1374,7 +1377,12 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
                 (GLint) bounds.size.height );
 
     /* Quad size is set in order to preserve the aspect ratio */
-    if( bounds.size.height * p_vout->render.i_aspect <
+    if( config_GetInt( p_vout, "macosx-stretch" ) )
+    {
+        f_x = 1.0;
+        f_y = 1.0;
+    }
+    else if( bounds.size.height * p_vout->render.i_aspect <
         bounds.size.width * VOUT_ASPECT_FACTOR )
     {
         f_x = bounds.size.height * p_vout->render.i_aspect /
@@ -1492,7 +1500,13 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
     [fullScreenContext makeCurrentContext];
     unsigned width  = CGDisplayPixelsWide( kCGDirectMainDisplay );
     unsigned height = CGDisplayPixelsHigh( kCGDirectMainDisplay );
-    if( height * p_vout->output.i_aspect < width * VOUT_ASPECT_FACTOR )
+    
+    if( config_GetInt( p_vout, "macosx-stretch" ) )
+    {
+        f_x = 1.0;
+        f_y = 1.0;
+    }
+    else if( height * p_vout->output.i_aspect < width * VOUT_ASPECT_FACTOR )
     {
         f_x = (float) height * p_vout->output.i_aspect /
             width / VOUT_ASPECT_FACTOR;