"Caching value for SDI captures. This " \
"value should be set in milliseconds." )
+#define AUDIO_CONNECTION_TEXT N_("Audio connection")
+#define AUDIO_CONNECTION_LONGTEXT N_( \
+ "Audio connection to use for SDI captures. " \
+ "Valid choices: embedded, aesebu, analog. " \
+ "Leave blank for card default." )
+
#define RATE_TEXT N_("Audio sampling rate in Hz")
#define RATE_LONGTEXT N_( \
"Audio sampling rate (in hertz) for SDI captures. " \
MODE_TEXT, MODE_LONGTEXT, true )
add_integer( "sdi-caching", DEFAULT_PTS_DELAY / 1000, NULL,
CACHING_TEXT, CACHING_LONGTEXT, true )
+ add_string( "sdi-audio-connection", 0, NULL,
+ AUDIO_CONNECTION_TEXT, AUDIO_CONNECTION_LONGTEXT, true )
add_integer( "sdi-audio-rate", 48000, NULL,
RATE_TEXT, RATE_LONGTEXT, true )
add_integer( "sdi-audio-channels", 2, NULL,
msg_Err( p_demux, "Card has no inputs" );
return VLC_EGENERIC;
}
+
+ // Set up the video and audio sources.
+ IDeckLinkConfiguration *p_config;
+ if( p_sys->p_card->QueryInterface( IID_IDeckLinkConfiguration, (void**)&p_config) != S_OK )
+ {
+ msg_Err( p_demux, "Failed to get configuration interface" );
+ return VLC_EGENERIC;
+ }
+
+ char *psz_tmp = var_CreateGetNonEmptyString( p_demux, "sdi-audio-connection" );
+ if( psz_tmp )
+ {
+ BMDAudioConnection conn;
+ if ( !strcmp( psz_tmp, "embedded" ) )
+ conn = bmdAudioConnectionEmbedded;
+ else if ( !strcmp( psz_tmp, "aesebu" ) )
+ conn = bmdAudioConnectionAESEBU;
+ else if ( !strcmp( psz_tmp, "analog" ) )
+ conn = bmdAudioConnectionAnalog;
+ else
+ {
+ msg_Err( p_demux, "Invalid --sdi-audio-connection specified; choose one of " \
+ "embedded, aesebu, or analog." );
+ return VLC_EGENERIC;
+ }
+ free( psz_tmp );
+ msg_Dbg( p_demux, "Setting audio input format to 0x%x", conn);
+ result = p_config->SetAudioInputFormat( conn );
+ if( result != S_OK )
+ {
+ msg_Err( p_demux, "Failed to set audio input connection" );
+ return VLC_EGENERIC;
+ }
+ }
+
+ // Get the list of display modes.
IDeckLinkDisplayModeIterator *p_display_iterator;
result = p_sys->p_input->GetDisplayModeIterator( &p_display_iterator );
if( result != S_OK )
msg_Err( p_demux, "Failed to enable video input" );
return VLC_EGENERIC;
}
-
+
+ // Set up audio.
p_sys->i_rate = var_CreateGetInteger( p_demux, "sdi-audio-rate" );
p_sys->i_channels = var_CreateGetInteger( p_demux, "sdi-audio-channels" );
if( p_sys->i_rate > 0 && p_sys->i_channels > 0 )
video_fmt.video.i_frame_rate_base = p_sys->i_fps_den;
video_fmt.i_bitrate = video_fmt.video.i_width * video_fmt.video.i_height * video_fmt.video.i_frame_rate * 2;
- char *psz_tmp = var_CreateGetNonEmptyString( p_demux, "sdi-aspect-ratio" );
+ psz_tmp = var_CreateGetNonEmptyString( p_demux, "sdi-aspect-ratio" );
if( psz_tmp )
{
char *psz_denominator = strchr( psz_tmp, ':' );