CVOpenGLESTextureCacheCreateTextureFromImage kCVReturnPixelBufferNotOpenGLCompatible error

时间:2017-08-31 15:01:02

标签: ios objective-c opengl-es opengl-es-2.0 core-video

我正在尝试从现有创建CVOpenGLESTextureRef对象 CVImageBufferRef,就像文档中显示的那样

//Mapping a BGRA buffer as a renderbuffer:
 CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, textureCache, pixelBuffer, NULL, GL_RENDERBUFFER, GL_RGBA8_OES, width, height, GL_RGBA, GL_UNSIGNED_BYTE, 0, &outTexture);

它返回kCVReturnPixelBufferNotOpenGLCompatible,而另一个例子对同一个像素缓冲区正常工作。

//Mapping a BGRA buffer as a source texture:
CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, textureCache, pixelBuffer, NULL, GL_TEXTURE_2D, GL_RGBA, width, height, GL_RGBA, GL_UNSIGNED_BYTE, 0, &outTexture);

0 个答案:

没有答案