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

ClipWorkflow: Pass the precise frame when setting time.

This will enhance the effectsengine precision when it comes to starting
an effect or not.
parent b0ca843a
......@@ -148,8 +148,8 @@ ClipWorkflow::stopRenderer()
}
void
ClipWorkflow::setTime( qint64 time )
{
ClipWorkflow::setTime( qint64 time, qint64 ) //Ignore the frame parameter for generic clip workflow.
{ //the VideoClipWorkflow reimplementation will handle it.
m_mediaPlayer->setTime( time );
resyncClipWorkflow();
QWriteLocker lock( m_stateLock );
......
......@@ -148,8 +148,9 @@ class ClipWorkflow : public QObject
/**
* \brief Set the rendering position
* \param time The position in millisecond
* \param frame The new current frame.
*/
virtual void setTime( qint64 time );
virtual void setTime( qint64 time, qint64 frame );
/**
* This method must be used to change the state of the ClipWorkflow
......
......@@ -460,7 +460,7 @@ void TrackWorkflow::adjustClipTime( qint64 currentFrame, qint64 start, ClipWo
qint64 nbMs = ( currentFrame - start ) / cw->clip()->getMedia()->fps() * 1000;
qint64 beginInMs = cw->getClipHelper()->begin() / cw->clip()->getMedia()->fps() * 1000;
qint64 startFrame = beginInMs + nbMs;
cw->setTime( startFrame );
cw->setTime( startFrame, currentFrame );
}
void
......
......@@ -233,13 +233,13 @@ VideoClipWorkflow::saveEffects( QXmlStreamWriter &project ) const
}
void
VideoClipWorkflow::setTime( qint64 time )
VideoClipWorkflow::setTime( qint64 time, qint64 frame )
{
{
QMutexLocker lock( m_renderedFrameMutex );
m_renderedFrame = time / 1000 * clip()->getMedia()->fps();
m_renderedFrame = frame;
}
ClipWorkflow::setTime( time );
ClipWorkflow::setTime( time, frame );
}
VideoClipWorkflow::StackedBuffer::StackedBuffer( Workflow::Frame *frame,
......
......@@ -53,7 +53,7 @@ class VideoClipWorkflow : public ClipWorkflow
void *getUnlockCallback() const;
virtual void *getOutput( ClipWorkflow::GetMode mode );
virtual bool appendEffect( Effect *effect, qint64 start = 0, qint64 end = -1 );
virtual void setTime( qint64 time );
virtual void setTime( qint64 time, qint64 frame );
virtual void saveEffects( QXmlStreamWriter &project ) const;
static const quint32 nbBuffers = 3 * 30; //3 seconds with an average fps of 30
......
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