[vlc-commits] qt: adjust V4L2 controls

Rémi Denis-Courmont git at videolan.org
Mon Mar 4 16:53:50 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar  4 17:37:40 2019 +0200| [414ba71c46c8032e50ccee15cecc6327fb3b3f4c] | committer: Rémi Denis-Courmont

qt: adjust V4L2 controls

This corresponds to the previous changeset. In principles, this could
now also work for other inputs than V4L2.

This fixes two long standing deprecated warnings.

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

 modules/gui/qt/components/extended_panels.cpp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt/components/extended_panels.cpp b/modules/gui/qt/components/extended_panels.cpp
index 449e2d60c4..1a237cdeb5 100644
--- a/modules/gui/qt/components/extended_panels.cpp
+++ b/modules/gui/qt/components/extended_panels.cpp
@@ -639,7 +639,7 @@ void ExtV4l2::showEvent( QShowEvent *event )
 
 void ExtV4l2::Refresh( void )
 {
-    vlc_object_t *p_obj = (vlc_object_t*)vlc_object_find_name( THEPL, "v4l2" );
+    vlc_object_t *p_obj = (vlc_object_t *)THEMIM->getInput();
     help->hide();
     if( box )
     {
@@ -647,7 +647,8 @@ void ExtV4l2::Refresh( void )
         delete box;
         box = NULL;
     }
-    if( p_obj )
+
+    if( p_obj != NULL && var_Type(p_obj, "controls") )
     {
         vlc_value_t *val;
         char **text;
@@ -781,7 +782,6 @@ void ExtV4l2::Refresh( void )
         }
         free(text);
         free(val);
-        vlc_object_release( p_obj );
     }
     else
     {
@@ -800,7 +800,7 @@ void ExtV4l2::ValueChange( bool value )
 void ExtV4l2::ValueChange( int value )
 {
     QObject *s = sender();
-    vlc_object_t *p_obj = (vlc_object_t*)vlc_object_find_name( THEPL, "v4l2" );
+    vlc_object_t *p_obj = (vlc_object_t*)THEMIM->getInput();
     if( p_obj )
     {
         QString var = s->objectName();
@@ -822,7 +822,6 @@ void ExtV4l2::ValueChange( int value )
                 var_TriggerCallback( p_obj, qtu( var ) );
                 break;
         }
-        vlc_object_release( p_obj );
     }
     else
     {



More information about the vlc-commits mailing list