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

Guillaume POIRIER poirierg at gmail.com
Thu Oct 2 23:01:53 CEST 2008


Hello,

On Thu, Oct 2, 2008 at 2:27 PM, onitake <onitake at gmail.com> wrote:
> hello.
>
> when compiling mplayer against a recent (10.4+) sdk, gcc spits out quite a
> few deprecation warnings in the vo_quartz output module. the respective
> functions are part of quickdraw, which is recommended not to be used any
> more, and not supported at all when compiling for 64bit.

Your code does allow to get rid of warnings here on 10.5.5, MacIntel,
32 bits mode, but there are still lots of warnings and errors when
compiling in 64 bits mode:

gcc -arch x86_64 -Wdisabled-optimization -Wno-pointer-sign
-Wdeclaration-after-statement -std=gnu99 -Wall -Wno-switch
-Wpointer-arith -Wredundant-decls -O4   -pipe -ffast-math
-fomit-frame-pointer -mdynamic-no-pic -falign-loops=16 -shared-libgcc
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I.
-I/usr/local/include -I/usr/X11/include   -c -o libvo/vo_quartz.o
libvo/vo_quartz.c
libvo/vo_quartz.c:57: error: syntax error before 'seqId'
libvo/vo_quartz.c:57: warning: type defaults to 'int' in declaration of 'seqId'
libvo/vo_quartz.c:57: warning: data definition has no type or storage class
libvo/vo_quartz.c:58: error: syntax error before 'image_qtcodec'
libvo/vo_quartz.c:58: warning: type defaults to 'int' in declaration
of 'image_qtcodec'
libvo/vo_quartz.c:58: warning: data definition has no type or storage class
libvo/vo_quartz.c:59: error: syntax error before '*' token
libvo/vo_quartz.c:59: warning: type defaults to 'int' in declaration of 'P'
libvo/vo_quartz.c:59: warning: data definition has no type or storage class
libvo/vo_quartz.c:62: error: syntax error before 'ImageDescriptionHandle'
libvo/vo_quartz.c:62: warning: no semicolon at end of struct or union
libvo/vo_quartz.c:67: error: syntax error before '}' token
libvo/vo_quartz.c:67: warning: type defaults to 'int' in declaration
of 'yuv_qt_stuff'
libvo/vo_quartz.c:67: warning: data definition has no type or storage class
libvo/vo_quartz.c:68: error: syntax error before 'matrix'
libvo/vo_quartz.c:68: warning: type defaults to 'int' in declaration of 'matrix'
libvo/vo_quartz.c:68: warning: data definition has no type or storage class
libvo/vo_quartz.c: In function 'draw_alpha':
libvo/vo_quartz.c:208: error: request for member 'componentInfoY' in
something not a structure or union
libvo/vo_quartz.c: In function 'KeyEventHandler':
libvo/vo_quartz.c:251: warning: implicit declaration of function
'SetWindowAlpha'
libvo/vo_quartz.c: In function 'MouseEventHandler':
libvo/vo_quartz.c:299: warning: implicit declaration of function 'FindWindow'
libvo/vo_quartz.c:318: warning: implicit declaration of function
'GetWindowPortBounds'
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'
libvo/vo_quartz.c: In function 'WindowEventHandler':
libvo/vo_quartz.c:415: warning: implicit declaration of function 'SizeWindow'
libvo/vo_quartz.c:445: warning: implicit declaration of function 'CheckMenuItem'
libvo/vo_quartz.c:497: warning: implicit declaration of function
'GetWindowBounds'
libvo/vo_quartz.c: In function 'quartz_CreateWindow':
libvo/vo_quartz.c:558: warning: implicit declaration of function 'ClearMenuBar'
libvo/vo_quartz.c:561: warning: implicit declaration of function
'CreateStandardWindowMenu'
libvo/vo_quartz.c:562: warning: implicit declaration of function 'InsertMenu'
libvo/vo_quartz.c:565: warning: implicit declaration of function 'CreateNewMenu'
libvo/vo_quartz.c:567: warning: implicit declaration of function
'SetMenuTitleWithCFString'
libvo/vo_quartz.c:569: warning: implicit declaration of function
'AppendMenuItemTextWithCFString'
libvo/vo_quartz.c:570: warning: implicit declaration of function
'SetMenuItemCommandKey'
libvo/vo_quartz.c:589: warning: implicit declaration of function
'SetMenuItemHierarchicalMenu'
libvo/vo_quartz.c:600: warning: implicit declaration of function 'GetMenuID'
libvo/vo_quartz.c:602: warning: implicit declaration of function 'DrawMenuBar'
libvo/vo_quartz.c:605: warning: implicit declaration of function
'CreateNewWindow'
libvo/vo_quartz.c:607: warning: implicit declaration of function
'CreateWindowGroup'
libvo/vo_quartz.c:608: warning: implicit declaration of function
'SetWindowGroup'
libvo/vo_quartz.c:613: warning: implicit declaration of function
'SetWindowTitleWithCFString'
libvo/vo_quartz.c:618: warning: implicit declaration of function
'GetApplicationEventTarget'
libvo/vo_quartz.c:618: warning: passing argument 1 of
'InstallEventHandler' makes pointer from integer without a cast
libvo/vo_quartz.c:619: warning: passing argument 1 of
'InstallEventHandler' makes pointer from integer without a cast
libvo/vo_quartz.c:620: warning: implicit declaration of function
'GetWindowEventTarget'
libvo/vo_quartz.c:620: warning: passing argument 1 of
'InstallEventHandler' makes pointer from integer without a cast
libvo/vo_quartz.c: In function 'config':
libvo/vo_quartz.c:703: warning: implicit declaration of function
'QDBeginCGContext'
libvo/vo_quartz.c:703: warning: implicit declaration of function 'GetWindowPort'
libvo/vo_quartz.c:705: warning: implicit declaration of function
'QDEndCGContext'
libvo/vo_quartz.c:709: warning: implicit declaration of function 'HideWindow'
libvo/vo_quartz.c:710: warning: implicit declaration of function
'ChangeWindowAttributes'
libvo/vo_quartz.c:749: warning: implicit declaration of function 'EnterMovies'
libvo/vo_quartz.c:762: warning: implicit declaration of function
'SetIdentityMatrix'
libvo/vo_quartz.c:766: warning: implicit declaration of function 'ScaleMatrix'
libvo/vo_quartz.c:769: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:769: error: 'ImageDescriptionHandle' undeclared
(first use in this function)
libvo/vo_quartz.c:769: error: (Each undeclared identifier is reported only once
libvo/vo_quartz.c:769: error: for each function it appears in.)
libvo/vo_quartz.c:769: error: syntax error before 'NewHandleClear'
libvo/vo_quartz.c:771: error: request for member 'extension_colr' in
something not a structure or union
libvo/vo_quartz.c:771: error: 'NCLCColorInfoImageDescriptionExtension'
undeclared (first use in this function)
libvo/vo_quartz.c:772: error: syntax error before ')' token
libvo/vo_quartz.c:772: error: request for member 'extension_colr' in
something not a structure or union
libvo/vo_quartz.c:772: error:
'kVideoColorInfoImageDescriptionExtensionType' undeclared (first use
in this function)
libvo/vo_quartz.c:773: error: syntax error before ')' token
libvo/vo_quartz.c:773: error: request for member 'extension_colr' in
something not a structure or union
libvo/vo_quartz.c:774: error: syntax error before ')' token
libvo/vo_quartz.c:774: error: request for member 'extension_colr' in
something not a structure or union
libvo/vo_quartz.c:775: error: syntax error before ')' token
libvo/vo_quartz.c:775: error: request for member 'extension_colr' in
something not a structure or union
libvo/vo_quartz.c:777: error: request for member 'extension_fiel' in
something not a structure or union
libvo/vo_quartz.c:777: error: 'FieldInfoImageDescriptionExtension'
undeclared (first use in this function)
libvo/vo_quartz.c:778: error: syntax error before ')' token
libvo/vo_quartz.c:778: error: request for member 'extension_fiel' in
something not a structure or union
libvo/vo_quartz.c:779: error: syntax error before ')' token
libvo/vo_quartz.c:779: error: request for member 'extension_fiel' in
something not a structure or union
libvo/vo_quartz.c:781: error: request for member 'extension_clap' in
something not a structure or union
libvo/vo_quartz.c:781: error: 'CleanApertureImageDescriptionExtension'
undeclared (first use in this function)
libvo/vo_quartz.c:782: error: syntax error before ')' token
libvo/vo_quartz.c:782: error: request for member 'extension_clap' in
something not a structure or union
libvo/vo_quartz.c:783: error: syntax error before ')' token
libvo/vo_quartz.c:783: error: request for member 'extension_clap' in
something not a structure or union
libvo/vo_quartz.c:784: error: syntax error before ')' token
libvo/vo_quartz.c:784: error: request for member 'extension_clap' in
something not a structure or union
libvo/vo_quartz.c:785: error: syntax error before ')' token
libvo/vo_quartz.c:785: error: request for member 'extension_clap' in
something not a structure or union
libvo/vo_quartz.c:786: error: syntax error before ')' token
libvo/vo_quartz.c:786: error: request for member 'extension_clap' in
something not a structure or union
libvo/vo_quartz.c:787: error: syntax error before ')' token
libvo/vo_quartz.c:787: error: request for member 'extension_clap' in
something not a structure or union
libvo/vo_quartz.c:788: error: syntax error before ')' token
libvo/vo_quartz.c:788: error: request for member 'extension_clap' in
something not a structure or union
libvo/vo_quartz.c:789: error: syntax error before ')' token
libvo/vo_quartz.c:789: error: request for member 'extension_clap' in
something not a structure or union
libvo/vo_quartz.c:791: error: request for member 'extension_pasp' in
something not a structure or union
libvo/vo_quartz.c:791: error:
'PixelAspectRatioImageDescriptionExtension' undeclared (first use in
this function)
libvo/vo_quartz.c:792: error: syntax error before ')' token
libvo/vo_quartz.c:792: error: request for member 'extension_pasp' in
something not a structure or union
libvo/vo_quartz.c:793: error: syntax error before ')' token
libvo/vo_quartz.c:793: error: request for member 'extension_pasp' in
something not a structure or union
libvo/vo_quartz.c:795: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:795: error: 'ImageDescription' undeclared (first use
in this function)
libvo/vo_quartz.c:796: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:797: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:798: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:799: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:800: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:801: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:802: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:803: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:804: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:805: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:805: error: 'codecLosslessQuality' undeclared (first
use in this function)
libvo/vo_quartz.c:806: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:807: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:808: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:809: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:811: warning: implicit declaration of function
'AddImageDescriptionExtension'
libvo/vo_quartz.c:811: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:811: error: request for member 'extension_colr' in
something not a structure or union
libvo/vo_quartz.c:811: error: 'kColorInfoImageDescriptionExtension'
undeclared (first use in this function)
libvo/vo_quartz.c:817: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:817: error: request for member 'extension_fiel' in
something not a structure or union
libvo/vo_quartz.c:817: error: 'kFieldInfoImageDescriptionExtension'
undeclared (first use in this function)
libvo/vo_quartz.c:823: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:823: error: request for member 'extension_clap' in
something not a structure or union
libvo/vo_quartz.c:823: error:
'kCleanApertureImageDescriptionExtension' undeclared (first use in
this function)
libvo/vo_quartz.c:829: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:829: error: request for member 'extension_pasp' in
something not a structure or union
libvo/vo_quartz.c:837: error: 'PlanarPixmapInfoYUV420' undeclared
(first use in this function)
libvo/vo_quartz.c:843: error: request for member 'componentInfoY' in
something not a structure or union
libvo/vo_quartz.c:844: error: request for member 'componentInfoCb' in
something not a structure or union
libvo/vo_quartz.c:844: error: request for member 'componentInfoY' in
something not a structure or union
libvo/vo_quartz.c:845: error: request for member 'componentInfoCr' in
something not a structure or union
libvo/vo_quartz.c:845: error: request for member 'componentInfoCb' in
something not a structure or union
libvo/vo_quartz.c:846: error: request for member 'componentInfoY' in
something not a structure or union
libvo/vo_quartz.c:847: error: request for member 'componentInfoCb' in
something not a structure or union
libvo/vo_quartz.c:848: error: request for member 'componentInfoCr' in
something not a structure or union
libvo/vo_quartz.c:857: warning: implicit declaration of function
'DecompressSequenceBeginS'
libvo/vo_quartz.c:858: error: request for member 'desc' in something
not a structure or union
libvo/vo_quartz.c:870: error: 'bestSpeedCodec' undeclared (first use
in this function)
libvo/vo_quartz.c:882: warning: implicit declaration of function
'RepositionWindow'
libvo/vo_quartz.c:883: warning: implicit declaration of function 'ShowWindow'
libvo/vo_quartz.c:895: warning: implicit declaration of function
'SetWindowGroupLevel'
libvo/vo_quartz.c: In function 'flip_page':
libvo/vo_quartz.c:951: error: 'CodecFlags' undeclared (first use in
this function)
libvo/vo_quartz.c:951: error: syntax error before 'flags'
libvo/vo_quartz.c:952: warning: implicit declaration of function
'DecompressSequenceFrameWhen'
libvo/vo_quartz.c:956: error: 'flags' undeclared (first use in this function)
libvo/vo_quartz.c:1020: warning: implicit declaration of function
'UpdateSystemActivity'
libvo/vo_quartz.c:1020: error: 'UsrActivity' undeclared (first use in
this function)
libvo/vo_quartz.c: In function 'draw_slice':
libvo/vo_quartz.c:1031: error: request for member 'componentInfoY' in
something not a structure or union
libvo/vo_quartz.c:1034: error: request for member 'componentInfoCb' in
something not a structure or union
libvo/vo_quartz.c:1035: error: request for member 'componentInfoCr' in
something not a structure or union
libvo/vo_quartz.c:1039: error: request for member 'componentInfoY' in
something not a structure or union
libvo/vo_quartz.c:1042: error: request for member 'componentInfoCr' in
something not a structure or union
libvo/vo_quartz.c:1043: error: request for member 'componentInfoCb' in
something not a structure or union
libvo/vo_quartz.c: In function 'query_format':
libvo/vo_quartz.c:1077: error: 'kMpegYUV420CodecType' undeclared
(first use in this function)
libvo/vo_quartz.c:1083: error: 'kComponentVideoUnsigned' undeclared
(first use in this function)
libvo/vo_quartz.c:1089: error: 'k422YpCbCr8CodecType' undeclared
(first use in this function)
libvo/vo_quartz.c: In function 'uninit':
libvo/vo_quartz.c:1110: warning: implicit declaration of function
'CDSequenceEnd'
libvo/vo_quartz.c:1122: warning: implicit declaration of function 'ShowMenuBar'
libvo/vo_quartz.c: In function 'get_yuv_image':
libvo/vo_quartz.c:1198: error: request for member 'componentInfoY' in
something not a structure or union
libvo/vo_quartz.c:1205: error: request for member 'componentInfoCb' in
something not a structure or union
libvo/vo_quartz.c:1206: error: request for member 'componentInfoCr' in
something not a structure or union
libvo/vo_quartz.c:1213: error: request for member 'componentInfoCr' in
something not a structure or union
libvo/vo_quartz.c:1214: error: request for member 'componentInfoCb' in
something not a structure or union
libvo/vo_quartz.c: In function 'window_resized':
libvo/vo_quartz.c:1347: warning: implicit declaration of function
'TranslateMatrix'
libvo/vo_quartz.c:1351: warning: implicit declaration of function
'SetDSequenceMatrix'
libvo/vo_quartz.c: In function 'window_fullscreen':
libvo/vo_quartz.c:1406: warning: cast from pointer to integer of different size
libvo/vo_quartz.c:1406: warning: cast from pointer to integer of different size
libvo/vo_quartz.c:1432: warning: implicit declaration of function 'MoveWindow'



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 tried to fix these by replacing them with quartz calls. as far as i can
> see, the modifications work, the compiler warnings are gone and there are no
> performance issues.
> please review the patch and provide feedback.

I can't really comment on the code as I have no previous knowledge of
MacOSX multimedia API, but Nicolas Plourde (in CC) should.


> i know there's also the cocoa based vo_macosx module, but since both are
> around, they should both be free from legacy code, shouldn't they? :)

Yep. But vo_macosx doesn't compile on 64 bits mode either!

gcc -arch x86_64 -Wdisabled-optimization -Wno-pointer-sign
-Wdeclaration-after-statement -std=gnu99 -Wall -Wno-switch
-Wpointer-arith -Wredundant-decls -O4   -pipe -ffast-math
-fomit-frame-pointer -mdynamic-no-pic -falign-loops=16 -shared-libgcc
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I.
-I/usr/local/include -I/usr/X11/include -c -o libvo/vo_macosx.o
libvo/vo_macosx.m
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


> i think i used one function marked as 10.1+, but the rest is marked to be
> available even in 10.0, if people still want to build against that.

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.

Guillaume
-- 
One should not give up hope on imbeciles. With a little training, you
can make them into soldiers.
 -- Pierre Desproges



More information about the MPlayer-dev-eng mailing list