Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Qt iOS:如何从QVideoFilterRunnable返回类型为GLTextureHandle的QVideoFrame_Ios_Qt_Opengl Es_Textures_Qtmultimedia - Fatal编程技术网

Qt iOS:如何从QVideoFilterRunnable返回类型为GLTextureHandle的QVideoFrame

Qt iOS:如何从QVideoFilterRunnable返回类型为GLTextureHandle的QVideoFrame,ios,qt,opengl-es,textures,qtmultimedia,Ios,Qt,Opengl Es,Textures,Qtmultimedia,我试图捕获相机输出帧,并在GPU管道中进一步处理它。因此,将帧作为GPU纹理重新渲染是最佳选择。从方法接收的类继承后,对象的类型不等于。它等于NoHandle,我需要通过glTexImage手动进行贴图/取消贴图和加载纹理,这对性能不好。是否有任何控制选项可用于返回纹理名称 一些注意事项: 在Android上看起来不错。返回的帧是纹理,因此这就像一个符咒: QVideoFrame* input = ...; GLuint texture = input->handle().toUInt(

我试图捕获相机输出帧,并在GPU管道中进一步处理它。因此,将帧作为GPU纹理重新渲染是最佳选择。从方法接收的类继承后,对象的类型不等于。它等于
NoHandle
,我需要通过
glTexImage
手动进行贴图/取消贴图和加载纹理,这对性能不好。是否有任何控制选项可用于返回纹理名称

一些注意事项:

  • 在Android上看起来不错。返回的帧是纹理,因此这就像一个符咒:

    QVideoFrame* input = ...;
    GLuint texture = input->handle().toUInt(); 
    f->glBindTexture(GL_TEXTURE_2D, texture);
    
  • 通常情况下,可能存在iOS纹理缓存功能:

    CVPixelBufferRef pixelBuffer = ...;
    CVOpenGLESTextureCacheCreateTextureFromImage(..., pixelBuffer, ..., &textureRef);
    texture = CVOpenGLESTextureGetName(textureRef);
    

CVPixelBufferRef
可以手动创建(我仍然需要使用
map
):

使用
CVPixelBufferRef
指针的值创建缓存纹理:

CVOpenGLESTextureRef texRef;
CVOpenGLESTextureCacheCreateTextureFromImage(
    kCFAllocatorDefault,
    textureCache,
    x,
    NULL, // texture attributes
    GL_TEXTURE_2D,
    GL_RGBA, // opengl format
    inputW,
    inputH,
    inputPixelFormat,
    GL_UNSIGNED_BYTE,
    0,
    &texRef
);
正在获取纹理名称:

inputTexId = CVOpenGLESTextureGetName(texRef);
inputTexId = CVOpenGLESTextureGetName(texRef);