[vlc-devel] [PATCH 02/23] macosx: helpers: add getVouts

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Thu Jun 29 14:37:47 CEST 2017


---
 modules/gui/macosx/helpers.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/modules/gui/macosx/helpers.h b/modules/gui/macosx/helpers.h
index fefd0e6c19..71b92058ad 100644
--- a/modules/gui/macosx/helpers.h
+++ b/modules/gui/macosx/helpers.h
@@ -44,6 +44,31 @@ static inline vout_thread_t *getVout(void)
     return p_vout;
 }
 
+static inline NSArray<NSValue *> *getVouts(void)
+{
+    input_thread_t *p_input = getInput();
+    vout_thread_t **pp_vouts;
+    size_t i_num_vouts;
+
+    if (!p_input
+        || input_Control(p_input, INPUT_GET_VOUTS, &pp_vouts, &i_num_vouts)
+        || !i_num_vouts)
+        return [NSArray array];
+
+    NSMutableArray<NSValue *> *vouts =
+        [NSMutableArray arrayWithCapacity : i_num_vouts];
+
+    for (size_t i = 0; i < i_num_vouts; ++i)
+    {
+        assert(pp_vouts[i]);
+        [vouts insertObject : [NSValue valueWithPointer : pp_vouts[i]]
+                    atIndex : i];
+    }
+
+    free(pp_vouts);
+    return vouts;
+}
+
 static inline vout_thread_t *getVoutForActiveWindow(void)
 {
     vout_thread_t *p_vout = nil;
-- 
2.13.1



More information about the vlc-devel mailing list