]> git.sesse.net Git - vlc/commitdiff
macsox/* : added --macosx-fill
authorEric Petit <titer@videolan.org>
Wed, 3 Mar 2004 12:01:57 +0000 (12:01 +0000)
committerEric Petit <titer@videolan.org>
Wed, 3 Mar 2004 12:01:57 +0000 (12:01 +0000)
  In fullscreen, crops the picture if necessary in order to fill
  the screen without black borders (e.g. you lose top and bottom parts
  of the picture when watching a 4:3 video on a 16:9 display).
  (Only implemented in OpenGL mode)

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

index 4cdd1608f239958df67601363a84b597c1d45d81..e31113f1e99542c8ed55d9695ed1abf03dfb8ad4 100644 (file)
@@ -2,7 +2,7 @@
  * macosx.m: MacOS X module for vlc
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: macosx.m,v 1.23 2004/03/02 13:53:14 kuehne Exp $
+ * $Id: macosx.m,v 1.24 2004/03/03 12:01:57 titer Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Eugenio Jarosiewicz <ej0@cise.ufl.edu>
@@ -69,6 +69,11 @@ void E_(CloseVideo)   ( vlc_object_t * );
         "the faces of a rotating cube, 'Transparent cube' do make this " \
         "cube transparent." )
 
+#define FILL_TEXT N_("Fill fullscreen")
+#define FILL_LONGTEXT N_("In fullscreen mode, crop the picture if " \
+        "necessary in order to fill the screen without black" \
+        "borders (OpenGL only)." )
+
 static char * effect_list[] = { "none", "cube", "transparent-cube" };
 static char * effect_list_text[] = { N_("None"), N_("Cube"),
                                      N_("Transparent cube") };
@@ -91,6 +96,8 @@ vlc_module_begin();
         add_string( "macosx-opengl-effect", "none", NULL,
                     OPENGL_EFFECT_TEXT, OPENGL_EFFECT_LONGTEXT,
                     VLC_TRUE );
+        add_bool( "macosx-fill", 0, NULL, FILL_TEXT, FILL_LONGTEXT,
+                  VLC_TRUE );
         change_string_list( effect_list, effect_list_text, 0 );
 vlc_module_end();
 
index 55c546fe5b9436bf745e4a8b26ab4134a45e6879..4139edfd6d16fe4e806173a1a07826c44e4ed11e 100644 (file)
@@ -2,7 +2,7 @@
  * vout.m: MacOS X video output module
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: vout.m,v 1.85 2004/02/28 13:53:35 titer Exp $
+ * $Id: vout.m,v 1.86 2004/03/03 12:01:57 titer Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -1523,26 +1523,29 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
     [fullScreenContext setFullScreen];
     [fullScreenContext makeCurrentContext];
 
-    /* Fix ratio */
-    unsigned width  = CGDisplayPixelsWide( kCGDirectMainDisplay );
-    unsigned height = CGDisplayPixelsHigh( kCGDirectMainDisplay );
-    if( config_GetInt( p_vout, "macosx-stretch" ) )
+    /* Ratio */
+    unsigned width    = CGDisplayPixelsWide( kCGDirectMainDisplay );
+    unsigned height   = CGDisplayPixelsHigh( kCGDirectMainDisplay );
+    int      stretch  = config_GetInt( p_vout, "macosx-stretch" );
+    int      fill     = config_GetInt( p_vout, "macosx-fill" );
+    int      bigRatio = ( height * p_vout->output.i_aspect <
+                          width * VOUT_ASPECT_FACTOR );
+    if( stretch )
     {
         f_x = 1.0;
         f_y = 1.0;
     }
-    else if( height * p_vout->output.i_aspect <
-                 width * VOUT_ASPECT_FACTOR )
+    else if( ( bigRatio && !fill ) || ( !bigRatio && fill ) )
     {
         f_x = (float) height * p_vout->output.i_aspect /
-            width / VOUT_ASPECT_FACTOR;
+                  width / VOUT_ASPECT_FACTOR;
         f_y = 1.0;
     }
     else
     {
         f_x = 1.0;
         f_y = (float) width * VOUT_ASPECT_FACTOR /
-        p_vout->output.i_aspect / height;
+                  p_vout->output.i_aspect / height;
     }
 
     /* Update viewport, re-init textures */