Commit 63effb07 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MainWorkflow: Reworking blackoutput.

parent c900bc8d
......@@ -37,8 +37,6 @@
#include <QDomElement>
#include <QMutex>
Workflow::Frame *MainWorkflow::blackOutput = NULL;
MainWorkflow::MainWorkflow( int trackCount ) :
m_lengthFrame( 0 ),
m_renderStarted( false ),
......@@ -69,7 +67,7 @@ MainWorkflow::~MainWorkflow()
for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i )
delete m_tracks[i];
delete[] m_tracks;
delete MainWorkflow::blackOutput;
delete m_blackOutput;
}
void
......@@ -115,10 +113,10 @@ MainWorkflow::startRender( quint32 width, quint32 height, double fps )
m_renderStarted = true;
m_width = width;
m_height = height;
if ( blackOutput != NULL )
delete blackOutput;
blackOutput = new Workflow::Frame( m_width, m_height );
memset( blackOutput->buffer(), 0, blackOutput->size() );
if ( m_blackOutput != NULL )
delete m_blackOutput;
m_blackOutput = new Workflow::Frame( m_width, m_height );
memset( m_blackOutput->buffer(), 0, m_blackOutput->size() );
for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i )
m_tracks[i]->startRender( width, height, fps );
computeLength();
......@@ -138,7 +136,7 @@ MainWorkflow::getOutput( Workflow::TrackType trackType, bool paused )
if ( trackType == Workflow::VideoTrack )
{
if ( ret == NULL )
return MainWorkflow::blackOutput;
return m_blackOutput;
}
return ret;
}
......@@ -480,3 +478,9 @@ MainWorkflow::contains( const QUuid &uuid ) const
return true;
return false;
}
const Workflow::Frame*
MainWorkflow::blackOutput() const
{
return m_blackOutput;
}
......@@ -318,8 +318,7 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
*/
void stopFrameComputing();
/// Pre-filled buffer used when there's nothing to render
static Workflow::Frame* blackOutput;
const Workflow::Frame *blackOutput() const;
private:
MainWorkflow( int trackCount = 64 );
......@@ -345,6 +344,9 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
Workflow::TrackType trackType );
private:
/// Pre-filled buffer used when there's nothing to render
Workflow::Frame *m_blackOutput;
/// Lock for the m_currentFrame atribute.
QReadWriteLock* m_currentFrameLock;
/**
......
......@@ -335,7 +335,7 @@ TrackWorkflow::getOutput( qint64 currentFrame, qint64 subFrame, bool paused )
//FIXME: We don't handle mixer3 yet.
mixer->effect->process( currentFrame * 1000.0 / m_fps,
frames[0]->buffer(),
frames[1] != NULL ? frames[1]->buffer() : MainWorkflow::blackOutput->buffer(),
frames[1] != NULL ? frames[1]->buffer() : MainWorkflow::getInstance()->blackOutput()->buffer(),
NULL, m_mixerBuffer->buffer() );
m_mixerBuffer->ptsDiff = frames[0]->ptsDiff;
m_lastFrame = subFrame;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment