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

ImageClipWorkflow: Fixing frame and time passed to the effects engine.

parent acaa0135
...@@ -101,7 +101,9 @@ ImageClipWorkflow::getOutput( ClipWorkflow::GetMode ) ...@@ -101,7 +101,9 @@ ImageClipWorkflow::getOutput( ClipWorkflow::GetMode )
QMutexLocker lock( m_renderLock ); QMutexLocker lock( m_renderLock );
QReadLocker lock2( m_effectsLock ); QReadLocker lock2( m_effectsLock );
quint32 *buff = EffectsEngine::applyFilters( m_filters, m_buffer, 0, 0 ); qint64 currentFrame = MainWorkflow::getInstance()->getCurrentFrame( false );
quint32 *buff = EffectsEngine::applyFilters( m_filters, m_buffer, currentFrame,
currentFrame * 1000.0 / clip()->getMedia()->fps() );
if ( buff != NULL ) if ( buff != NULL )
{ {
m_effectFrame->setBuffer( buff ); m_effectFrame->setBuffer( buff );
......
...@@ -394,10 +394,13 @@ MainWorkflow::getTrackCount( Workflow::TrackType trackType ) const ...@@ -394,10 +394,13 @@ MainWorkflow::getTrackCount( Workflow::TrackType trackType ) const
} }
qint64 qint64
MainWorkflow::getCurrentFrame() const MainWorkflow::getCurrentFrame( bool lock /*= false*/ ) const
{ {
QReadLocker lock( m_currentFrameLock ); if ( lock == true )
{
QReadLocker lock( m_currentFrameLock );
return m_currentFrame[Workflow::VideoTrack];
}
return m_currentFrame[Workflow::VideoTrack]; return m_currentFrame[Workflow::VideoTrack];
} }
......
...@@ -116,9 +116,14 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow> ...@@ -116,9 +116,14 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
/** /**
* \brief Get the currently rendered frame. * \brief Get the currently rendered frame.
* \param lock If true, m_currentFrameLock will be locked for read.
* If false, it won't be locked. This is usefull when calling
* getCurentFrame from underlying workflows
* \return Returns the current frame. * \return Returns the current frame.
* \warning Locks the m_currentFrameLock ReadWriteLock, unless false is
* passed.
*/ */
qint64 getCurrentFrame() const; qint64 getCurrentFrame( bool lock = true ) const;
/** /**
* \brief Stops the rendering. * \brief Stops the rendering.
......
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