[MPlayer-dev-eng] [PATCH] Replaced deprecated QuickDraw calls in vo_quartz

Gregor Riepl onitake at gmail.com
Fri Oct 3 12:57:05 CEST 2008


> Your code does allow to get rid of warnings here on 10.5.5, MacIntel,
> 32 bits mode,

glad to hear that. i don't have a core2duo mac at hand, so i couldn't  
test.

> but there are still lots of warnings and errors when
> compiling in 64 bits mode:

> libvo/vo_quartz.c:57: error: syntax error before 'seqId'
> libvo/vo_quartz.c:58: error: syntax error before 'image_qtcodec'
> libvo/vo_quartz.c:59: error: syntax error before '*' token
> libvo/vo_quartz.c:62: error: syntax error before  
> 'ImageDescriptionHandle'
> libvo/vo_quartz.c:68: error: syntax error before 'matrix'

this is odd. these data types are part of quicktime and not  
deprecated. also, there is an unconditional include of QuickTime.h.

> libvo/vo_quartz.c:299: warning: implicit declaration of function  
> 'FindWindow'
> libvo/vo_quartz.c:347: warning: implicit declaration of function  
> 'ResizeWindow'
> libvo/vo_quartz.c:352: warning: implicit declaration of function  
> 'MenuSelect'
> libvo/vo_quartz.c:353: warning: implicit declaration of function  
> 'HiliteMenu'
......

those are all part of the carbon api. it looks like apple wants to get  
rid of it eventually, as carbon isn't supported in 64bit mode. or they  
just didn't have the resources to port it yet.

> Note that this isn't that much of a problem, as I much prefer to first
> fix deprecation warnings, then addressing 64-bits compilation issues.
>
> I can't really comment on the code as I have no previous knowledge of
> MacOSX multimedia API, but Nicolas Plourde (in CC) should.

thanks, i'll cc him too.

>> Yep. But vo_macosx doesn't compile on 64 bits mode either!
>
> libvo/vo_macosx.m: In function '-[MPlayerOpenGLView render]':
> libvo/vo_macosx.m:778: warning: implicit declaration of function
> 'UpdateSystemActivity'
> libvo/vo_macosx.m:778: error: 'UsrActivity' undeclared (first use in
> this function)
> libvo/vo_macosx.m:778: error: (Each undeclared identifier is  
> reported only once
> libvo/vo_macosx.m:778: error: for each function it appears in.)
> make: *** [libvo/vo_macosx.o] Error 1

looking into this now. the vo_macosx uses cocoa for the window manager  
stuff, corevideo for frame decoding plus... opengl for the rendering?  
interesting approach.
the respective code looks like it was copy-pasted from vo_quartz. let  
me find a different method to disable the screensaver.
instead UsrActivity and the SetSystemUIMode further below, shouldn't  
CGDisplayCapture and CGDisplaySwitchToMode do the trick?
starting from 10.5, there's also the new power management api.
IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep,  
kIOPMAssertionLevelOn, &assId) could work, but i don't know if it  
disables the screensaver.

> That's definitely not a problem. We currently only support 10.4 and
> 10.5 as compile host, and probably 10.3 only though
> "cross-compilation" from a 10.4-5 devel/compile machine.

i'll run a few tests and try different sdks. i won't be able to test  
on 64bit, but i can at least do a 64bit crosscompile.

by the way, in vo_quartz.c, there's this fragment of code:

#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;
	
	if (GetFrontProcess(&frProc) == noErr)
	{
		if (GetCurrentProcess(&myProc) == noErr)
		{
			if (SameProcess(&frProc, &myProc, &sameProc) == noErr && !sameProc)
			{
				CPSEnableForegroundOperation(&myProc);
			}
			SetFrontProcess(&myProc);
		}
	}
}
#endif

i remember seeing something similar in the example SDLmain.m that  
comes with sdl (and it also says in the comments it's from there). i  
patched out the private api call, but it still bothers me a bit. isn't  
there a better way to make a bundleless ui application become front?  
maybe via [NSApp activateIgnoringOtherApps:]?
while googling, i stumbled upon this: http://lists.apple.com/archives/cocoa-dev/2008/Aug/msg00117.html

thanks for your feedback!




More information about the MPlayer-dev-eng mailing list