Is there a way to list all CVPixelBuffer
formats for CVPixelBufferCreate()
that will not generate error -6683: kCVReturnPixelBufferNotOpenGLCompatible
when used with CVOpenGLESTextureCacheCreateTextureFromImage()
?
This lists all the supported CVPixelBuffer
formats for CVPixelBufferCreate()
, but does not guarantee that CVOpenGLESTextureCacheCreateTextureFromImage()
will not return the error above.
I guess my desired list should be a subset of this one.
Based on the answer from Adi Shavit above, here's a full code snippet (Objective-C) that you can use to print all the current OpenGL ES compatible pixel formats:
You can put this snippet anywhere in a Objective-C category or class to print which pixel format are compatible and which aren't. For completeness purposes, here are all the pixel formats currently compatible with OpenGL ES as of iOS 10.2.1:
L565
5551
L555
2vuy
yuvs
yuvf
L008
L016
2C08
2C16
BGRA
420v
420f
420e
411v
411f
422v
422f
444v
444f
L00h
L00f
2C0h
2C0f
RGhA
RGfA