[vlc-devel] commit: Qt: Create a getVout() in MIM to remove some vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE ); calls (Jean-Baptiste Kempf )

git version control git at videolan.org
Mon Jan 19 13:20:45 CET 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Jan 19 13:19:36 2009 +0100| [a7c94c6ad3cc4dc0f66563fd4153c202ec8d5cf1] | committer: Jean-Baptiste Kempf 

Qt: Create a getVout() in MIM to remove some vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE ); calls

Just used now for buttons.

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

 modules/gui/qt4/actions_manager.cpp |    6 ++----
 modules/gui/qt4/input_manager.hpp   |   13 +++++++++++++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/actions_manager.cpp b/modules/gui/qt4/actions_manager.cpp
index ca7b3c6..f434a2f 100644
--- a/modules/gui/qt4/actions_manager.cpp
+++ b/modules/gui/qt4/actions_manager.cpp
@@ -111,8 +111,7 @@ void ActionsManager::play()
  */
 void ActionsManager::fullscreen()
 {
-    vout_thread_t *p_vout =
-      (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
+    vout_thread_t *p_vout = THEMIM->getVout();
     if( p_vout)
     {
         var_SetBool( p_vout, "fullscreen", !var_GetBool( p_vout, "fullscreen" ) );
@@ -122,8 +121,7 @@ void ActionsManager::fullscreen()
 
 void ActionsManager::snapshot()
 {
-    vout_thread_t *p_vout =
-      (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
+    vout_thread_t *p_vout = THEMIM->getVout();
     if( p_vout )
     {
         vout_Control( p_vout, VOUT_SNAPSHOT );
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 777da8f..a55c3fd 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -30,6 +30,7 @@
 #endif
 
 #include <vlc_input.h>
+#include <vlc_vout.h>
 
 #include "qt4.hpp"
 
@@ -206,6 +207,18 @@ public:
 
     input_thread_t *getInput() { return p_input; };
     InputManager *getIM() { return im; };
+    vout_thread_t * getVout()
+    {
+        vout_thread_t **pp_vout; int i_vout;
+        if( !input_Control( p_input, INPUT_GET_VOUTS, &pp_vout, &i_vout ) )
+        {
+            for( int i = 1; i < i_vout; i++ ) vlc_object_release( pp_vout[i]);
+            vout_thread_t *p_tmp = pp_vout[0];
+            free( pp_vout );
+            return p_tmp;
+        }
+        return NULL;
+    }
 
 private:
     MainInputManager( intf_thread_t * );




More information about the vlc-devel mailing list