开发者

How to identify & use OSType in Cocoa

开发者 https://www.devze.com 2022-12-09 03:48 出处:网络
In Cocoa/Mac OSX 10.6 OSType IOSurfaceGetPixelFormat(IOSurfaceRef buffer) returns a type OSType where can I find some documentation/reference on the supported OSType with regard to the context of

In Cocoa/Mac OSX 10.6

OSType IOSurfaceGetPixelFormat(IOSurfaceRef buffer)

returns a type OSType

where can I find some documentation/reference on the supported OSType with regard to the context of this function.

What sort OSType should 开发者_StackOverflowI expect with IOSurfaceGetPixelFormat? do you have any ideas on the various expected values from this function?


From MacTypes.h:

typedef FourCharCode     OSType;
typedef UInt32           FourCharCode;
typedef unsigned long    UInt32; //or unsigned int, depending on architecture


Try the pixel format type constants defined in CVPixelBuffer.h in the Core Video framework. That header conditionally includes IOSurface.h; to me, that implies that they're related.


Do keep in mind that IOSurface is little more than a friendly wrapper around shared memory. As such, IOSurfaceGetPixelFormat simply returns whatever was specified when the IOSurface was created, or 0 if no pixel format was specified.

0

精彩评论

暂无评论...
验证码 换一张
取 消