When I try to create a 32-bit RGBA CVPixelBuffer, I constantly get errors.
The first error is -6680, which means: "The buffer does not support the specified pixel format."
This is a piece of code: (Width and height are specified as 256 * 256)
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
nil];
CVPixelBufferRef pxbuffer = NULL;
CVReturn status = CVPixelBufferCreate(kCFAllocatorDefault, WIDTH,
HEIGHT, kCVPixelFormatType_32RGBA, (CFDictionaryRef) options,
&pxbuffer);
NSParameterAssert(status == kCVReturnSuccess && pxbuffer != NULL);
Can someone tell me what I'm doing wrong?
source
share