QOpenGLWidget And EGL Shrare Contex
-
我想用零拷贝的方式绘制ffmpeg vaapi硬解出来的vasurface,目前使用
I want to use zero copy to draw the ffmpeg VAAPI hard resolved VASurface, currently usingm_eglSurface = eglCreateWindowSurface(m_eglDisplay, m_eglConfig, m_eglWindow, nullptr);
的方式可以绘制出来,但是目前是通过winid获取了一个本地窗口,我想不获取winid,使用QOpenGLWidget的方式绘制,通过看资料可以先绘制到pbuf中,所以我改成下面的方式:
The method can be used to draw, but currently a local window is obtained through Winid. I want to use QOpenGLWidget to draw without obtaining Winid. By looking at the information, I can first draw it to PBUF, so I have changed it to the following method:m_eglSurface = eglCreatePbufferSurface(m_eglDisplay, m_eglConfig, attribs);
通过
uint8_t* buf = (uint8_t*) malloc(iWidth * iHeight * 4); glReadPixels(0, 0, iWidth, iHeight, GL_RGBA, GL_UNSIGNED_BYTE, buf);
我可以看到绘制的图片,正确绘制了。
但是我想在QOpenGLWidget绘制这个纹理该怎么操作呢?I can see the drawn image, it was drawn correctly.
But how should I draw this texture on QOpenGLWidget?通过这篇文章
Through this articlehttps://www.cnblogs.com/xiaxveliang/p/17921279.html
可以知道先把GL_TEXTURE_EXTERNAL_OES纹理转化成GL_TEXTURE_2D纹理
然后绘制出来You can know to first convert the GL_TEXTURE_EXTERNAL_OES texture to the GL_TEXTURE_2D texture
Then draw it out目前遇到的问题是在QOpenGLWidget绘制不出来视频纹理
The current issue is that QOpenGLWidget cannot draw video textures有没有视频解码后零拷贝渲染的例子,或者解决方案,为什么Qt不封装一个零拷贝显示视频的控件呢
Do you have any examples or solutions of zero copy rendering after video decoding? Why doesn't Qt encapsulate a zero copy display control for videos