From: Felix Paul Kühne Date: Wed, 18 Feb 2009 11:14:25 +0000 (+0100) Subject: macosx-port: removed compatibility code for outdated versions of OS X X-Git-Tag: 1.0.0-pre1~572 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=47801e515603ae4e395f16254b5222fb71fc3427;p=vlc macosx-port: removed compatibility code for outdated versions of OS X --- diff --git a/modules/codec/quicktime.c b/modules/codec/quicktime.c index fd75b64ed2..e5b5778160 100644 --- a/modules/codec/quicktime.c +++ b/modules/codec/quicktime.c @@ -1,7 +1,7 @@ /***************************************************************************** * 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$ * * Authors: Laurent Aimar @@ -234,9 +234,13 @@ static int Open( vlc_object_t *p_this ) err = Gestalt(gestaltQuickTimeVersion, &qtVersion); err = Gestalt(gestaltSystemVersion, &macosversion); #ifndef NDEBUG - msg_Dbg( p_this, "mac os version is %#lx", macosversion ); - msg_Dbg( p_this, "quicktime version is %#lx", qtVersion ); + msg_Dbg( p_this, "Mac OS version is %#lx", macosversion ); + msg_Dbg( p_this, "Quicktime version is %#lx", qtVersion ); #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 switch( p_dec->fmt_in.i_codec ) @@ -307,19 +311,6 @@ static int Open( vlc_object_t *p_this ) p_dec->fmt_out.i_cat = AUDIO_ES; return VLC_SUCCESS; #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 ); #endif diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/macosx/embeddedwindow.m index 540cbfc3c5..9ee0397234 100644 --- a/modules/gui/macosx/embeddedwindow.m +++ b/modules/gui/macosx/embeddedwindow.m @@ -1,7 +1,7 @@ /***************************************************************************** * embeddedwindow.m: MacOS X interface module ***************************************************************************** - * Copyright (C) 2005-2008 the VideoLAN team + * Copyright (C) 2005-2009 the VideoLAN team * $Id$ * * Authors: Benjamin Pracht @@ -261,10 +261,9 @@ [o_fullscreen_window setBackgroundColor: [NSColor blackColor]]; [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 - * Mac OS X <10.4 which doesn't support NSAnimation, instead we + /* We don't animate if we are not visible, instead we * simply fade the display */ CGDisplayFadeReservationToken token; @@ -301,14 +300,6 @@ 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) */ if (b_fullscreen) { @@ -410,10 +401,9 @@ return; } - if (fadeout || MACOS_VERSION < 10.4f) + if (fadeout) { - /* We don't animate if we are not visible or if we are running on - * Mac OS X <10.4 which doesn't support NSAnimation, instead we + /* We don't animate if we are not visible, instead we * simply fade the display */ CGDisplayFadeReservationToken token; diff --git a/modules/misc/quartztext.c b/modules/misc/quartztext.c index 31d64cb4ba..a19c2a3cfd 100644 --- a/modules/misc/quartztext.c +++ b/modules/misc/quartztext.c @@ -1,7 +1,7 @@ /***************************************************************************** * 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$ * * Authors: Bernie Purcell @@ -667,11 +667,7 @@ static CGContextRef CreateOffScreenContext( int i_width, int i_height, 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 ); -#else - *pp_colorSpace = CreateGenericRGBColorSpace(); -#endif if( p_bitmap->p_data && *pp_colorSpace ) { @@ -681,14 +677,10 @@ static CGContextRef CreateOffScreenContext( int i_width, int i_height, } 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 ) { CGContextSetAllowsAntialiasing( p_context, true ); } -#endif } *pp_memory = p_bitmap; } diff --git a/projects/macosx/vlc_app/Sources/VLCBrowsableVideoView.m b/projects/macosx/vlc_app/Sources/VLCBrowsableVideoView.m index b504b8b522..d34d210d7d 100644 --- a/projects/macosx/vlc_app/Sources/VLCBrowsableVideoView.m +++ b/projects/macosx/vlc_app/Sources/VLCBrowsableVideoView.m @@ -3,7 +3,7 @@ * browsing ***************************************************************************** * Copyright (C) 2007 Pierre d'Herbemont - * Copyright (C) 2007 the VideoLAN team + * Copyright (C) 2007, 2009 the VideoLAN team * $Id$ * * Authors: Pierre d'Herbemont @@ -683,8 +683,7 @@ 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 - * Mac OS X <10.4 which doesn't support NSAnimation, instead we + /* We don't animate if we are not visible, instead we * simply fade the display */ CGDisplayFadeReservationToken token; @@ -817,8 +816,7 @@ if (fadeout || [tempFullScreenView isHiddenOrHasHiddenAncestor]) { - /* We don't animate if we are not visible or if we are running on - * Mac OS X <10.4 which doesn't support NSAnimation, instead we + /* We don't animate if we are not visible, instead we * simply fade the display */ CGDisplayFadeReservationToken token; diff --git a/src/misc/darwin_specific.c b/src/misc/darwin_specific.c index f751c63c8e..f47ddbf4c2 100644 --- a/src/misc/darwin_specific.c +++ b/src/misc/darwin_specific.c @@ -1,7 +1,7 @@ /***************************************************************************** * darwin_specific.m: Darwin specific features ***************************************************************************** - * Copyright (C) 2001-2007 the VideoLAN team + * Copyright (C) 2001-2009 the VideoLAN team * $Id$ * * Authors: Sam Hocevar @@ -44,33 +44,6 @@ # define MAXPATHLEN 1024 #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 *****************************************************************************/ @@ -149,10 +122,7 @@ void system_Init( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] ) CFArrayRef all_locales, preferred_locales; char psz_locale[50]; - if( CFLocaleCopyAvailableLocaleIdentifiers ) - all_locales = CFLocaleCopyAvailableLocaleIdentifiers(); - else - all_locales = copy_all_locale_indentifiers(); + all_locales = CFLocaleCopyAvailableLocaleIdentifiers(); preferred_locales = CFBundleCopyLocalizationsForPreferences( all_locales, NULL );