Nominate our 2022 Qt Champions!

Strong Flickering in QGLWidget as viewport

  • I use Qt Gstreamer to push video streams into Qt.
    I build program that used 2 'videotestsrc' gstreamer elements and render it into QDeclarativeView. I used for it 2 QGst::Ui::GraphicsVideoSurface's, each surface for each stream. I bind these surfaces with created QDeclarativeView. In qml file I create 2 VideoItem's to render 2 streams.
    The program works perfectly. But if I use QGLWidget as viewport of QDeclarativeView, there is very strong flickering. With QWidget as viewport there is no such effect.
    What I remarked, the problem is that QGLWidget rerender background every time before VideoItem will be rerendered. If place Rectangle beside with VideoItem, it won't be visible.
    I have tried change various properties, but this is not solve my problem.
    I have tried change view attributes as below:
    view.setAttribute(Qt::WA_NoSystemBackground, true);
    view.setAttribute(Qt::WA_OpaquePaintEvent, true);

    I have tried change view.viewport() attributes as below:
    view.viewport()->setAttribute(Qt::WA_NoSystemBackground, true);
    view.viewport()->setAttribute(Qt::WA_OpaquePaintEvent, true);

    I have tried to change every Qml Rectangle Element to Qml Item Element. Now in .qml file there are only Items and VideoItems. It just little weaken flickering, but flickering is still strong.

    So stupid situation. The problem has solved by set

Log in to reply