{
demux_sys_t *p_sys = p_demux_->p_sys;
- if (videoFrame) {
- if (videoFrame->GetFlags() & bmdFrameHasNoInputSource) {
+ if(videoFrame)
+ {
+ if(videoFrame->GetFlags() & bmdFrameHasNoInputSource)
+ {
msg_Warn( p_demux_, "No input signal detected" );
return S_OK;
}
msg_Dbg( p_demux_, "Received a frame" );
block_t *p_frame;
- p_frame = block_New( p_demux_, 720 * 576 * 3 );
- if ( !p_frame ) {
+ p_frame = block_New( p_demux_, 720 * 576 * 3 );
+ if( !p_frame )
+ {
msg_Err( p_demux_, "Could not allocate memory for frame" );
return S_OK;
- }
+ }
void *frame_bytes;
videoFrame->GetBytes( &frame_bytes );
p_frame->i_pts = stream_time;
vlc_mutex_lock( &p_sys->lock );
- p_sys->p_frame = p_frame; // FIXME: leak
+ p_sys->p_frame = p_frame; // FIXME: leak
vlc_mutex_unlock( &p_sys->lock );
}
p_sys->p_frame = NULL;
IDeckLinkIterator *decklink_iterator = CreateDeckLinkIteratorInstance();
- if ( !decklink_iterator ) {
+ if( !decklink_iterator )
+ {
msg_Err( p_demux, "DeckLink drivers not found." );
// FIXME: Leak here and several other error paths.
return VLC_EGENERIC;
HRESULT result;
result = decklink_iterator->Next( &p_sys->p_card );
- if ( result != S_OK ) {
+ if( result != S_OK )
+ {
msg_Err( p_demux, "No DeckLink PCI cards found" );
return VLC_EGENERIC;
}
- if ( p_sys->p_card->QueryInterface(IID_IDeckLinkInput, (void**)&p_sys->p_input) != S_OK ) {
+ if( p_sys->p_card->QueryInterface(IID_IDeckLinkInput, (void**)&p_sys->p_input) != S_OK )
+ {
msg_Err( p_demux, "Card has no inputs" );
return VLC_EGENERIC;
}
p_sys->p_input->SetCallback( p_sys->p_delegate );
result = p_sys->p_input->EnableVideoInput(bmdModePAL, bmdFormat8BitYUV, 0);
- if ( result != S_OK ) {
+ if( result != S_OK )
+ {
msg_Err( p_demux, "Failed to enable video input" );
return VLC_EGENERIC;
}
// FIXME: add audio
result = p_sys->p_input->StartStreams();
- if ( result != S_OK ) {
+ if( result != S_OK )
+ {
msg_Err( p_demux, "Failed to start streams" );
return VLC_EGENERIC;
}
p_sys->p_frame = NULL;
vlc_mutex_unlock( &p_sys->lock );
- if ( p_block ) {
+ if( p_block )
+ {
msg_Dbg( p_demux, "Sending frame" );
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block->i_pts );
- es_out_Send( p_demux->out, p_sys->p_es, p_block );
- } else {
+ es_out_Send( p_demux->out, p_sys->p_es, p_block );
+ }
+ else
+ {
usleep(50000); // FIXME
}