[vlmc-devel] commit: ClipWorkflow: When adding a filter, return its helper. ( Hugo Beauzée-Luyssen )
git at videolan.org
git at videolan.org
Wed Aug 25 00:40:13 CEST 2010
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Aug 24 23:50:56 2010 +0200| [6f8b3ee9aaedb5d154820d13af6234f87f8e6812] | committer: Hugo Beauzée-Luyssen
ClipWorkflow: When adding a filter, return its helper.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=6f8b3ee9aaedb5d154820d13af6234f87f8e6812
---
src/Workflow/AudioClipWorkflow.h | 2 +-
src/Workflow/ClipWorkflow.h | 5 +++--
src/Workflow/ImageClipWorkflow.h | 2 +-
src/Workflow/VideoClipWorkflow.cpp | 9 +++++----
src/Workflow/VideoClipWorkflow.h | 2 +-
5 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/Workflow/AudioClipWorkflow.h b/src/Workflow/AudioClipWorkflow.h
index 2d40d30..b3f5317 100644
--- a/src/Workflow/AudioClipWorkflow.h
+++ b/src/Workflow/AudioClipWorkflow.h
@@ -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;
diff --git a/src/Workflow/ClipWorkflow.h b/src/Workflow/ClipWorkflow.h
index c519119..3a9b21b 100644
--- a/src/Workflow/ClipWorkflow.h
+++ b/src/Workflow/ClipWorkflow.h
@@ -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 );
diff --git a/src/Workflow/ImageClipWorkflow.h b/src/Workflow/ImageClipWorkflow.h
index 7c18c8a..a6048e8 100644
--- a/src/Workflow/ImageClipWorkflow.h
+++ b/src/Workflow/ImageClipWorkflow.h
@@ -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;
diff --git a/src/Workflow/VideoClipWorkflow.cpp b/src/Workflow/VideoClipWorkflow.cpp
index 2db420f..ddd5977 100644
--- a/src/Workflow/VideoClipWorkflow.cpp
+++ b/src/Workflow/VideoClipWorkflow.cpp
@@ -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
diff --git a/src/Workflow/VideoClipWorkflow.h b/src/Workflow/VideoClipWorkflow.h
index 7646f93..9e8f3eb 100644
--- a/src/Workflow/VideoClipWorkflow.h
+++ b/src/Workflow/VideoClipWorkflow.h
@@ -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;
More information about the Vlmc-devel
mailing list