BMDTimeValue stream_time, frame_duration;
videoFrame->GetStreamTime( &stream_time, &frame_duration, CLOCK_FREQ );
p_video_frame->i_flags = BLOCK_FLAG_TYPE_I | p_sys->i_dominance_flags;
- if( p_sys->b_first_frame )
- {
- p_video_frame->i_flags |= BLOCK_FLAG_DISCONTINUITY;
- p_sys->b_first_frame = false;
- }
p_video_frame->i_pts = p_video_frame->i_dts = VLC_TS_0 + stream_time;
}
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
- int ret = VLC_SUCCESS;
+ int ret = VLC_EGENERIC;
char *psz_aspect;
char *psz_display_mode = NULL;
char *psz_video_connection = NULL;
if( !decklink_iterator )
{
msg_Err( p_demux, "DeckLink drivers not found." );
- ret = VLC_EGENERIC;
goto finish;
}
if( result != S_OK )
{
msg_Err( p_demux, "DeckLink PCI card %d not found", i_card_index );
- ret = VLC_EGENERIC;
goto finish;
}
if( result != S_OK )
{
msg_Err( p_demux, "Could not get model name" );
- ret = VLC_EGENERIC;
goto finish;
}
if( p_sys->p_card->QueryInterface( IID_IDeckLinkInput, (void**)&p_sys->p_input) != S_OK )
{
msg_Err( p_demux, "Card has no inputs" );
- ret = VLC_EGENERIC;
goto finish;
}
if( p_sys->p_card->QueryInterface( IID_IDeckLinkConfiguration, (void**)&p_config) != S_OK )
{
msg_Err( p_demux, "Failed to get configuration interface" );
- ret = VLC_EGENERIC;
goto finish;
}
{
msg_Err( p_demux, "Invalid --decklink-video-connection specified; choose one of " \
"sdi, hdmi, opticalsdi, component, composite, or svideo." );
- ret = VLC_EGENERIC;
goto finish;
}
if( result != S_OK )
{
msg_Err( p_demux, "Failed to set video input connection" );
- ret = VLC_EGENERIC;
goto finish;
}
}
{
msg_Err( p_demux, "Invalid --decklink-audio-connection specified; choose one of " \
"embedded, aesebu, or analog." );
- ret = VLC_EGENERIC;
goto finish;
}
if( result != S_OK )
{
msg_Err( p_demux, "Failed to set audio input connection" );
- ret = VLC_EGENERIC;
goto finish;
}
}
if( result != S_OK )
{
msg_Err( p_demux, "Failed to enumerate display modes" );
- ret = VLC_EGENERIC;
goto finish;
}
psz_display_mode = var_InheritString( p_demux, "decklink-mode" );
if( !psz_display_mode || strlen( psz_display_mode ) == 0 || strlen( psz_display_mode ) > 4 ) {
msg_Err( p_demux, "Missing or invalid --decklink-mode string" );
- ret = VLC_EGENERIC;
goto finish;
}
{
msg_Err( p_demux, "Failed to get display mode name" );
p_display_mode->Release();
- ret = VLC_EGENERIC;
goto finish;
}
{
msg_Err( p_demux, "Failed to get frame rate" );
p_display_mode->Release();
- ret = VLC_EGENERIC;
goto finish;
}
msg_Err( p_demux, "Unknown video mode specified. " \
"Run VLC with -v --verbose-objects=-all,+decklink " \
"to get a list of supported modes." );
- ret = VLC_EGENERIC;
goto finish;
}
if( result != S_OK )
{
msg_Err( p_demux, "Failed to enable video input" );
- ret = VLC_EGENERIC;
goto finish;
}
if( result != S_OK )
{
msg_Err( p_demux, "Failed to enable audio input" );
- ret = VLC_EGENERIC;
goto finish;
}
}
{
msg_Err( p_demux, "Could not start streaming from SDI card. This could be caused "
"by invalid video mode or flags, access denied, or card already in use." );
- ret = VLC_EGENERIC;
goto finish;
}
/* 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:
if( decklink_iterator )
decklink_iterator->Release();