]> git.sesse.net Git - vlc/commitdiff
macosx: experimental 64bit support
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 12 Apr 2009 15:32:00 +0000 (17:32 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 12 Apr 2009 15:32:10 +0000 (17:32 +0200)
quartztext, controlling playback with the Apple Remote and embedded AGL vouts (aka safari/mozilla plugin vouts) are not supported by now. Quartztext and AGL vout will need a complete rewrite.

The OS X interface no longer depends on the QuickTime framework.

extras/package/macosx/vlc.xcodeproj/project.pbxproj
modules/gui/macosx/embeddedwindow.m
modules/gui/macosx/intf.m
modules/gui/macosx/misc.m
modules/gui/macosx/update.m
modules/gui/macosx/vout.m
modules/gui/macosx/voutgl.m
modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
modules/gui/minimal_macosx/voutagl.m
modules/gui/minimal_macosx/voutgl.m

index 04ed304218c93e85ad1158a39b8e9f558f3504cb..6d909ab96bc75989abffcc8195c0fa975b1229ab 100644 (file)
                CC402F430E00ABBB006A4BA4 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC1941240B9C1F8400635F6B /* QTKit.framework */; };
                CC402F440E00ABBB006A4BA4 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC962E2C0CC7992800A56695 /* WebKit.framework */; };
                CCB60A420E6E5E3F00407004 /* VLM.nib in Resources */ = {isa = PBXBuildFile; fileRef = CCB60A400E6E5E3F00407004 /* VLM.nib */; };
+               CCBE999F0F922C51000705F8 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CCBE999E0F922C51000705F8 /* CoreServices.framework */; };
                CCD90F4E0E87C86D0034564A /* add_schedule.png in Resources */ = {isa = PBXBuildFile; fileRef = CCD90F4B0E87C86D0034564A /* add_schedule.png */; };
                CCD90F4F0E87C86D0034564A /* add_vod.png in Resources */ = {isa = PBXBuildFile; fileRef = CCD90F4C0E87C86D0034564A /* add_vod.png */; };
                CCD90F500E87C86D0034564A /* add_broadcast.png in Resources */ = {isa = PBXBuildFile; fileRef = CCD90F4D0E87C86D0034564A /* add_broadcast.png */; };
                CCB60A3E0E6E5DD900407004 /* vlm.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = vlm.m; path = ../../../modules/gui/macosx/vlm.m; sourceTree = SOURCE_ROOT; };
                CCB60A3F0E6E5DD900407004 /* vlm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vlm.h; path = ../../../modules/gui/macosx/vlm.h; sourceTree = SOURCE_ROOT; };
                CCB60A410E6E5E3F00407004 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/VLM.nib; sourceTree = "<group>"; };
+               CCBE999E0F922C51000705F8 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
                CCC593780AB4A9FB0004FF52 /* embeddedwindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = embeddedwindow.h; path = ../../../modules/gui/macosx/embeddedwindow.h; sourceTree = SOURCE_ROOT; };
                CCC593790AB4A9FB0004FF52 /* embeddedwindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = embeddedwindow.m; path = ../../../modules/gui/macosx/embeddedwindow.m; sourceTree = SOURCE_ROOT; };
                CCC895830D9A8A82005AE59C /* eyetv.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = eyetv.m; path = ../../../modules/access/eyetv.m; sourceTree = SOURCE_ROOT; };
                                CC402F420E00ABBB006A4BA4 /* ApplicationServices.framework in Frameworks */,
                                CC402F430E00ABBB006A4BA4 /* QTKit.framework in Frameworks */,
                                CC402F440E00ABBB006A4BA4 /* WebKit.framework in Frameworks */,
