int m_colorspace;
int m_vancLines;
mlt_cache m_cache;
+ bool m_reprio;
BMDDisplayMode getDisplayMode( mlt_profile profile, int vancLines )
{
if ( width == profile->width && p == profile->progressive
&& ( height + vancLines == profile->height || ( height == 486 && profile->height == 480 + vancLines ) )
- && fps == mlt_profile_fps( profile ) )
+ && (int) fps == (int) mlt_profile_fps( profile ) )
result = mode->GetDisplayMode();
SAFE_RELEASE( mode );
}
m_decklinkInput = NULL;
}
- ~DeckLinkProducer()
+ virtual ~DeckLinkProducer()
{
if ( m_queue )
{
IDeckLinkVideoInputFrame* video,
IDeckLinkAudioInputPacket* audio )
{
+ if( !m_reprio )
+ {
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( getProducer() );
+
+ if ( mlt_properties_get( properties, "priority" ) )
+ {
+ int r;
+ pthread_t thread;
+ pthread_attr_t tattr;
+ struct sched_param param;
+
+ pthread_attr_init(&tattr);
+ pthread_attr_setschedpolicy(&tattr, SCHED_FIFO);
+
+ if ( !strcmp( "max", mlt_properties_get( properties, "priority" ) ) )
+ param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1;
+ else if ( !strcmp( "min", mlt_properties_get( properties, "priority" ) ) )
+ param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 1;
+ else
+ param.sched_priority = mlt_properties_get_int( properties, "priority" );
+
+ pthread_attr_setschedparam(&tattr, ¶m);
+
+ thread = pthread_self();
+
+ r = pthread_setschedparam(thread, SCHED_FIFO, ¶m);
+ if( r )
+ mlt_log_verbose( getProducer(),
+ "VideoInputFrameArrived: pthread_setschedparam returned %d\n", r);
+ else
+ mlt_log_verbose( getProducer(),
+ "VideoInputFrameArrived: param.sched_priority=%d\n", param.sched_priority);
+ };
+
+ m_reprio = true;
+ };
+
if ( mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( getProducer() ), "preview" ) &&
mlt_producer_get_speed( getProducer() ) == 0.0 && !mlt_deque_count( m_queue ))
{
for ( int i = 1; i < m_vancLines + 1; i++ )
{
if ( vanc->GetBufferForVerticalBlankingLine( i, &buffer ) == S_OK )
- swab( (char*) buffer, (char*) image + ( i - 1 ) * video->GetRowBytes(), video->GetRowBytes() );
+ swab2( (char*) buffer, (char*) image + ( i - 1 ) * video->GetRowBytes(), video->GetRowBytes() );
else
mlt_log_debug( getProducer(), "failed capture vanc line %d\n", i );
}
if ( image && buffer )
{
size = video->GetRowBytes() * video->GetHeight();
- swab( (char*) buffer, (char*) image + m_vancLines * video->GetRowBytes(), size );
+ swab2( (char*) buffer, (char*) image + m_vancLines * video->GetRowBytes(), size );
mlt_frame_set_image( frame, (uint8_t*) image, size, mlt_pool_release );
}
else if ( image )
{
mlt_frame_close( frame );
mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( getProducer() ), "dropped", ++m_dropped );
- mlt_log_warning( getProducer(), "frame dropped %d\n", m_dropped );
+ mlt_log_warning( getProducer(), "buffer overrun, frame dropped %d\n", m_dropped );
}
pthread_mutex_unlock( &m_mutex );
}