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

EffectsEngine: Adding types for Mixers, renaming filter methods.

parent 4bf32260
...@@ -100,7 +100,7 @@ EffectsEngine::browseDirectory( const QString &path ) ...@@ -100,7 +100,7 @@ EffectsEngine::browseDirectory( const QString &path )
} }
void void
EffectsEngine::applyEffects( const FilterList &effects, Workflow::Frame* frame, EffectsEngine::applyFilters( const FilterList &effects, Workflow::Frame* frame,
qint64 currentFrame, double time ) qint64 currentFrame, double time )
{ {
if ( effects.size() == 0 ) if ( effects.size() == 0 )
...@@ -149,7 +149,7 @@ EffectsEngine::applyEffects( const FilterList &effects, Workflow::Frame* frame, ...@@ -149,7 +149,7 @@ EffectsEngine::applyEffects( const FilterList &effects, Workflow::Frame* frame,
} }
void void
EffectsEngine::saveEffects( const FilterList &effects, QXmlStreamWriter &project ) EffectsEngine::saveFilters( const FilterList &effects, QXmlStreamWriter &project )
{ {
if ( effects.size() <= 0 ) if ( effects.size() <= 0 )
return ; return ;
...@@ -169,7 +169,7 @@ EffectsEngine::saveEffects( const FilterList &effects, QXmlStreamWriter &project ...@@ -169,7 +169,7 @@ EffectsEngine::saveEffects( const FilterList &effects, QXmlStreamWriter &project
} }
void void
EffectsEngine::initEffects( const FilterList &effects, quint32 width, quint32 height ) EffectsEngine::initFilters( const FilterList &effects, quint32 width, quint32 height )
{ {
EffectsEngine::FilterList::const_iterator it = effects.begin(); EffectsEngine::FilterList::const_iterator it = effects.begin();
EffectsEngine::FilterList::const_iterator ite = effects.end(); EffectsEngine::FilterList::const_iterator ite = effects.end();
......
...@@ -31,6 +31,7 @@ class QTime; ...@@ -31,6 +31,7 @@ class QTime;
#include "MainWorkflow.h" #include "MainWorkflow.h"
class FilterInstance; class FilterInstance;
class MixerInstance;
#include <QObject> #include <QObject>
#include <QHash> #include <QHash>
...@@ -63,16 +64,18 @@ class EffectsEngine : public QObject, public Singleton<EffectsEngine> ...@@ -63,16 +64,18 @@ class EffectsEngine : public QObject, public Singleton<EffectsEngine>
QUuid uuid; QUuid uuid;
}; };
typedef EffectHelper<FilterInstance> FilterHelper; typedef EffectHelper<FilterInstance> FilterHelper;
typedef QList<FilterHelper*> FilterList; typedef QList<FilterHelper*> FilterList;
typedef EffectHelper<MixerInstance> MixerHelper;
typedef QList<MixerHelper*> MixerList;
Effect* effect( const QString& name ); Effect* effect( const QString& name );
bool loadEffect( const QString& fileName ); bool loadEffect( const QString& fileName );
void browseDirectory( const QString& path ); void browseDirectory( const QString& path );
static void applyEffects( const FilterList &effects, static void applyFilters( const FilterList &effects,
Workflow::Frame *frame, qint64 currentFrame, double time ); Workflow::Frame *frame, qint64 currentFrame, double time );
static void saveEffects( const FilterList &effects, QXmlStreamWriter &project ); static void saveFilters( const FilterList &effects, QXmlStreamWriter &project );
static void initEffects( const FilterList &effects, quint32 width, quint32 height ); static void initFilters( const FilterList &effects, quint32 width, quint32 height );
private: private:
EffectsEngine(); EffectsEngine();
......
...@@ -175,7 +175,7 @@ WorkflowRenderer::lockVideo( EsHandler *handler, qint64 *pts, size_t *bufferSize ...@@ -175,7 +175,7 @@ WorkflowRenderer::lockVideo( EsHandler *handler, qint64 *pts, size_t *bufferSize
} }
{ {
QReadLocker lock( m_effectsLock ); QReadLocker lock( m_effectsLock );
EffectsEngine::applyEffects( m_filters, ret->video, EffectsEngine::applyFilters( m_filters, ret->video,
m_mainWorkflow->getCurrentFrame(), m_mainWorkflow->getCurrentFrame(),
m_mainWorkflow->getCurrentFrame() * 1000.0 / handler->fps ); m_mainWorkflow->getCurrentFrame() * 1000.0 / handler->fps );
} }
...@@ -239,7 +239,7 @@ void WorkflowRenderer::startPreview() ...@@ -239,7 +239,7 @@ void WorkflowRenderer::startPreview()
setupRenderer( m_width, m_height, m_outputFps ); setupRenderer( m_width, m_height, m_outputFps );
} }
QReadLocker lock( m_effectsLock ); QReadLocker lock( m_effectsLock );
EffectsEngine::initEffects( m_filters, m_width, m_height ); EffectsEngine::initFilters( m_filters, m_width, m_height );
//Deactivating vlc's keyboard inputs. //Deactivating vlc's keyboard inputs.
m_mediaPlayer->setKeyInput( false ); m_mediaPlayer->setKeyInput( false );
...@@ -414,7 +414,7 @@ WorkflowRenderer::saveProject( QXmlStreamWriter &project ) const ...@@ -414,7 +414,7 @@ WorkflowRenderer::saveProject( QXmlStreamWriter &project ) const
project.writeStartElement( "renderer" ); project.writeStartElement( "renderer" );
{ {
QReadLocker lock( m_effectsLock ); QReadLocker lock( m_effectsLock );
EffectsEngine::saveEffects( m_filters, project ); EffectsEngine::saveFilters( m_filters, project );
} }
project.writeEndElement(); project.writeEndElement();
} }
......
...@@ -102,7 +102,7 @@ VideoClipWorkflow::initVlcOutput() ...@@ -102,7 +102,7 @@ VideoClipWorkflow::initVlcOutput()
m_vlcMedia->addOption( buffer ); m_vlcMedia->addOption( buffer );
QReadLocker lock( m_effectsLock ); QReadLocker lock( m_effectsLock );
EffectsEngine::initEffects( m_filters, m_width, m_height ); EffectsEngine::initFilters( m_filters, m_width, m_height );
} }
void* void*
...@@ -169,7 +169,7 @@ VideoClipWorkflow::unlock( VideoClipWorkflow *cw, void *buffer, int width, ...@@ -169,7 +169,7 @@ VideoClipWorkflow::unlock( VideoClipWorkflow *cw, void *buffer, int width,
Workflow::Frame *frame = cw->m_computedBuffers.last(); Workflow::Frame *frame = cw->m_computedBuffers.last();
{ {
QWriteLocker lock( cw->m_effectsLock ); QWriteLocker lock( cw->m_effectsLock );
EffectsEngine::applyEffects( cw->m_filters, frame, cw->m_renderedFrame, EffectsEngine::applyFilters( cw->m_filters, frame, cw->m_renderedFrame,
cw->m_renderedFrame * 1000.0 / cw->clip()->getMedia()->fps() ); cw->m_renderedFrame * 1000.0 / cw->clip()->getMedia()->fps() );
} }
{ {
...@@ -229,7 +229,7 @@ void ...@@ -229,7 +229,7 @@ void
VideoClipWorkflow::saveEffects( QXmlStreamWriter &project ) const VideoClipWorkflow::saveEffects( QXmlStreamWriter &project ) const
{ {
QReadLocker lock( m_effectsLock ); QReadLocker lock( m_effectsLock );
EffectsEngine::saveEffects( m_filters, project ); EffectsEngine::saveFilters( m_filters, project );
} }
void void
......
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