+                               CCBE999F0F922C51000705F8 /* CoreServices.framework in Frameworks */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = {
                        isa = PBXGroup;
                        children = (
+                               CCBE999E0F922C51000705F8 /* CoreServices.framework */,
                                CC962E2C0CC7992800A56695 /* WebKit.framework */,
                                CC1941240B9C1F8400635F6B /* QTKit.framework */,
                                CC3DC89B0A7CDB9600B53F32 /* ApplicationServices.framework */,
index 8dc03299d2e26b5aa9061970d29b2b4ad92e1549..0dc8bd28c8dd3dd2f3c2350c40e539afdf4e91f7 100644 (file)
@@ -27,7 +27,7 @@
  *****************************************************************************/
 
 /* DisableScreenUpdates, SetSystemUIMode, ... */
-#import <QuickTime/QuickTime.h>
+#import <Carbon/Carbon.h>
 
 #import "intf.h"
 #import "controls.h"
         }
  
         /* Make sure we don't see the o_view disappearing of the screen during this operation */
-        DisableScreenUpdates();
-        [[self contentView] replaceSubview:o_view with:o_temp_view];
+               #ifndef __x86_64__
+                       DisableScreenUpdates();
+               #endif
+               [[self contentView] replaceSubview:o_view with:o_temp_view];
         [o_temp_view setFrame:[o_view frame]];
         [o_fullscreen_window setContentView:o_view];
         [o_fullscreen_window makeKeyAndOrderFront:self];
-        EnableScreenUpdates();
+               #ifndef __x86_64__
+                       EnableScreenUpdates();
+               #endif
     }
 
     /* We are in fullscreen (and no animation is running) */
 {
     /* This function is private and should be only triggered at the end of the fullscreen change animation */
     /* Make sure we don't see the o_view disappearing of the screen during this operation */
-    DisableScreenUpdates();
+       #ifndef __x86_64__
+               DisableScreenUpdates();
+       #endif
     [o_view retain];
     [o_view removeFromSuperviewWithoutNeedingDisplay];
     [[self contentView] replaceSubview:o_temp_view with:o_view];
     if ([self isVisible])
         [super makeKeyAndOrderFront:self]; /* our version contains a workaround */
     [o_fullscreen_window orderOut: self];
-    EnableScreenUpdates();
+       #ifndef __x86_64__
+               EnableScreenUpdates();
+       #endif
 
     [o_fullscreen_window release];
     o_fullscreen_window = nil;
index e7d1b63de2d74bb04c9643c5af3a4b83307c4cda..a6469f7816165652e0c9bea1b13e5e4a62ad7dc4 100644 (file)
@@ -293,9 +293,11 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     i_lastShownVolume = -1;
 
+#ifndef __x86_64__
     o_remote = [[AppleRemote alloc] init];
     [o_remote setClickCountEnabledButtons: kRemoteButtonPlay];
     [o_remote setDelegate: _o_sharedMainInstance];
+#endif
 
     o_eyetv = [[VLCEyeTVController alloc] init];
 
@@ -943,11 +945,15 @@ static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";
    application */
 - (void)applicationDidBecomeActive:(NSNotification *)aNotification
 {
+#ifndef __x86_64__
     [o_remote startListening: self];
+#endif
 }
 - (void)applicationDidResignActive:(NSNotification *)aNotification
 {
+#ifndef __x86_64__
     [o_remote stopListening: self];
+#endif
 }
 
 /* Triggered when the computer goes to sleep */
@@ -2497,8 +2503,9 @@ end:
 
     if( [o_msg_arr count] + 2 > 400 )
     {
-        unsigned rid[] = { 0, 1 };
-        [o_msg_arr removeObjectsFromIndices: (unsigned *)&rid
+        NSUInteger rid[] = { 0, 1 };
+               /* FIXME: THIS METHOD WILL BE DEPRECATED */
+        [o_msg_arr removeObjectsFromIndices: (NSUInteger *)&rid
                                  numIndices: sizeof(rid)/sizeof(rid[0])];
     }
 
index fad7b0f538f5f6d2833b160e613559a8a75af2d5..b2b3dbdca54781a6be9004a7c6fabed677f624ac 100644 (file)
@@ -23,7 +23,7 @@
  *****************************************************************************/
 
 #import <Cocoa/Cocoa.h>
-#import <QuickTime/QuickTime.h>
+#import <Carbon/Carbon.h>
 
 #import "intf.h"                                          /* VLCApplication */
 #import "misc.h"
@@ -157,7 +157,7 @@ static NSMutableArray *blackoutWindows = NULL;
 
 - (CGDirectDisplayID)displayID
 {
-    return (CGDirectDisplayID)_screenNumber;
+       return (CGDirectDisplayID)[[[self deviceDescription] objectForKey: @"NSScreenNumber"] intValue];
 }
 
 - (void)blackoutOtherScreens
@@ -689,7 +689,7 @@ void _drawFrameInRect(NSRect frameRect)
         [newCell setNumberOfTickMarks:[oldCell numberOfTickMarks]];
         [newCell setEditable:[oldCell isEditable]];
         [newCell setEnabled:[oldCell isEnabled]];
-        [newCell setEntryType:[oldCell entryType]];
+        [newCell setFormatter:[oldCell formatter]];
         [newCell setHighlighted:[oldCell isHighlighted]];
         [newCell setTickMarkPosition:[oldCell tickMarkPosition]];
         [self setCell:newCell];
index 561298fe8c917454c462a752d18ba213cf211cec..12f162b56c904891572be1e18bad2c0d8260f6e8 100644 (file)
@@ -98,7 +98,7 @@ static VLCUpdate *_o_sharedInstance = nil;
     if( ![[NSUserDefaults standardUserDefaults] objectForKey: kPrefUpdateOnStartup] )
     {
         /* We don't have any preferences stored, ask the user. */
-        int res = NSRunInformationalAlertPanel( _NS("Do you want VLC to check for updates automatically?"),
+        NSInteger res = NSRunInformationalAlertPanel( _NS("Do you want VLC to check for updates automatically?"),
               _NS("You can change this option in VLC's update window later on."), _NS("Yes"), _NS("No"), nil );
         [self setShouldCheckUpdate: res];
     }
index 6db6e48fa7d6d42419fafde58759ded6a359033c..618831568b68bf9caed22e4c16564c31ed05863b 100644 (file)
 #include <stdlib.h>                                                /* free() */
 #include <string.h>
 
-/* BeginFullScreen, EndFullScreen */
-#include <QuickTime/QuickTime.h>
-
 /* prevent system sleep */
 #import <CoreServices/CoreServices.h>
+#import <CoreServices/../Frameworks/OSServices.framework/Headers/Power.h>
+
+/* SystemUIMode */
+#import <Carbon/Carbon.h>
 
 #include <vlc_keys.h>
 
index 41ebd2b549334628d92c4ba3722b00801903227f..cdda0298653e6ca5ea045f2e2108946e0bcfd065 100644 (file)
@@ -63,8 +63,10 @@ struct vout_sys_t
     bool                b_saved_frame;
     NSRect              s_frame;
     bool                b_got_frame;
-    /* Mozilla plugin-related variables */
+
+    /* Mozilla plugin-related variables (not 64bit compatible) */
     bool                b_embedded;
+#ifndef __x86_64__
     AGLContext          agl_ctx;
     AGLDrawable         agl_drawable;
     int                 i_offx, i_offy;
@@ -73,6 +75,7 @@ struct vout_sys_t
     WindowGroupRef      winGroup;
     bool                b_clipped_out;
     Rect                clipBounds, viewBounds;
+#endif
 };
 
 /*****************************************************************************
@@ -87,6 +90,7 @@ static void Swap   ( vout_thread_t * p_vout );
 static int  Lock   ( vout_thread_t * p_vout );
 static void Unlock ( vout_thread_t * p_vout );
 
+#ifndef __x86_64__
 static int  aglInit   ( vout_thread_t * p_vout );
 static void aglEnd    ( vout_thread_t * p_vout );
 static int  aglManage ( vout_thread_t * p_vout );
@@ -94,6 +98,7 @@ static int  aglControl( vout_thread_t *, int, va_list );
 static void aglSwap   ( vout_thread_t * p_vout );
 static int  aglLock   ( vout_thread_t * p_vout );
 static void aglUnlock ( vout_thread_t * p_vout );
+#endif
 
 int OpenVideoGL  ( vlc_object_t * p_this )
 {
@@ -113,6 +118,7 @@ int OpenVideoGL  ( vlc_object_t * p_this )
 
     memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
 
+#ifndef __x86_64__
     var_Get( p_vout->p_libvlc, "drawable-agl", &value_drawable );
     if( value_drawable.i_int != 0 )
     {
@@ -167,6 +173,7 @@ int OpenVideoGL  ( vlc_object_t * p_this )
     }
     else
     {
+#endif
         NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
 
         p_vout->p_sys->b_embedded = false;
@@ -189,7 +196,9 @@ int OpenVideoGL  ( vlc_object_t * p_this )
         p_vout->pf_swap   = Swap;
         p_vout->pf_lock   = Lock;
         p_vout->pf_unlock = Unlock;
+#ifndef __x86_64__
     }
+#endif
     p_vout->p_sys->b_got_frame = false;
 
     return VLC_SUCCESS;
@@ -201,6 +210,7 @@ void CloseVideoGL ( vlc_object_t * p_this )
 
     msg_Dbg( p_this, "Closing" );
 
+#ifndef __x86_64__
     if( p_vout->p_sys->b_embedded )
     {
         if( p_vout->p_sys->agl_ctx )
@@ -218,6 +228,17 @@ void CloseVideoGL ( vlc_object_t * p_this )
 
         [o_pool release];
     }
+#else
+       if(VLCIntf && vlc_object_alive (VLCIntf))
+    {
+        NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
+
+        /* Close the window */
+        [p_vout->p_sys->o_vout_view performSelectorOnMainThread:@selector(closeVout) withObject:NULL waitUntilDone:YES];
+
+        [o_pool release];
+    }
+#endif
     /* Clean up */
     free( p_vout->p_sys );
 }
