[vlc-devel] [PATCHv2 09/18] qt: add MainInputManager::getVouts

Thomas Guillem thomas at gllm.fr
Tue May 30 18:40:59 CEST 2017


---
 modules/gui/qt/input_manager.cpp | 22 ++++++++++++++++++++++
 modules/gui/qt/input_manager.hpp |  1 +
 2 files changed, 23 insertions(+)

diff --git a/modules/gui/qt/input_manager.cpp b/modules/gui/qt/input_manager.cpp
index d5285cf6a0..cf9a0b2512 100644
--- a/modules/gui/qt/input_manager.cpp
+++ b/modules/gui/qt/input_manager.cpp
@@ -1034,6 +1034,28 @@ vout_thread_t* MainInputManager::getVout()
     return p_input ? input_GetVout( p_input ) : NULL;
 }
 
+QVector<vout_thread_t*> MainInputManager::getVouts() const
+{
+    vout_thread_t **pp_vout;
+    size_t i_vout;
+
+    if( p_input == NULL
+     || input_Control( p_input, INPUT_GET_VOUTS, &pp_vout, &i_vout ) != VLC_SUCCESS
+     || i_vout == 0 )
+        return QVector<vout_thread_t*>();
+
+    QVector<vout_thread_t*> vector = QVector<vout_thread_t*>();
+    vector.reserve( i_vout );
+    for( size_t i = 0; i < i_vout; i++ )
+    {
+        assert( pp_vout[i] );
+        vector.append( pp_vout[i] );
+    }
+    free( pp_vout );
+
+    return vector;
+}
+
 audio_output_t * MainInputManager::getAout()
 {
     return playlist_GetAout( THEPL );
diff --git a/modules/gui/qt/input_manager.hpp b/modules/gui/qt/input_manager.hpp
index 1c87f8b5d6..2e2116b82b 100644
--- a/modules/gui/qt/input_manager.hpp
+++ b/modules/gui/qt/input_manager.hpp
@@ -270,6 +270,7 @@ public:
     }
 
     vout_thread_t* getVout();
+    QVector<vout_thread_t*> getVouts() const;
     audio_output_t *getAout();
 
     bool getPlayExitState();
-- 
2.11.0



More information about the vlc-devel mailing list