Commit 1189fb7c authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Things are starting to become functionnal again

parent bb59b5e4
......@@ -78,6 +78,7 @@ void ClipWorkflow::initialize()
connect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( loadingComplete() ), Qt::DirectConnection );
connect( m_mediaPlayer, SIGNAL( endReached() ), this, SLOT( clipEndReached() ), Qt::DirectConnection );
qDebug() << "Starting clipworkflow playback";
m_mediaPlayer->play();
}
......@@ -85,8 +86,10 @@ void ClipWorkflow::loadingComplete()
{
adjustBegin();
disconnect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( loadingComplete() ) );
qDebug() << "Setting state to Rendering";
QMutexLocker lock( m_initWaitCond->getMutex() );
setState( Rendering );
qDebug() << "Waking init wait cond";
m_initWaitCond->wake();
}
......
......@@ -115,7 +115,9 @@ void TrackHandler::getOutput( qint64 currentFrame )
{
StackedBuffer<AudioClipWorkflow::AudioSample*>* stackedBuffer =
reinterpret_cast<StackedBuffer<AudioClipWorkflow::AudioSample*>*> (m_tracks[i]->getOutput( currentFrame ) );
if ( stackedBuffer != NULL )
m_tmpAudioBuffer = stackedBuffer->get();
//else if will remain NULL
}
}
}
......
......@@ -219,8 +219,17 @@ void TrackWorkflow::stop()
m_lastFrame = 0;
}
void TrackWorkflow::releasePreviousRender()
{
if ( m_audioStackedBuffer != NULL )
m_audioStackedBuffer->release();
if ( m_videoStackedBuffer != NULL )
m_videoStackedBuffer->release();
}
void* TrackWorkflow::getOutput( qint64 currentFrame )
{
releasePreviousRender();
QReadLocker lock( m_clipsLock );
QMap<qint64, ClipWorkflow*>::iterator it = m_clips.begin();
......
......@@ -83,6 +83,7 @@ class TrackWorkflow : public QObject
bool checkEnd( qint64 currentFrame ) const;
void adjustClipTime( qint64 currentFrame, qint64 start, ClipWorkflow* cw );
void disconnectClipWorkflow( ClipWorkflow* cw );
void releasePreviousRender();
private:
......
......@@ -86,9 +86,10 @@ void* VideoClipWorkflow::getUnlockCallback()
void* VideoClipWorkflow::getOutput( ClipWorkflow::GetMode mode )
{
QMutexLocker lock( m_renderLock );
preGetOutput();
//Don't lock before preGetOutput() : it can eventually waits for the clipworkflow to render a frame
//which requires the renderLock to be unheld.
QMutexLocker lock( m_renderLock );
qWarning() << "poping buffer";
if ( isEndReached() == true )
......
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