@@ -490,6 +511,8 @@ static void Unlock( vout_thread_t * p_vout )
  * embedded AGL context implementation
  *****************************************************************************/
 
+#ifndef __x86_64__
+
 static void aglSetViewport( vout_thread_t *p_vout, Rect viewBounds, Rect clipBounds );
 static void aglReshape( vout_thread_t * p_vout );
 static OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
@@ -1068,3 +1091,4 @@ static void aglUnlock( vout_thread_t * p_vout )
     }
 }
 
+#endif
index 1ea5c7b346331e246bc4faa79b2f2ef2910c70fb..f00b832058ea0989a206665c505aab3c90dbd197 100644 (file)
@@ -30,7 +30,7 @@
 #include "VLCMinimalVoutWindow.h"
 
 /* SetSystemUIMode, ... */
-#import <QuickTime/QuickTime.h>
+#import <Carbon/Carbon.h>
 
 #import <Cocoa/Cocoa.h>
 
index 848dd0df0c5e2b8ec742af48d2a395f9e3a7dcc7..710176ac49a7063c16244d0bf72731f59ec62b43 100644 (file)
 #include "voutagl.h"
 
 /*****************************************************************************
- * embedded AGL context implementation
+ * embedded AGL context implementation (not 64bit compatible)
  *****************************************************************************/
 
