From ef93d6eb1043e6d374e6c9cfdcf476645f0896d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20Paul=20K=C3=BChne?= Date: Sun, 12 Apr 2009 17:32:00 +0200 Subject: [PATCH] macosx: experimental 64bit support 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. --- .../macosx/vlc.xcodeproj/project.pbxproj | 4 +++ modules/gui/macosx/embeddedwindow.m | 20 +++++++++----- modules/gui/macosx/intf.m | 11 ++++++-- modules/gui/macosx/misc.m | 6 ++--- modules/gui/macosx/update.m | 2 +- modules/gui/macosx/vout.m | 7 ++--- modules/gui/macosx/voutgl.m | 26 ++++++++++++++++++- .../gui/minimal_macosx/VLCMinimalVoutWindow.m | 2 +- modules/gui/minimal_macosx/voutagl.m | 5 +++- modules/gui/minimal_macosx/voutgl.m | 13 +++++++++- 10 files changed, 77 insertions(+), 19 deletions(-) diff --git a/extras/package/macosx/vlc.xcodeproj/project.pbxproj b/extras/package/macosx/vlc.xcodeproj/project.pbxproj index 04ed304218..6d909ab96b 100644 --- a/extras/package/macosx/vlc.xcodeproj/project.pbxproj +++ b/extras/package/macosx/vlc.xcodeproj/project.pbxproj @@ -154,6 +154,7 @@ 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 */; }; @@ -325,6 +326,7 @@ 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 = ""; }; + CCBE999E0F922C51000705F8 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; 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; }; @@ -393,6 +395,7 @@ CC402F420E00ABBB006A4BA4 /* ApplicationServices.framework in Frameworks */, CC402F430E00ABBB006A4BA4 /* QTKit.framework in Frameworks */, CC402F440E00ABBB006A4BA4 /* WebKit.framework in Frameworks */, + CCBE999F0F922C51000705F8 /* CoreServices.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -500,6 +503,7 @@ 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( + CCBE999E0F922C51000705F8 /* CoreServices.framework */, CC962E2C0CC7992800A56695 /* WebKit.framework */, CC1941240B9C1F8400635F6B /* QTKit.framework */, CC3DC89B0A7CDB9600B53F32 /* ApplicationServices.framework */, diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/macosx/embeddedwindow.m index 8dc03299d2..0dc8bd28c8 100644 --- a/modules/gui/macosx/embeddedwindow.m +++ b/modules/gui/macosx/embeddedwindow.m @@ -27,7 +27,7 @@ *****************************************************************************/ /* DisableScreenUpdates, SetSystemUIMode, ... */ -#import +#import #import "intf.h" #import "controls.h" @@ -308,12 +308,16 @@ } /* 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) */ @@ -500,7 +504,9 @@ { /* 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]; @@ -510,7 +516,9 @@ 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; diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index e7d1b63de2..a6469f7816 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -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])]; } diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m index fad7b0f538..b2b3dbdca5 100644 --- a/modules/gui/macosx/misc.m +++ b/modules/gui/macosx/misc.m @@ -23,7 +23,7 @@ *****************************************************************************/ #import -#import +#import #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]; diff --git a/modules/gui/macosx/update.m b/modules/gui/macosx/update.m index 561298fe8c..12f162b56c 100644 --- a/modules/gui/macosx/update.m +++ b/modules/gui/macosx/update.m @@ -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]; } diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m index 6db6e48fa7..618831568b 100644 --- a/modules/gui/macosx/vout.m +++ b/modules/gui/macosx/vout.m @@ -34,11 +34,12 @@ #include /* free() */ #include -/* BeginFullScreen, EndFullScreen */ -#include - /* prevent system sleep */ #import +#import + +/* SystemUIMode */ +#import #include diff --git a/modules/gui/macosx/voutgl.m b/modules/gui/macosx/voutgl.m index 41ebd2b549..cdda029865 100644 --- a/modules/gui/macosx/voutgl.m +++ b/modules/gui/macosx/voutgl.m @@ -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 diff --git a/modules/gui/minimal_macosx/VLCMinimalVoutWindow.m b/modules/gui/minimal_macosx/VLCMinimalVoutWindow.m index 1ea5c7b346..f00b832058 100644 --- a/modules/gui/minimal_macosx/VLCMinimalVoutWindow.m +++ b/modules/gui/minimal_macosx/VLCMinimalVoutWindow.m @@ -30,7 +30,7 @@ #include "VLCMinimalVoutWindow.h" /* SetSystemUIMode, ... */ -#import +#import #import diff --git a/modules/gui/minimal_macosx/voutagl.m b/modules/gui/minimal_macosx/voutagl.m index 848dd0df0c..710176ac49 100644 --- a/modules/gui/minimal_macosx/voutagl.m +++ b/modules/gui/minimal_macosx/voutagl.m @@ -32,9 +32,10 @@ #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 diff --git a/modules/gui/minimal_macosx/voutgl.m b/modules/gui/minimal_macosx/voutgl.m index c6334e9b86..2fd0f41a54 100644 --- a/modules/gui/minimal_macosx/voutgl.m +++ b/modules/gui/minimal_macosx/voutgl.m @@ -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; -- 2.39.2