* 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>
"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") };
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();
* 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>
[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 */