【发布时间】:2011-12-23 04:34:03
【问题描述】:
在尝试创建 32 位 RGBA CVPixelBuffer 时,我经常遇到错误。
最明显的错误 -6680 表示:“缓冲区不支持指定的像素格式。”
这是代码片段:(宽度和高度指定为256*256)
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
// [NSNumber numberWithBool:YES], kCVPixelBufferCGBitmapContextCompatibilityKey,
// [NSNumber numberWithBool:YES], kCVPixelBufferCGImageCompatibilityKey,
// [NSNumber numberWithBool:YES], kCVPixelBufferOpenGLCompatibilityKey,
nil];
CVPixelBufferRef pxbuffer = NULL;
CVReturn status = CVPixelBufferCreate(kCFAllocatorDefault, WIDTH,
HEIGHT, kCVPixelFormatType_32RGBA, (CFDictionaryRef) options,
&pxbuffer);
NSParameterAssert(status == kCVReturnSuccess && pxbuffer != NULL);
谁能提示我做错了什么?
【问题讨论】:
标签: iphone opengl-es rendering framebuffer