changeset 27988:84bad10e6d8d

Allow vo_macosx to be compiled in 64-bits mode: - Replace usage of undocumented Apple function CPSEnableForegroundOperation() (which is available in 32-bits mode, but not in 64-bits mode) by TransformProcessType() which is public, documented, and available since OSX 10.3. - Work around Apple bug #6267445 since OSServices Power API is diabled in 64-bits systems Based on patch by Gregor Riepl %onitake A gmail P com% posted in thread: date: Fri, Oct 3, 2008 at 4:49 PM subject: Re: [MPlayer-dev-eng] [PATCH] Replaced deprecated QuickDraw calls in vo_quartz
author gpoirier
date Mon, 24 Nov 2008 13:22:18 +0000
parents 292b260ac2df
children 672f98720463
files libvo/vo_macosx.m
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_macosx.m	Mon Nov 24 11:04:50 2008 +0000
+++ b/libvo/vo_macosx.m	Mon Nov 24 13:22:18 2008 +0000
@@ -10,6 +10,12 @@
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/shm.h>
+#include <CoreServices/CoreServices.h>
+//special workaround for Apple bug #6267445
+//(OSServices Power API disabled in OSServices.h for 64bit systems)
+#ifndef __POWER__
+#include <CoreServices/../Frameworks/OSServices.framework/Headers/Power.h>
+#endif
 
 //MPLAYER
 #include "config.h"
@@ -328,8 +334,6 @@
 	{
 		#if !defined (CONFIG_MACOSX_FINDER) || !defined (CONFIG_SDL)
 		//this chunk of code is heavily based off SDL_macosx.m from SDL 
-		//it uses an Apple private function to request foreground operation
-		void CPSEnableForegroundOperation(ProcessSerialNumber* psn);
 		ProcessSerialNumber myProc, frProc;
 		Boolean sameProc;
 
@@ -339,7 +343,7 @@
 			{
 				if (SameProcess(&frProc, &myProc, &sameProc) == noErr && !sameProc)
 				{
-					CPSEnableForegroundOperation(&myProc);
+					TransformProcessType(&myProc, kProcessTransformToForegroundApplication);
 				}
 				SetFrontProcess(&myProc);
 			}