]> git.sesse.net Git - vlc/blobdiff - modules/access/decklink.cpp
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / access / decklink.cpp
index 3f837f22f09ca9197cdba7827a4d0606e696d509..a8f3a71dc12b3bb6627135c629385e5fa10af9bf 100644 (file)
@@ -79,6 +79,13 @@ static void Close( vlc_object_t * );
     "composite, svideo. " \
     "Leave blank for card default." )
 
+static const char *const ppsz_videoconns[] = {
+    "sdi", "hdmi", "opticalsdi", "component", "composite", "svideo"
+};
+static const char *const ppsz_videoconns_text[] = {
+    N_("SDI"), N_("HDMI"), N_("Optical SDI"), N_("Component"), N_("Composite"), N_("S-video")
+};
+        
 #define ASPECT_RATIO_TEXT N_("Aspect ratio")
 #define ASPECT_RATIO_LONGTEXT N_( \
     "Aspect ratio (4:3, 16:9). Default assumes square pixels." )
@@ -103,6 +110,7 @@ vlc_module_begin ()
                  CHANNELS_TEXT, CHANNELS_LONGTEXT, true )
     add_string( "decklink-video-connection", 0, NULL,
                  VIDEO_CONNECTION_TEXT, VIDEO_CONNECTION_LONGTEXT, true )
+        change_string_list( ppsz_videoconns, ppsz_videoconns_text, 0 )
     add_string( "decklink-aspect-ratio", NULL, NULL,
                 ASPECT_RATIO_TEXT, ASPECT_RATIO_LONGTEXT, true )
 
@@ -346,7 +354,7 @@ static int Open( vlc_object_t *p_this )
         goto finish;
     }
 
-    psz_video_connection = var_CreateGetNonEmptyString( p_demux, "decklink-video-connection" );
+    psz_video_connection = var_InheritString( p_demux, "decklink-video-connection" );
     if( psz_video_connection )
     {
         BMDVideoConnection conn;
@@ -576,9 +584,6 @@ static int Open( vlc_object_t *p_this )
              (char*)&audio_fmt.i_codec, audio_fmt.audio.i_rate, audio_fmt.audio.i_bitspersample, audio_fmt.audio.i_channels);
     p_sys->p_audio_es = es_out_Add( p_demux->out, &audio_fmt );
 
-    /* Update default_pts to a suitable value for access */
-    var_Create( p_demux, "decklink-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
-
     ret = VLC_SUCCESS;
 
 finish:
@@ -645,7 +650,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
         case DEMUX_GET_PTS_DELAY:
             pi64 = (int64_t*)va_arg( args, int64_t * );
-            *pi64 = var_GetInteger( p_demux, "decklink-caching" ) * 1000;
+            *pi64 = var_InheritInteger( p_demux, "decklink-caching" ) * 1000;
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME: