Mercurial > mplayer.hg
comparison libvo/vo_macosx.m @ 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 | d47744b95b78 |
children | 8f31ea9bca98 |
comparison
equal
deleted
inserted
replaced
27987:292b260ac2df | 27988:84bad10e6d8d |
---|---|
8 | 8 |
9 #import "vo_macosx.h" | 9 #import "vo_macosx.h" |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
11 #include <sys/ipc.h> | 11 #include <sys/ipc.h> |
12 #include <sys/shm.h> | 12 #include <sys/shm.h> |
13 #include <CoreServices/CoreServices.h> | |
14 //special workaround for Apple bug #6267445 | |
15 //(OSServices Power API disabled in OSServices.h for 64bit systems) | |
16 #ifndef __POWER__ | |
17 #include <CoreServices/../Frameworks/OSServices.framework/Headers/Power.h> | |
18 #endif | |
13 | 19 |
14 //MPLAYER | 20 //MPLAYER |
15 #include "config.h" | 21 #include "config.h" |
16 #include "fastmemcpy.h" | 22 #include "fastmemcpy.h" |
17 #include "video_out.h" | 23 #include "video_out.h" |
326 | 332 |
327 if(!shared_buffer) | 333 if(!shared_buffer) |
328 { | 334 { |
329 #if !defined (CONFIG_MACOSX_FINDER) || !defined (CONFIG_SDL) | 335 #if !defined (CONFIG_MACOSX_FINDER) || !defined (CONFIG_SDL) |
330 //this chunk of code is heavily based off SDL_macosx.m from SDL | 336 //this chunk of code is heavily based off SDL_macosx.m from SDL |
331 //it uses an Apple private function to request foreground operation | |
332 void CPSEnableForegroundOperation(ProcessSerialNumber* psn); | |
333 ProcessSerialNumber myProc, frProc; | 337 ProcessSerialNumber myProc, frProc; |
334 Boolean sameProc; | 338 Boolean sameProc; |
335 | 339 |
336 if (GetFrontProcess(&frProc) == noErr) | 340 if (GetFrontProcess(&frProc) == noErr) |
337 { | 341 { |
338 if (GetCurrentProcess(&myProc) == noErr) | 342 if (GetCurrentProcess(&myProc) == noErr) |
339 { | 343 { |
340 if (SameProcess(&frProc, &myProc, &sameProc) == noErr && !sameProc) | 344 if (SameProcess(&frProc, &myProc, &sameProc) == noErr && !sameProc) |
341 { | 345 { |
342 CPSEnableForegroundOperation(&myProc); | 346 TransformProcessType(&myProc, kProcessTransformToForegroundApplication); |
343 } | 347 } |
344 SetFrontProcess(&myProc); | 348 SetFrontProcess(&myProc); |
345 } | 349 } |
346 } | 350 } |
347 #endif | 351 #endif |