Commit 47801e51 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx-port: removed compatibility code for outdated versions of OS X

parent a8038909
/***************************************************************************** /*****************************************************************************
* quicktime.c: a quicktime decoder that uses the QT library/dll * quicktime.c: a quicktime decoder that uses the QT library/dll
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 the VideoLAN team * Copyright (C) 2003, 2008 - 2009 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Laurent Aimar <fenrir at via.ecp.fr> * Authors: Laurent Aimar <fenrir at via.ecp.fr>
...@@ -234,9 +234,13 @@ static int Open( vlc_object_t *p_this ) ...@@ -234,9 +234,13 @@ static int Open( vlc_object_t *p_this )
err = Gestalt(gestaltQuickTimeVersion, &qtVersion); err = Gestalt(gestaltQuickTimeVersion, &qtVersion);
err = Gestalt(gestaltSystemVersion, &macosversion); err = Gestalt(gestaltSystemVersion, &macosversion);
#ifndef NDEBUG #ifndef NDEBUG
msg_Dbg( p_this, "mac os version is %#lx", macosversion ); msg_Dbg( p_this, "Mac OS version is %#lx", macosversion );
msg_Dbg( p_this, "quicktime version is %#lx", qtVersion ); msg_Dbg( p_this, "Quicktime version is %#lx", qtVersion );
#endif #endif
/* bail out. This plugin is soo Carbon, that it can't be used on 10.5 at all */
msg_Info( p_dec, "Your Mac OS version is to new to use this plugin for anything." );
return VLC_EGENERIC;
#endif #endif
switch( p_dec->fmt_in.i_codec ) switch( p_dec->fmt_in.i_codec )
...@@ -307,19 +311,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -307,19 +311,6 @@ static int Open( vlc_object_t *p_this )
p_dec->fmt_out.i_cat = AUDIO_ES; p_dec->fmt_out.i_cat = AUDIO_ES;
return VLC_SUCCESS; return VLC_SUCCESS;
#else #else
#ifdef __APPLE__
/* FIXME: right now, we don't support audio decoding on 10.5 and later
because we are still using the hardcore-outdated SoundManager API,
which was removed after 10.4 */
if( macosversion >= 0x1050 || err != noErr )
{
msg_Warn( p_dec, "Your Mac OS version doesn't have SoundManager anymore. "
"You can't use this plugin for audio." );
return VLC_EGENERIC;
}
#endif
return OpenAudio( p_dec ); return OpenAudio( p_dec );
#endif #endif
......
/***************************************************************************** /*****************************************************************************
* embeddedwindow.m: MacOS X interface module * embeddedwindow.m: MacOS X interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2005-2008 the VideoLAN team * Copyright (C) 2005-2009 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Benjamin Pracht <bigben at videolan dot org> * Authors: Benjamin Pracht <bigben at videolan dot org>
...@@ -261,10 +261,9 @@ ...@@ -261,10 +261,9 @@
[o_fullscreen_window setBackgroundColor: [NSColor blackColor]]; [o_fullscreen_window setBackgroundColor: [NSColor blackColor]];
[o_fullscreen_window setCanBecomeKeyWindow: YES]; [o_fullscreen_window setCanBecomeKeyWindow: YES];
if (![self isVisible] || [self alphaValue] == 0.0 || MACOS_VERSION < 10.4f) if (![self isVisible] || [self alphaValue] == 0.0)
{ {
/* We don't animate if we are not visible or if we are running on /* We don't animate if we are not visible, instead we
* Mac OS X <10.4 which doesn't support NSAnimation, instead we
* simply fade the display */ * simply fade the display */
CGDisplayFadeReservationToken token; CGDisplayFadeReservationToken token;
...@@ -301,14 +300,6 @@ ...@@ -301,14 +300,6 @@
EnableScreenUpdates(); EnableScreenUpdates();
} }
if (MACOS_VERSION < 10.4f)
{
/* We were already fullscreen nothing to do when NSAnimation
* is not supported */
[self unlockFullscreenAnimation];
return;
}
/* We are in fullscreen (and no animation is running) */ /* We are in fullscreen (and no animation is running) */
if (b_fullscreen) if (b_fullscreen)
{ {
...@@ -410,10 +401,9 @@ ...@@ -410,10 +401,9 @@
return; return;
} }
if (fadeout || MACOS_VERSION < 10.4f) if (fadeout)
{ {
/* We don't animate if we are not visible or if we are running on /* We don't animate if we are not visible, instead we
* Mac OS X <10.4 which doesn't support NSAnimation, instead we
* simply fade the display */ * simply fade the display */
CGDisplayFadeReservationToken token; CGDisplayFadeReservationToken token;
......
/***************************************************************************** /*****************************************************************************
* quartztext.c : Put text on the video, using Mac OS X Quartz Engine * quartztext.c : Put text on the video, using Mac OS X Quartz Engine
***************************************************************************** *****************************************************************************
* Copyright (C) 2007 the VideoLAN team * Copyright (C) 2007, 2009 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Bernie Purcell <bitmap@videolan.org> * Authors: Bernie Purcell <bitmap@videolan.org>
...@@ -667,11 +667,7 @@ static CGContextRef CreateOffScreenContext( int i_width, int i_height, ...@@ -667,11 +667,7 @@ static CGContextRef CreateOffScreenContext( int i_width, int i_height,
p_bitmap->p_data = calloc( i_height, p_bitmap->i_bytesPerRow ); p_bitmap->p_data = calloc( i_height, p_bitmap->i_bytesPerRow );
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
*pp_colorSpace = CGColorSpaceCreateWithName( kCGColorSpaceGenericRGB ); *pp_colorSpace = CGColorSpaceCreateWithName( kCGColorSpaceGenericRGB );
#else
*pp_colorSpace = CreateGenericRGBColorSpace();
#endif
if( p_bitmap->p_data && *pp_colorSpace ) if( p_bitmap->p_data && *pp_colorSpace )
{ {
...@@ -681,14 +677,10 @@ static CGContextRef CreateOffScreenContext( int i_width, int i_height, ...@@ -681,14 +677,10 @@ static CGContextRef CreateOffScreenContext( int i_width, int i_height,
} }
if( p_context ) if( p_context )
{ {
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_1
// OS X 10.1 doesn't support weak linking of this call which is only available
// int 10.4 and later
if( CGContextSetAllowsAntialiasing != NULL ) if( CGContextSetAllowsAntialiasing != NULL )
{ {
CGContextSetAllowsAntialiasing( p_context, true ); CGContextSetAllowsAntialiasing( p_context, true );
} }
#endif
} }
*pp_memory = p_bitmap; *pp_memory = p_bitmap;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* browsing * browsing
***************************************************************************** *****************************************************************************
* Copyright (C) 2007 Pierre d'Herbemont * Copyright (C) 2007 Pierre d'Herbemont
* Copyright (C) 2007 the VideoLAN team * Copyright (C) 2007, 2009 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Pierre d'Herbemont <pdherbemont # videolan.org> * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
...@@ -683,8 +683,7 @@ ...@@ -683,8 +683,7 @@
if (![[self window] isVisible] || [[self window] alphaValue] == 0.0 || [self isHiddenOrHasHiddenAncestor] ) if (![[self window] isVisible] || [[self window] alphaValue] == 0.0 || [self isHiddenOrHasHiddenAncestor] )
{ {
/* We don't animate if we are not visible or if we are running on /* We don't animate if we are not visible, instead we
* Mac OS X <10.4 which doesn't support NSAnimation, instead we
* simply fade the display */ * simply fade the display */
CGDisplayFadeReservationToken token; CGDisplayFadeReservationToken token;
...@@ -817,8 +816,7 @@ ...@@ -817,8 +816,7 @@
if (fadeout || [tempFullScreenView isHiddenOrHasHiddenAncestor]) if (fadeout || [tempFullScreenView isHiddenOrHasHiddenAncestor])
{ {
/* We don't animate if we are not visible or if we are running on /* We don't animate if we are not visible, instead we
* Mac OS X <10.4 which doesn't support NSAnimation, instead we
* simply fade the display */ * simply fade the display */
CGDisplayFadeReservationToken token; CGDisplayFadeReservationToken token;
......
/***************************************************************************** /*****************************************************************************
* darwin_specific.m: Darwin specific features * darwin_specific.m: Darwin specific features
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2007 the VideoLAN team * Copyright (C) 2001-2009 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Sam Hocevar <sam@zoy.org> * Authors: Sam Hocevar <sam@zoy.org>
...@@ -44,33 +44,6 @@ ...@@ -44,33 +44,6 @@
# define MAXPATHLEN 1024 # define MAXPATHLEN 1024
#endif #endif
/* CFLocaleCopyAvailableLocaleIdentifiers is present only on post-10.4 */
extern CFArrayRef CFLocaleCopyAvailableLocaleIdentifiers(void) __attribute__((weak_import));
/* emulate CFLocaleCopyAvailableLocaleIdentifiers on pre-10.4 */
static CFArrayRef copy_all_locale_indentifiers(void)
{
CFMutableArrayRef available_locales;
DIR * dir;
struct dirent *file;
dir = opendir( "/usr/share/locale" );
available_locales = CFArrayCreateMutable( kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks );
while ( (file = readdir(dir)) )
{
/* we should probably filter out garbage */
/* we can't use CFStringCreateWithFileSystemRepresentation as it is
* supported only on post-10.4 (and this function is only for pre-10.4) */
CFStringRef locale = CFStringCreateWithCString( kCFAllocatorDefault, file->d_name, kCFStringEncodingUTF8 );
CFArrayAppendValue( available_locales, (void*)locale );
CFRelease( locale );
}
closedir( dir );
return available_locales;
}
/***************************************************************************** /*****************************************************************************
* system_Init: fill in program path & retrieve language * system_Init: fill in program path & retrieve language
*****************************************************************************/ *****************************************************************************/
...@@ -149,10 +122,7 @@ void system_Init( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] ) ...@@ -149,10 +122,7 @@ void system_Init( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] )
CFArrayRef all_locales, preferred_locales; CFArrayRef all_locales, preferred_locales;
char psz_locale[50]; char psz_locale[50];
if( CFLocaleCopyAvailableLocaleIdentifiers )
all_locales = CFLocaleCopyAvailableLocaleIdentifiers(); all_locales = CFLocaleCopyAvailableLocaleIdentifiers();
else
all_locales = copy_all_locale_indentifiers();
preferred_locales = CFBundleCopyLocalizationsForPreferences( all_locales, NULL ); preferred_locales = CFBundleCopyLocalizationsForPreferences( all_locales, NULL );
......
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