[vlc-devel] [PATCH 3/3] qt: use the player window context getter/setter (will be fixup in qml branch)

Thomas Guillem thomas at gllm.fr
Mon Apr 1 13:21:44 CEST 2019


---
 modules/gui/qt/qt.cpp | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/modules/gui/qt/qt.cpp b/modules/gui/qt/qt.cpp
index 5a2e9f0e77..1c2ed1b62d 100644
--- a/modules/gui/qt/qt.cpp
+++ b/modules/gui/qt/qt.cpp
@@ -640,14 +640,10 @@ static void *Thread( void *obj )
             known_type = false;
         }
 
-        var_Create( THEPL, "qt4-iface", VLC_VAR_ADDRESS );
-        var_Create( THEPL, "window", VLC_VAR_STRING );
 
         if( known_type )
-        {
-            var_SetAddress( THEPL, "qt4-iface", p_intf );
-            var_SetString( THEPL, "window", "qt,any" );
-        }
+            vlc_player_SetWindowContext(p_sys->p_player,
+                                        VLC_PLAYER_WINDOW_CONTEXT_QT, p_intf);
     }
 
     /* Explain how to show a dialog :D */
@@ -685,9 +681,6 @@ static void *Thread( void *obj )
     msg_Dbg( p_intf, "QApp exec() finished" );
     if (p_mi != NULL)
     {
-        var_Destroy( THEPL, "window" );
-        var_Destroy( THEPL, "qt4-iface" );
-
         QMutexLocker locker (&lock);
         active = false;
 
@@ -747,8 +740,8 @@ static int WindowOpen( vout_window_t *p_wnd )
     if( !var_InheritBool( p_wnd, "embedded-video" ) )
         return VLC_EGENERIC;
 
-    intf_thread_t *p_intf =
-        (intf_thread_t *)var_InheritAddress( p_wnd, "qt4-iface" );
+    intf_thread_t *p_intf = (intf_thread_t *)
+        vlc_vout_window_GetPlayerContext(p_wnd, VLC_PLAYER_WINDOW_CONTEXT_QT);
     if( !p_intf )
     {   /* If another interface is used, this plugin cannot work */
         msg_Dbg( p_wnd, "Qt interface not found" );
-- 
2.20.1



More information about the vlc-devel mailing list