[vlc-commits] qt: use video window handler in DirectComposition compositor

Pierre Lamot git at videolan.org
Thu Aug 20 10:21:03 CEST 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Jul  1 11:35:43 2020 +0200| [12ddc7772452468510675bc9dd4c02ab3bc9ca18] | committer: Pierre Lamot

qt: use video window handler in DirectComposition compositor

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=12ddc7772452468510675bc9dd4c02ab3bc9ca18
---

 modules/gui/qt/maininterface/compositor_dcomp.cpp | 14 ++++++++------
 modules/gui/qt/maininterface/compositor_dcomp.hpp |  2 ++
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/maininterface/compositor_dcomp.cpp b/modules/gui/qt/maininterface/compositor_dcomp.cpp
index 23b0612a9e..3f1c1297df 100644
--- a/modules/gui/qt/maininterface/compositor_dcomp.cpp
+++ b/modules/gui/qt/maininterface/compositor_dcomp.cpp
@@ -75,8 +75,7 @@ void CompositorDirectComposition::window_disable(struct vout_window_t * p_wnd)
     try
     {
         that->m_qmlVideoSurfaceProvider->disable();
-        that->m_rootWindow->askVideoOnTop(false);
-        that->m_rootWindow->askVideoSetFullScreen(false);
+        that->m_videoWindowHandler->disable();
         msg_Dbg(that->m_intf, "window_disable");
         HR(that->m_rootVisual->RemoveVisual(that->m_videoVisual.Get()), "remove video visual from root");
         HR(that->m_dcompDevice->Commit(), "commit");
@@ -91,7 +90,7 @@ void CompositorDirectComposition::window_resize(struct vout_window_t * p_wnd, un
 {
     CompositorDirectComposition* that = static_cast<CompositorDirectComposition*>(p_wnd->sys);
     msg_Dbg(that->m_intf, "window_resize %ux%u", width, height);
-    that->m_rootWindow->requestResizeVideo(width, height);
+    that->m_videoWindowHandler->requestResizeVideo(width, height);
 }
 
 void CompositorDirectComposition::window_destroy(struct vout_window_t * p_wnd)
@@ -106,21 +105,21 @@ void CompositorDirectComposition::window_set_state(struct vout_window_t * p_wnd,
 {
     CompositorDirectComposition* that = static_cast<CompositorDirectComposition*>(p_wnd->sys);
     msg_Dbg(that->m_intf, "window_set_state");
-    that->m_rootWindow->requestVideoState(static_cast<vout_window_state>(state));
+    that->m_videoWindowHandler->requestVideoState(static_cast<vout_window_state>(state));
 }
 
 void CompositorDirectComposition::window_unset_fullscreen(struct vout_window_t * p_wnd)
 {
     CompositorDirectComposition* that = static_cast<CompositorDirectComposition*>(p_wnd->sys);
     msg_Dbg(that->m_intf, "window_unset_fullscreen");
-    that->m_rootWindow->requestVideoWindowed();
+    that->m_videoWindowHandler->requestVideoWindowed();
 }
 
 void CompositorDirectComposition::window_set_fullscreen(struct vout_window_t * p_wnd, const char *id)
 {
     CompositorDirectComposition* that = static_cast<CompositorDirectComposition*>(p_wnd->sys);
     msg_Dbg(that->m_intf, "window_set_fullscreen");
-    that->m_rootWindow->requestVideoFullScreen(id);
+    that->m_videoWindowHandler->requestVideoFullScreen(id);
 }
 
 CompositorDirectComposition::CompositorDirectComposition( intf_thread_t* p_intf,  QObject *parent)
@@ -202,6 +201,9 @@ MainInterface* CompositorDirectComposition::makeMainInterface()
         m_rootWindow->winId();
         m_rootWindow->show();
 
+        m_videoWindowHandler = std::make_unique<VideoWindowHandler>(m_intf, m_rootWindow);
+        m_videoWindowHandler->setWindow( m_rootWindow->windowHandle() );
+
         m_qmlVideoSurfaceProvider = std::make_unique<VideoSurfaceProvider>();
         m_rootWindow->setVideoSurfaceProvider(m_qmlVideoSurfaceProvider.get());
 
diff --git a/modules/gui/qt/maininterface/compositor_dcomp.hpp b/modules/gui/qt/maininterface/compositor_dcomp.hpp
index 7deaf92127..23b86ca708 100644
--- a/modules/gui/qt/maininterface/compositor_dcomp.hpp
+++ b/modules/gui/qt/maininterface/compositor_dcomp.hpp
@@ -29,6 +29,7 @@
 #include "maininterface/mainui.hpp"
 #include "compositor_dcomp_uisurface.hpp"
 #include "videosurface.hpp"
+#include "video_window_handler.hpp"
 
 #include <QOpenGLContext>
 
@@ -65,6 +66,7 @@ private:
     std::unique_ptr<CompositorDCompositionUISurface> m_uiSurface;
     vout_window_t *m_window = nullptr;
     std::unique_ptr<MainUI> m_ui;
+    std::unique_ptr<VideoWindowHandler> m_videoWindowHandler;
     std::unique_ptr<VideoSurfaceProvider> m_qmlVideoSurfaceProvider;
 
     //main window composition



More information about the vlc-commits mailing list