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

Victorien Le Couviour--Tuffet git at videolan.org
Mon Mar 11 10:19:21 CET 2019


vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Wed Nov 21 11:49:14 2018 +0100| [f8361390286829efd8e848cc974f724ef4aafc6d] | committer: Thomas Guillem

player: restart main vout on video splitter change

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.

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

 include/vlc_player.h | 10 +++++++++-
 src/input/player.c   | 26 ++++++++++++++++++++++++--
 src/libvlccore.sym   |  1 +
 3 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/include/vlc_player.h b/include/vlc_player.h
index 07d1680e37..ddd52f4609 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,
@@ -2447,6 +2446,15 @@ 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
  *
  * @warning The returned pointer must be released with aout_Release().
diff --git a/src/input/player.c b/src/input/player.c
index 34a39eec9a..310156d254 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -3353,6 +3353,30 @@ vlc_player_vout_TriggerOption(vlc_player_t *player, const char *option)
 }
 
 void
+vlc_player_SetVideoSplitter(vlc_player_t *player, const char *splitter)
+{
+    if (config_GetType("video-splitter") == 0)
+        return;
+    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);
+    vout_Release(vout);
+
+    /* FIXME vout cannot handle live video splitter change, restart the main
+     * vout manually by restarting the first video es */
+    struct vlc_player_track *track;
+    vlc_vector_foreach(track, &input->video_track_vector)
+        if (track->selected)
+        {
+            vlc_player_RestartTrack(player, track->es_id);
+            break;
+        }
+}
+
+void
 vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled)
 {
     vlc_player_vout_SetVar(player, "fullscreen", VLC_VAR_BOOL,
@@ -3379,8 +3403,6 @@ vlc_vout_filter_type_to_varname(enum vlc_vout_filter_type type)
 {
     switch (type)
     {
-        case VLC_VOUT_FILTER_VIDEO_SPLITTER:
-            return config_GetType("video-splitter") ? "video-splitter" : NULL;
         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 18b67c4c41..f88e9c102b 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -904,6 +904,7 @@ vlc_player_SetSubtitleTextScale
 vlc_player_SetTeletextEnabled
 vlc_player_SetTeletextTransparency
 vlc_player_SetTrackCategoryEnabled
+vlc_player_SetVideoSplitter
 vlc_player_Start
 vlc_player_Stop
 vlc_player_title_list_GetAt



More information about the vlc-commits mailing list