Commit c6553ec2 authored by Eric Petit's avatar Eric Petit

macsox/* : added --macosx-fill

  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)
parent 90c26e78
......@@ -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();
......@@ -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,16 +1523,19 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
[fullScreenContext setFullScreen];
[fullScreenContext makeCurrentContext];
/* Fix ratio */
/* Ratio */
unsigned width = CGDisplayPixelsWide( kCGDirectMainDisplay );
unsigned height = CGDisplayPixelsHigh( kCGDirectMainDisplay );
if( config_GetInt( p_vout, "macosx-stretch" ) )
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment