qt: add X11 video compositor
The composition works as follow: * Both the interface and the video are rendered in an offscreen window (using X11 composite extension) * We register to damage event (x11 damage extension) to get notified when the content of the offscreen window change. When we receive a damage event we ask the rendering part of the composition to refresh * A dedicated thread is spawned to do the rendering, upon a refresh event it will take the pictures from the offscreen surface and blend them into the actual window using X11 render extension. Using a separated thread from Qt ensure that the rendering of the video will not be stalled if Qt thread is busy. One trick is that the x11 events are received on Qt main thread, this means we can no longer get notified of damage events if Qt main loop is stuck, Fortunately Qt provides a way to peek inside its event queue from another thread. We periodically poll for damage events in this queue from the rendering thread in case Qt main loop is stuck. If an event has been both peeked then received in Qt thread, the rendering request is ignored the second time we handle the event. fixes: #25627, #22155
Showing
- configure.ac 9 additions, 1 deletionconfigure.ac
- modules/gui/qt/Makefile.am 37 additions, 1 deletionmodules/gui/qt/Makefile.am
- modules/gui/qt/maininterface/compositor.cpp 7 additions, 0 deletionsmodules/gui/qt/maininterface/compositor.cpp
- modules/gui/qt/maininterface/compositor.hpp 2 additions, 1 deletionmodules/gui/qt/maininterface/compositor.hpp
- modules/gui/qt/maininterface/compositor_x11.cpp 202 additions, 0 deletionsmodules/gui/qt/maininterface/compositor_x11.cpp
- modules/gui/qt/maininterface/compositor_x11.hpp 76 additions, 0 deletionsmodules/gui/qt/maininterface/compositor_x11.hpp
- modules/gui/qt/maininterface/compositor_x11_renderclient.cpp 124 additions, 0 deletionsmodules/gui/qt/maininterface/compositor_x11_renderclient.cpp
- modules/gui/qt/maininterface/compositor_x11_renderclient.hpp 74 additions, 0 deletionsmodules/gui/qt/maininterface/compositor_x11_renderclient.hpp
- modules/gui/qt/maininterface/compositor_x11_renderwindow.cpp 593 additions, 0 deletionsmodules/gui/qt/maininterface/compositor_x11_renderwindow.cpp
- modules/gui/qt/maininterface/compositor_x11_renderwindow.hpp 202 additions, 0 deletionsmodules/gui/qt/maininterface/compositor_x11_renderwindow.hpp
- modules/gui/qt/maininterface/compositor_x11_uisurface.cpp 306 additions, 0 deletionsmodules/gui/qt/maininterface/compositor_x11_uisurface.cpp
- modules/gui/qt/maininterface/compositor_x11_uisurface.hpp 95 additions, 0 deletionsmodules/gui/qt/maininterface/compositor_x11_uisurface.hpp
- modules/gui/qt/maininterface/compositor_x11_utils.cpp 109 additions, 0 deletionsmodules/gui/qt/maininterface/compositor_x11_utils.cpp
- modules/gui/qt/maininterface/compositor_x11_utils.hpp 114 additions, 0 deletionsmodules/gui/qt/maininterface/compositor_x11_utils.hpp
- modules/gui/qt/qt.cpp 6 additions, 0 deletionsmodules/gui/qt/qt.cpp
Loading
Please register or sign in to comment