views:

256

answers:

3

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 I expect with IOSurfaceGetPixelFormat? do you have any ideas on the various expected values from this function?

+2  A: 

From MacTypes.h:

typedef FourCharCode     OSType;
typedef UInt32           FourCharCode;
typedef unsigned long    UInt32; //or unsigned int, depending on architecture
Dave DeLong
do you have any ideas on the various expected values from this function?
ReachConnection
Unfortunately not. The IOSurface framework seems like it was just made public with the release of 10.6. I've also been unable to find *any* documentation on the entire framework. My recommendation would be to ask on the cocoa-dev mailing list.
Dave DeLong
More info: http://cocoadhoc.blogspot.com/2009/09/hidden-gems-of-snow-leopard-iosurface.html and http://www.alexcurylo.com/blog/2009/10/08/iosurface/
Dave DeLong
+1  A: 

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.

Peter Hosey
You can create an IOSurface from CVPixelBuffers
ReachConnection
The IOSurface returned by CVPixelBufferGetIOSurface will have the same pixel format type as the CVPixelBuffer it backs.
vt
A: 

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.

vt