Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 24 additions and 7 deletions.
  1. +24 −7 src/modules/decklink/producer_decklink.cpp
View
31 src/modules/decklink/producer_decklink.cpp
@@ -358,6 +358,8 @@ class DeckLinkProducer
IDeckLinkVideoInputFrame* video,
IDeckLinkAudioInputPacket* audio )
{
+ mlt_frame frame = NULL;
+
if( !m_reprio )
{
mlt_properties properties = MLT_PRODUCER_PROPERTIES( getProducer() );
@@ -402,14 +404,33 @@ class DeckLinkProducer
return S_OK;
}
- // Create mlt_frame
- mlt_frame frame = mlt_frame_init( MLT_PRODUCER_SERVICE( getProducer() ) );
// Copy video
if ( video )
{
+ IDeckLinkTimecode* timecode = 0;
+
if ( !( video->GetFlags() & bmdFrameHasNoInputSource ) )
{
+ int vitc_in = mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( getProducer() ), "vitc_in" );
+ if ( vitc_in && ( S_OK == video->GetTimecode( bmdTimecodeRP188, &timecode ) ||
+ S_OK == video->GetTimecode( bmdTimecodeVITC, &timecode )) && timecode )
+ {
+ int vitc = timecode->GetBCD();
+ SAFE_RELEASE( timecode );
+
+ mlt_log_verbose( getProducer(),
+ "VideoInputFrameArrived: vitc=%.8X vitc_in=%.8X\n", vitc, vitc_in);
+
+ if ( vitc < vitc_in )
+ {
+ pthread_cond_broadcast( &m_condition );
+ return S_OK;
+ }
+
+ mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( getProducer() ), "vitc_in", 0 );
+ }
+
int size = video->GetRowBytes() * ( video->GetHeight() + m_vancLines );
void* image = mlt_pool_alloc( size );
void* buffer = 0;
@@ -446,6 +467,7 @@ class DeckLinkProducer
{
size = video->GetRowBytes() * video->GetHeight();
swab2( (char*) buffer, (char*) image + m_vancLines * video->GetRowBytes(), size );
+ frame = mlt_frame_init( MLT_PRODUCER_SERVICE( getProducer() ) );
mlt_frame_set_image( frame, (uint8_t*) image, size, mlt_pool_release );
}
else if ( image )
@@ -457,12 +479,9 @@ class DeckLinkProducer
else
{
mlt_log_verbose( getProducer(), "no signal\n" );
- mlt_frame_close( frame );
- frame = 0;
}
// Get timecode
- IDeckLinkTimecode* timecode = 0;
if ( video->GetTimecode( bmdTimecodeVITC, &timecode ) == S_OK && timecode )
{
DLString timecodeString = 0;
@@ -481,8 +500,6 @@ class DeckLinkProducer
else
{
mlt_log_verbose( getProducer(), "no video\n" );
- mlt_frame_close( frame );
- frame = 0;
}
// Copy audio

No commit comments for this range

Something went wrong with that request. Please try again.