+#ifndef __x86_64__
 static void aglSetViewport( vout_thread_t *p_vout, Rect viewBounds, Rect clipBounds );
 static void aglReshape( vout_thread_t * p_vout );
 static OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
@@ -672,3 +673,5 @@ void aglUnlock( vout_thread_t * p_vout )
     }
 #endif
 }
+
+#endif
index c6334e9b86a13d4ccbb7a894d34030bf5a14af57..2fd0f41a545b721cfeccab49df4740218576cde4 100644 (file)
@@ -57,7 +57,8 @@ int OpenVideoGL  ( vlc_object_t * p_this )
     i_drawable_agl = var_GetInteger( p_vout->p_libvlc, "drawable-agl" );
     i_drawable_gl = var_GetInteger( p_vout->p_libvlc, "drawable-gl" );
 
-    /* Are we in the mozilla plugin ? */
+    /* Are we in the mozilla plugin, which isn't 64bit compatible ? */
+#ifndef __x86_64__
     if( i_drawable_agl > 0 )
     {
         p_vout->pf_init             = aglInit;
@@ -79,6 +80,16 @@ int OpenVideoGL  ( vlc_object_t * p_this )
         p_vout->pf_lock   = cocoaglvoutviewLock;
         p_vout->pf_unlock = cocoaglvoutviewUnlock;
     }
+#else
+       /* Let's use the VLCOpenGLVoutView.m class */
+       p_vout->pf_init   = cocoaglvoutviewInit;
+       p_vout->pf_end    = cocoaglvoutviewEnd;
+       p_vout->pf_manage = cocoaglvoutviewManage;
+       p_vout->pf_control= cocoaglvoutviewControl;
+       p_vout->pf_swap   = cocoaglvoutviewSwap;
+       p_vout->pf_lock   = cocoaglvoutviewLock;
+       p_vout->pf_unlock = cocoaglvoutviewUnlock;
+#endif
     p_vout->p_sys->b_got_frame = false;
 
     return VLC_SUCCESS;