[vlc-commits] [Git][videolan/vlc][master] qt: handle scene graph error signal for graceful failure

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon May 6 07:33:57 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
43f8925a by Fatih Uzunoglu at 2024-05-06T06:58:26+00:00
qt: handle scene graph error signal for graceful failure

Scene graph initialization occurs asynchronously, while `makeMainInterface()`
expects an immediate return with an error code.

In other compositor integrations, it is trivial to return immediately. However,
in CompositorDirectComposition we have to wait for scene graph to initialize so
that we know what graphics API it is using because DComp composition can only work
with D3D11 and D3D12.

In order to satisfy that, an event loop is used here to wait until the scene
graph is initialized. This has worked fine, however there was no handling
in case an error occurs during scene graph initialization.

Now, we handle the error so that the interface is not stuck in waiting for
the event loop to quit. This will make the interface hence the Qt module
close gracefully.

- - - - -


1 changed file:

- modules/gui/qt/maininterface/compositor_dcomp.cpp


Changes:

=====================================
modules/gui/qt/maininterface/compositor_dcomp.cpp
=====================================
@@ -257,6 +257,14 @@ bool CompositorDirectComposition::makeMainInterface(MainCtx* mainCtx)
                 eventLoop.quit();
         }, Qt::SingleShotConnection);
 
+    connect(quickViewPtr,
+            &QQuickWindow::sceneGraphError,
+            &eventLoop,
+            [&eventLoop, &appropriateGraphicsApi](QQuickWindow::SceneGraphError error, const QString &message) {
+                qWarning() << "CompositorDComp: Scene Graph Error: " << error << ", Message: " << message;
+                appropriateGraphicsApi = false;
+                eventLoop.quit();
+        }, Qt::SingleShotConnection);
 
     CompositorVideo::Flags flags = CompositorVideo::CAN_SHOW_PIP;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/43f8925a604d7a90731f864cf52fc1a3d45dbdb2

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/43f8925a604d7a90731f864cf52fc1a3d45dbdb2
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list