Skip to content
Snippets Groups Projects
Commit 79ceaf54 authored by Pierre Lamot's avatar Pierre Lamot
Browse files

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
parent 5670dcbe
No related branches found
No related tags found
Loading
Showing
with 1871 additions and 3 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment