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

ClipWorkflow: When adding a filter, return its helper.

parent 63effb07
......@@ -44,7 +44,7 @@ class AudioClipWorkflow : public ClipWorkflow
void *getUnlockCallback() const;
virtual Workflow::OutputBuffer *getOutput( ClipWorkflow::GetMode mode );
virtual void saveEffects( QXmlStreamWriter & ) const {} //Nothing to do here now.
virtual bool appendEffect( Effect *, qint64, qint64 ) { return false; } //Nothing to do here now.
virtual EffectsEngine::FilterHelper *appendEffect( Effect *, qint64, qint64 ) { return NULL; } //Nothing to do here now.
protected:
virtual quint32 getNbComputedBuffers() const;
virtual quint32 getMaxComputedBuffers() const;
......
......@@ -24,6 +24,7 @@
#define CLIPWORKFLOW_H
#include "mdate.h"
#include "EffectsEngine.h"
#include "ClipHelper.h"
#include "Types.h"
......@@ -202,8 +203,8 @@ class ClipWorkflow : public QObject
void save( QXmlStreamWriter& project ) const;
virtual void saveEffects( QXmlStreamWriter& ) const = 0;
virtual bool appendEffect( Effect *effect, qint64 start = 0,
qint64 end = -1 ) = 0;
virtual EffectsEngine::FilterHelper *appendEffect( Effect *effect, qint64 start = 0,
qint64 end = -1 ) = 0;
private:
void setState( State state );
......
......@@ -37,7 +37,7 @@ class ImageClipWorkflow : public ClipWorkflow
void *getUnlockCallback() const;
virtual Workflow::OutputBuffer *getOutput( ClipWorkflow::GetMode mode );
virtual void saveEffects( QXmlStreamWriter & ) const {} //Nothing to do here now.
virtual bool appendEffect( Effect *, qint64, qint64 ) { return false; } //Nothing to do here now.
virtual EffectsEngine::FilterHelper *appendEffect( Effect *, qint64, qint64 ) { return NULL; } //Nothing to do here now.
protected:
virtual void initVlcOutput();
virtual quint32 getNbComputedBuffers() const;
......
......@@ -212,18 +212,19 @@ VideoClipWorkflow::flushComputedBuffers()
m_availableBuffers.enqueue( m_computedBuffers.dequeue() );
}
bool
EffectsEngine::FilterHelper*
VideoClipWorkflow::appendEffect( Effect *effect, qint64 start, qint64 end )
{
if ( effect->type() != Effect::Filter )
{
qWarning() << "VideoClipWorkflow does not handle non filter effects.";
return false;
return NULL;
}
FilterInstance *filterInstance = static_cast<FilterInstance*>( effect->createInstance() );
QWriteLocker lock( m_effectsLock );
m_filters.push_back( new EffectsEngine::FilterHelper( filterInstance, start, end ) );
return true;
EffectsEngine::FilterHelper *ret = new EffectsEngine::FilterHelper( filterInstance, start, end );
m_filters.push_back( ret );
return ret;
}
void
......
......@@ -40,7 +40,7 @@ class VideoClipWorkflow : public ClipWorkflow
void *getLockCallback() const;
void *getUnlockCallback() const;
virtual Workflow::OutputBuffer *getOutput( ClipWorkflow::GetMode mode );
virtual bool appendEffect( Effect *effect, qint64 start = 0, qint64 end = -1 );
virtual EffectsEngine::FilterHelper *appendEffect( Effect *effect, qint64 start = 0, qint64 end = -1 );
virtual void setTime( qint64 time, qint64 frame );
virtual void saveEffects( QXmlStreamWriter &project ) const;
......
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