如何在kCVPixelFormatType_420YpCbCr8Planar中使用CVOpenGLESTextureCacheCreateTextureFromImage

时间:2018-12-16 14:26:09

标签: ios objective-c opengl-es cvpixelbuffer

我有一个kCVPixelFormatType_420YpCbCr8Planar CVPixelBufferRef,但是当我尝试使用CVOpenGLESTextureCacheCreateTextureFromImage打开它时,会失败!

  CVOpenGLESTextureCacheCreateTextureFromImage(
    kCFAllocatorDefault, 
    fvideoTextureCacheRef, 
    aPixelBuffer,
    nil, 
    GL_TEXTURE_2D, 
    GL_RED_EXT,  
    aWidth, 
    aHeight, 
    GL_RED_EXT,  
    GL_UNSIGNED_BYTE, 
    0,  
    @aTextureRef);

这里GL_RED_EXT不好吗? kCVPixelFormatType_420YpCbCr8Planar是3个平面的yuv格式

0 个答案:

没有答案