Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QOpenGLWidget And EGL Shrare Contex
Qt 6.11 is out! See what's new in the release blog

QOpenGLWidget And EGL Shrare Contex

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 345 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    loser
    wrote on last edited by
    #1

    我想用零拷贝的方式绘制ffmpeg vaapi硬解出来的vasurface,目前使用
    I want to use zero copy to draw the ffmpeg VAAPI hard resolved VASurface, currently using

    m_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 article

    https://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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved