[vlc-devel] [PATCH] player: restart main vout on video splitter change

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Mon Dec 3 13:46:01 CET 2018


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

diff --git a/include/vlc_player.h b/include/vlc_player.h
index 78d78d29d3..38ce6bbb5b 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 the main vout
+ *
+ * @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..127bbf237f 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -3352,6 +3352,20 @@ vlc_player_vout_TriggerOption(vlc_player_t *player, const char *option)
     free(vouts);
 }
 
+void
+vlc_player_SetVideoSplitter(vlc_player_t *player, const char *splitter)
+{
+    struct vlc_player_input *input = vlc_player_get_input_locked(player);
+    if (!input)
+        return;
+    vout_thread_t *vout = vlc_player_vout_Hold(player);
+    var_SetString(vout, "video-splitter", splitter);
+    vlc_object_release(vout);
+    /* FIXME vout cannot handle live video splitter change, restart the main
+     * vout manually by restarting the first video es */
+    vlc_player_RestartTrack(player, input->video_track_vector.data[0]->es_id);
+}
+
 void
 vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled)
 {
@@ -3379,8 +3393,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.2



More information about the vlc-devel mailing list