Skip to content

360 viewpoint change broken in Qt

When playing an equilateral 360 video with Qt interface, changing the viewpoint does not work as expected: a small mouse move changes the viewpoint drastically.

Here is a sample: 360.mkv

Without Qt, it works as expected:

./vlc -Idummy --no-hw-dec 360.mkv

(move the viewpoint via a "drag & drop" in the video)

However, in Qt, the viewpoint "jumps":

./vlc --no-hw-dec 360.mkv
./vlc -Iqt --no-hw-dec 360.mkv   # explicit Qt interface

It worked before the commit add X11 video compositor (i.e. without Qt integration), bisect/bad (from !795 (merged)) is:

commit 96166bad04b04bc676aefb1a6909bc31558f93e8
Author: Pierre Lamot <pierre@videolabs.io>
Date:   Mon Nov 16 11:36:03 2020 +0100

    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 video window change. When we receive a damage event
      we ask the rendering part of the composition to refresh
    
    * The interface is rendered in the offscreen surface using a RenderControl, when
      the interface do render, the composition is asked 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.
    
    * The damage events are listened on a separate X11 connection and on a separate
      thread than Qt main thread (here the rendering thread). This allows to receive
      theses events independently from Qt (in case the Qt thread is stalled). Note
      that it is not possible to peek in qt X11 event queue from a non gui thread as
      the QX11Info::peekEventQueue is no longer thread safe since 5.12.
    
    fixes: #25627, #22155
Edited by Romain Vimont
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information