[vlc-devel] [PATCH 05/11] qt: set video filters options directly in the vout

Thomas Guillem thomas at gllm.fr
Mon May 29 18:52:59 CEST 2017


---
 modules/gui/qt/components/extended_panels.cpp | 30 +++++++++++----------------
 1 file changed, 12 insertions(+), 18 deletions(-)

diff --git a/modules/gui/qt/components/extended_panels.cpp b/modules/gui/qt/components/extended_panels.cpp
index b66297ac30..5decd6f88e 100644
--- a/modules/gui/qt/components/extended_panels.cpp
+++ b/modules/gui/qt/components/extended_panels.cpp
@@ -506,23 +506,17 @@ void ExtVideo::setWidgetValue( QObject *widget )
 void ExtVideo::setFilterOption( struct intf_thread_t *p_intf, const char *psz_module, const char *psz_option,
         int i_int, double f_float, QString val )
 {
-    vlc_object_t *p_obj = ( vlc_object_t * )vlc_object_find_name( p_intf->obj.libvlc, psz_module );
-    int i_type;
-    bool b_is_command;
+    vout_thread_t *p_vout = THEMIM->getVout();
+    int i_type = 0;
+    bool b_is_command = false;
 
-    if( !p_obj )
-    {
-        msg_Warn( p_intf, "Module %s not found. You'll need to restart the filter to take the change into account.", psz_module );
-        i_type = config_GetType( p_intf, psz_option );
-        b_is_command = false;
-    }
-    else
+    if( p_vout )
     {
-        i_type = var_Type( p_obj, psz_option );
-        if( i_type == 0 )
-            i_type = config_GetType( p_intf, psz_option );
+        i_type = var_Type( p_vout, psz_option );
         b_is_command = ( i_type & VLC_VAR_ISCOMMAND );
     }
+    if( i_type == 0 )
+        i_type = config_GetType( p_intf, psz_option );
 
     i_type &= VLC_VAR_CLASS;
     if( i_type == VLC_VAR_INTEGER || i_type == VLC_VAR_BOOL )
@@ -533,9 +527,9 @@ void ExtVideo::setFilterOption( struct intf_thread_t *p_intf, const char *psz_mo
         if( b_is_command )
         {
             if( i_type == VLC_VAR_INTEGER )
-                var_SetInteger( p_obj, psz_option, i_int );
+                var_SetInteger( p_vout, psz_option, i_int );
             else
-                var_SetBool( p_obj, psz_option, i_int );
+                var_SetBool( p_vout, psz_option, i_int );
         }
     }
     else if( i_type == VLC_VAR_FLOAT )
@@ -544,7 +538,7 @@ void ExtVideo::setFilterOption( struct intf_thread_t *p_intf, const char *psz_mo
             msg_Warn( p_intf, "Could not find the correct Float widget" );
         config_PutFloat( p_intf, psz_option, f_float );
         if( b_is_command )
-            var_SetFloat( p_obj, psz_option, f_float );
+            var_SetFloat( p_vout, psz_option, f_float );
     }
     else if( i_type == VLC_VAR_STRING )
     {
@@ -552,7 +546,7 @@ void ExtVideo::setFilterOption( struct intf_thread_t *p_intf, const char *psz_mo
             msg_Warn( p_intf, "Could not find the correct String widget" );
         config_PutPsz( p_intf, psz_option, qtu( val ) );
         if( b_is_command )
-            var_SetString( p_obj, psz_option, qtu( val ) );
+            var_SetString( p_vout, psz_option, qtu( val ) );
     }
     else
         msg_Err( p_intf,
@@ -570,7 +564,7 @@ void ExtVideo::setFilterOption( struct intf_thread_t *p_intf, const char *psz_mo
         ChangeVFiltersString( p_intf, psz_module, true );
     }
 
-    if( p_obj ) vlc_object_release( p_obj );
+    if( p_vout ) vlc_object_release( p_vout );
 }
 
 void ExtVideo::updateFilterOptions()
-- 
2.11.0



More information about the vlc-devel mailing list