[vlc-commits] libvlc-module: add video-track selection params

Thomas Guillem git at videolan.org
Tue Aug 28 15:58:12 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Aug 27 17:57:38 2018 +0200| [cf8a8929f9a6c20144e6a499c00c8fb777f86b0c] | committer: Thomas Guillem

libvlc-module: add video-track selection params

Same than audio/spu equivalents.

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

 src/input/es_out.c  |  2 +-
 src/input/var.c     |  3 +++
 src/libvlc-module.c | 15 +++++++++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index a636c7fdbf..3a8134d6f5 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -314,7 +314,7 @@ es_out_t *input_EsOutNew( input_thread_t *p_input, int i_rate )
 
     /* */
     EsOutPropsInit( &p_sys->video, true, p_input, ES_OUT_ES_POLICY_SIMULTANEOUS,
-                    NULL, NULL, NULL, NULL );
+                    "video-track-id", "video-track", NULL, NULL );
     EsOutPropsInit( &p_sys->audio, true, p_input, ES_OUT_ES_POLICY_EXCLUSIVE,
                     "audio-track-id", "audio-track", "audio-language", "audio" );
     EsOutPropsInit( &p_sys->sub,  false, p_input, ES_OUT_ES_POLICY_EXCLUSIVE,
diff --git a/src/input/var.c b/src/input/var.c
index e463cac7de..ca0901b69c 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -717,6 +717,7 @@ void input_ConfigVarInit ( input_thread_t *p_input )
         var_Create( p_input, "audio", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
         var_Create( p_input, "spu", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
 
+        var_Create( p_input, "video-track", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
         var_Create( p_input, "audio-track", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
         var_Create( p_input, "sub-track", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
 
@@ -727,6 +728,8 @@ void input_ConfigVarInit ( input_thread_t *p_input )
         var_Create( p_input, "menu-language",
                     VLC_VAR_STRING|VLC_VAR_DOINHERIT );
 
+        var_Create( p_input, "video-track-id",
+                    VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
         var_Create( p_input, "audio-track-id",
                     VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
         var_Create( p_input, "sub-track-id",
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 8e5b471170..64e76dd684 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -577,6 +577,11 @@ static const char *const ppsz_clock_descriptions[] =
     "(like DVB streams for example)." )
 
 /// \todo Document how to find it
+#define INPUT_VIDEOTRACK_TEXT N_("Video track")
+#define INPUT_VIDEOTRACK_LONGTEXT N_( \
+    "Stream number of the video track to use " \
+    "(from 0 to n).")
+
 #define INPUT_AUDIOTRACK_TEXT N_("Audio track")
 #define INPUT_AUDIOTRACK_LONGTEXT N_( \
     "Stream number of the audio track to use " \
@@ -603,6 +608,10 @@ static const char *const ppsz_clock_descriptions[] =
     "(comma separated, two or three letters country code, you may use 'any' as a fallback).")
 
 /// \todo Document how to find it
+#define INPUT_VIDEOTRACK_ID_TEXT N_("Video track ID")
+#define INPUT_VIDEOTRACK_ID_LONGTEXT N_( \
+    "Stream ID of the video track to use.")
+
 #define INPUT_AUDIOTRACK_ID_TEXT N_("Audio track ID")
 #define INPUT_AUDIOTRACK_ID_LONGTEXT N_( \
     "Stream ID of the audio track to use.")
@@ -1728,6 +1737,9 @@ vlc_module_begin ()
     add_string( "programs", "",
                 INPUT_PROGRAMS_TEXT, INPUT_PROGRAMS_LONGTEXT, true )
         change_safe ()
+    add_integer( "video-track", -1,
+                 INPUT_VIDEOTRACK_TEXT, INPUT_VIDEOTRACK_LONGTEXT, true )
+        change_safe ()
     add_integer( "audio-track", -1,
                  INPUT_AUDIOTRACK_TEXT, INPUT_AUDIOTRACK_LONGTEXT, true )
         change_safe ()
@@ -1746,6 +1758,9 @@ vlc_module_begin ()
                  INPUT_MENUTRACK_LANG_TEXT, INPUT_MENUTRACK_LANG_LONGTEXT,
                   false )
         change_safe ()
+    add_integer( "video-track-id", -1, INPUT_VIDEOTRACK_ID_TEXT,
+                 INPUT_VIDEOTRACK_ID_LONGTEXT, true )
+        change_safe ()
     add_integer( "audio-track-id", -1, INPUT_AUDIOTRACK_ID_TEXT,
                  INPUT_AUDIOTRACK_ID_LONGTEXT, true )
         change_safe ()



More information about the vlc-commits mailing list