[vlc-devel] [PATCH] player: restart video_es tracks on video splitter

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Wed Nov 28 15:50:26 CET 2018


The vout can't handle live "video-splitter" change for now.
To work-around this issue, this function will set this variable and
restart all vouts.
---
 include/vlc_player.h | 10 +++++++++-
 src/input/player.c   | 11 +++++++++--
 src/libvlccore.sym   |  1 +
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/include/vlc_player.h b/include/vlc_player.h
index 78d78d29d3..4c0d1abe74 100644
--- a/include/vlc_player.h
+++ b/include/vlc_player.h
@@ -332,7 +332,6 @@ enum vlc_player_subtitle_sync
  */
 enum vlc_vout_filter_type
 {
-    VLC_VOUT_FILTER_VIDEO_SPLITTER,
     VLC_VOUT_FILTER_VIDEO_FILTER,
     VLC_VOUT_FILTER_SUB_SOURCE,
     VLC_VOUT_FILTER_SUB_FILTER,
@@ -2446,6 +2445,15 @@ vlc_player_GetStatistics(vlc_player_t *player);
 VLC_API void
 vlc_player_SetPauseOnCork(vlc_player_t *player, bool enabled);
 
+/**
+ * Set a video splitter to all vouts and all future vouts
+ *
+ * @param player locked instance
+ * @param splitter a video splitter name or NULL
+ */
+VLC_API void
+vlc_player_SetVideoSplitter(vlc_player_t *player, const char *splitter);
+
 /**
  * Get the audio output
  *
diff --git a/src/input/player.c b/src/input/player.c
index 59d2fdb774..3609c5962f 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -3352,6 +3352,15 @@ vlc_player_vout_TriggerOption(vlc_player_t *player, const char *option)
     free(vouts);
 }
 
+void
+vlc_player_SetVideoSplitter(vlc_player_t *player, const char *splitter)
+{
+    vlc_player_assert_locked(player);
+    vlc_player_vout_SetVar(player, "video-splitter", VLC_VAR_STRING,
+                           (vlc_value_t) { .psz_string = (char *) splitter });
+    vlc_player_RestartTrackCategory(player, VIDEO_ES);
+}
+
 void
 vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled)
 {
@@ -3379,8 +3388,6 @@ vlc_vout_filter_type_to_varname(enum vlc_vout_filter_type type)
 {
     switch (type)
     {
-        case VLC_VOUT_FILTER_VIDEO_SPLITTER:
-            return "video-splitter";
         case VLC_VOUT_FILTER_VIDEO_FILTER:
             return "video-filter";
         case VLC_VOUT_FILTER_SUB_SOURCE:
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 9423e2fc20..d4db4ccc51 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -883,6 +883,7 @@ vlc_player_SetSubtitleSync
 vlc_player_SetTeletextEnabled
 vlc_player_SetTeletextTransparency
 vlc_player_SetTrackCategoryEnabled
+vlc_player_SetVideoSplitter
 vlc_player_Start
 vlc_player_Stop
 vlc_player_title_list_GetAt
-- 
2.19.1



More information about the vlc-devel mailing list