"Number of input audio channels for SDI captures. " \
"Must be 2, 8 or 16. 0 disables audio input." )
+#define ASPECT_RATIO_TEXT N_("Aspect ratio")
+#define ASPECT_RATIO_LONGTEXT N_( \
+ "Aspect ratio (4:3, 16:9). Default assumes square pixels." )
+
vlc_module_begin ()
set_shortname( N_("SDI") )
set_description( N_("BlackMagic SDI input") )
RATE_TEXT, RATE_LONGTEXT, true )
add_integer( "sdi-audio-channels", 2, NULL,
CHANNELS_TEXT, CHANNELS_LONGTEXT, true )
+ add_string( "sdi-aspect-ratio", NULL, NULL,
+ ASPECT_RATIO_TEXT, ASPECT_RATIO_LONGTEXT, true )
add_shortcut( "sdi" )
set_capability( "access_demux", 10 )
es_format_Init( &video_fmt, VIDEO_ES, VLC_CODEC_UYVY );
video_fmt.video.i_width = p_sys->i_width;
video_fmt.video.i_height = p_sys->i_height;
- video_fmt.video.i_sar_num = 16 * video_fmt.video.i_height;
- video_fmt.video.i_sar_den = 9 * video_fmt.video.i_width;
+ video_fmt.video.i_sar_num = 1;
+ video_fmt.video.i_sar_den = 1;
video_fmt.video.i_frame_rate = p_sys->i_fps_num;
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" );
+ if( psz_tmp )
+ {
+ char *psz_denominator = strchr( psz_tmp, ':' );
+ if( psz_denominator )
+ {
+ *psz_denominator++ = '\0';
+ video_fmt.video.i_sar_num = atoi( psz_tmp ) * video_fmt.video.i_height;
+ video_fmt.video.i_sar_den = atoi( psz_denominator ) * video_fmt.video.i_width;
+ }
+ free( psz_tmp );
+ }
msg_Dbg( p_demux, "added new video es %4.4s %dx%d",
(char*)&video_fmt.i_codec, video_fmt.video.i_width, video_fmt.video.i_height );