[vlc-commits] qt: implement PIP for DComp

Pierre Lamot git at videolan.org
Mon Dec 7 12:31:48 UTC 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri Oct 16 10:05:57 2020 +0200| [048df9d205a258281fde81dc9d94cc54fc72ee63] | committer: Pierre Lamot

qt: implement PIP for DComp

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

 modules/gui/qt/maininterface/compositor_dcomp.cpp | 10 ++++++++++
 modules/gui/qt/maininterface/compositor_dcomp.hpp |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/modules/gui/qt/maininterface/compositor_dcomp.cpp b/modules/gui/qt/maininterface/compositor_dcomp.cpp
index ca4b45038a..30317adc70 100644
--- a/modules/gui/qt/maininterface/compositor_dcomp.cpp
+++ b/modules/gui/qt/maininterface/compositor_dcomp.cpp
@@ -232,9 +232,12 @@ MainInterface* CompositorDirectComposition::makeMainInterface()
 
         m_qmlVideoSurfaceProvider = std::make_unique<VideoSurfaceProvider>();
         m_rootWindow->setVideoSurfaceProvider(m_qmlVideoSurfaceProvider.get());
+        m_rootWindow->setCanShowVideoPIP(true);
 
         connect(m_qmlVideoSurfaceProvider.get(), &VideoSurfaceProvider::hasVideoEmbedChanged,
                 m_interfaceWindowHandler, &InterfaceWindowHandlerWin32::onVideoEmbedChanged);
+        connect(m_qmlVideoSurfaceProvider.get(), &VideoSurfaceProvider::surfacePositionChanged,
+                this, &CompositorDirectComposition::onSurfacePositionChanged);
 
         connect(m_rootWindow, &MainInterface::requestInterfaceMaximized,
                 m_rootWindow, &MainInterface::showMaximized);
@@ -261,6 +264,13 @@ MainInterface* CompositorDirectComposition::makeMainInterface()
     }
 }
 
+void CompositorDirectComposition::onSurfacePositionChanged(QPointF position)
+{
+    HR(m_videoVisual->SetOffsetX(position.x()));
+    HR(m_videoVisual->SetOffsetY(position.y()));
+    HR(m_dcompDevice->Commit(), "commit UI visual");
+}
+
 void CompositorDirectComposition::destroyMainInterface()
 {
     if (m_videoVisual)
diff --git a/modules/gui/qt/maininterface/compositor_dcomp.hpp b/modules/gui/qt/maininterface/compositor_dcomp.hpp
index 1c415daf2a..85f53d90e0 100644
--- a/modules/gui/qt/maininterface/compositor_dcomp.hpp
+++ b/modules/gui/qt/maininterface/compositor_dcomp.hpp
@@ -52,6 +52,9 @@ public:
 
     bool setupVoutWindow(vout_window_t *p_wnd) override;
 
+private slots:
+    void onSurfacePositionChanged(QPointF position);
+
 private:
     static int window_enable(struct vout_window_t *, const vout_window_cfg_t *);
     static void window_disable(struct vout_window_t *);



More information about the vlc-commits mailing list