]> git.sesse.net Git - vlc/commitdiff
macosx-port: removed compatibility code for outdated versions of OS X
authorFelix Paul Kühne <fkuehne@videolan.org>
Wed, 18 Feb 2009 11:14:25 +0000 (12:14 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 19 Feb 2009 14:37:32 +0000 (15:37 +0100)
modules/codec/quicktime.c
modules/gui/macosx/embeddedwindow.m
modules/misc/quartztext.c
projects/macosx/vlc_app/Sources/VLCBrowsableVideoView.m
src/misc/darwin_specific.c

index fd75b64ed25ab76b3427a271f2dc6734d39a1a5a..e5b5778160a776e1dc439c7b07cc61e4efbc4f25 100644 (file)
@@ -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 <fenrir at via.ecp.fr>
@@ -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
 
index 540cbfc3c5692f4cb2411817fc0c092b66814d7b..9ee0397234c998221379ffdacf600552bad3a984 100644 (file)
@@ -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 <bigben at videolan dot org>
         [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;
  
         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)
     {
         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;
 
index 31d64cb4ba7e2995ce0ab4b3964a918addf7e317..a19c2a3cfd1df8829067bed9277187d67c2dcba1 100644 (file)
@@ -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 <bitmap@videolan.org>
@@ -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;
     }
index b504b8b52210ba71eb11f7eb70d803d75f7d1069..d34d210d7d5956470675aefa899a4e3522d79564 100644 (file)
@@ -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 <pdherbemont # videolan.org>
 
         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;
  
 
     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;
 
index f751c63c8ea939859b22b35a40ded2b91ad5f4ac..f47ddbf4c2c66adb890d480917111e2da555fdcb 100644 (file)
@@ -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 <sam@zoy.org>
 # 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 );