]> git.sesse.net Git - mlt/commitdiff
Report dropped frames.
authorDan Dennedy <dan@dennedy.org>
Sat, 28 May 2011 16:11:03 +0000 (09:11 -0700)
committerDan Dennedy <dan@dennedy.org>
Sat, 28 May 2011 16:11:03 +0000 (09:11 -0700)
src/modules/decklink/producer_decklink.cpp

index 6d327ab82dc8f23b62ef2db84cb5f18e7e2c8c6b..0645bee485a83dd66c73c06f2b716f4a2c3ac45e 100644 (file)
@@ -35,6 +35,7 @@ private:
        pthread_mutex_t  m_mutex;
        pthread_cond_t   m_condition;
        bool             m_started;
+       int              m_dropped;
 
        BMDDisplayMode getDisplayMode( mlt_profile profile )
        {
@@ -112,6 +113,7 @@ public:
                        pthread_cond_init( &m_condition, NULL );
                        m_queue = mlt_deque_init();
                        m_started = false;
+                       m_dropped = 0;
                }
                catch ( const char *error )
                {
@@ -151,6 +153,8 @@ public:
                                throw "Failed to enable audio capture.";
 
                        // Start capture
+                       m_dropped = 0;
+                       mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( getProducer() ), "dropped", m_dropped );
                        m_started = m_decklinkInput->StartStreams() == S_OK;
                        if ( !m_started )
                                throw "Failed to start capture.";
@@ -307,7 +311,11 @@ public:
                                pthread_cond_broadcast( &m_condition );
                        }
                        else
+                       {
                                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 );
+                       }
                        pthread_mutex_unlock( &m_mutex );
                }