Skip to content

qt: add X11 video compositor

Pierre Lamot requested to merge x11-mt-ci into master

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

Merge request reports