Commit 3c8bc9cb authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Merging EffectsEngine with Workflow.

It doesn't work, but from a theoretical POV, it's not too bad :)
parent 04519e16
...@@ -43,7 +43,7 @@ void EffectsEngine::render( void ) ...@@ -43,7 +43,7 @@ void EffectsEngine::render( void )
// return ; // return ;
// } // }
void EffectsEngine::setInputFrame( VideoFrame frame, quint32 tracknumber ) void EffectsEngine::setInputFrame( VideoFrame& frame, quint32 tracknumber )
{ {
m_videoInputs[tracknumber] = frame; m_videoInputs[tracknumber] = frame;
return ; return ;
......
...@@ -30,7 +30,7 @@ class EffectsEngine ...@@ -30,7 +30,7 @@ class EffectsEngine
// INPUTS & OUTPUTS METHODS // INPUTS & OUTPUTS METHODS
/* void setClock( Parameter currentframenumber ); */ /* void setClock( Parameter currentframenumber ); */
void setInputFrame( VideoFrame frame, quint32 tracknumber ); void setInputFrame( VideoFrame& frame, quint32 tracknumber );
VideoFrame const & getOutputFrame( quint32 tracknumber ) const; VideoFrame const & getOutputFrame( quint32 tracknumber ) const;
private: private:
......
#include "MixerEffect.h" #include "MixerEffect.h"
#include <iostream> #include <QtDebug>
char const * MixerEffect::m_videoInputsNames[] = char const * MixerEffect::m_videoInputsNames[] =
{ {
"track0", "track0",
...@@ -83,9 +84,20 @@ MixerEffect::~MixerEffect() ...@@ -83,9 +84,20 @@ MixerEffect::~MixerEffect()
void MixerEffect::render( void ) void MixerEffect::render( void )
{ {
LightVideoFrame tmp; LightVideoFrame tmp;
QHash< QString, InSlot<LightVideoFrame> >::iterator it = m_videoInputs.begin();
QHash< QString, InSlot<LightVideoFrame> >::iterator end = m_videoInputs.end();
qDebug() << "MixerEffect";
std::cout << "MixerEffect" << std::endl; while ( it != end )
(m_videoInputs["track0"]) >> tmp; {
(m_videoOutputs["out"]) << tmp; const VideoFrame& lvf = static_cast<VideoFrame>( static_cast<LightVideoFrame>( ( it.value() ) ) );
if ( lvf.rvf.raw != NULL )
{
m_videoOutputs["out"] << it.value();
}
++it;
}
qDebug() << "Endof MixerEffect";
return ; return ;
} }
...@@ -23,14 +23,16 @@ void PouetEffect::render( void ) ...@@ -23,14 +23,16 @@ void PouetEffect::render( void )
VideoFrame tmp; VideoFrame tmp;
quint32 size; quint32 size;
( m_videoInputs["in"] ) >> lol; m_videoOutputs["out"] << m_videoInputs["in"];
tmp = lol;
for ( i = 0; i < tmp.nbpixels; ++i ) // ( m_videoInputs["in"] ) >> lol;
tmp.rvf.pixel[i].Red = 'W'; // tmp = lol;
//
// for ( i = 0; i < tmp.nbpixels; ++i )
lol2 = tmp; // tmp.rvf.pixel[i].Red = 'W';
(m_videoOutputs["out"]) << lol2; //
//
// lol2 = tmp;
// (m_videoOutputs["out"]) << lol2;
return ; return ;
} }
...@@ -73,7 +73,11 @@ class WorkflowRenderer : public GenericRenderer ...@@ -73,7 +73,11 @@ class WorkflowRenderer : public GenericRenderer
bool m_stopping; bool m_stopping;
private: private:
<<<<<<< HEAD:src/Renderer/WorkflowRenderer.h
MainWorkflow::OutputBuffers* m_lastFrame; MainWorkflow::OutputBuffers* m_lastFrame;
=======
const VideoFrame* m_lastFrame;
>>>>>>> Merging EffectsEngine with Workflow.:src/Renderer/WorkflowRenderer.h
QStack<Actions> m_actions; QStack<Actions> m_actions;
QReadWriteLock* m_actionsLock; QReadWriteLock* m_actionsLock;
bool m_pauseAsked; bool m_pauseAsked;
......
...@@ -53,6 +53,7 @@ MainWorkflow::MainWorkflow( int trackCount ) : ...@@ -53,6 +53,7 @@ MainWorkflow::MainWorkflow( int trackCount ) :
connect( m_tracks[i], SIGNAL( allTracksRenderCompleted() ), this, SLOT( tracksRenderCompleted() ) ); connect( m_tracks[i], SIGNAL( allTracksRenderCompleted() ), this, SLOT( tracksRenderCompleted() ) );
} }
m_outputBuffers = new OutputBuffers; m_outputBuffers = new OutputBuffers;
m_effectEngine = new EffectsEngine;
} }
MainWorkflow::~MainWorkflow() MainWorkflow::~MainWorkflow()
...@@ -60,6 +61,7 @@ MainWorkflow::~MainWorkflow() ...@@ -60,6 +61,7 @@ MainWorkflow::~MainWorkflow()
//FIXME: this is probably useless, since already done by the renderer //FIXME: this is probably useless, since already done by the renderer
stop(); stop();
delete m_effectEngine;
delete m_synchroneRenderWaitConditionMutex; delete m_synchroneRenderWaitConditionMutex;
delete m_synchroneRenderWaitCondition; delete m_synchroneRenderWaitCondition;
delete m_renderMutex; delete m_renderMutex;
...@@ -100,10 +102,10 @@ void MainWorkflow::startRender() ...@@ -100,10 +102,10 @@ void MainWorkflow::startRender()
computeLength(); computeLength();
} }
void MainWorkflow::getOutput() void MainWorkflow::getOutput()
{ {
QReadLocker lock( m_renderStartedLock ); QReadLocker lock( m_renderStartedLock );
QMutexLocker lock2( m_renderMutex ); QMutexLocker lock2( m_renderMutex );
if ( m_renderStarted == true ) if ( m_renderStarted == true )
{ {
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include "TrackWorkflow.h" #include "TrackWorkflow.h"
#include "TrackHandler.h" #include "TrackHandler.h"
#include "Clip.h" #include "Clip.h"
#include "VideoFrame.h"
#include "EffectsEngine.h"
class MainWorkflow : public QObject, public Singleton<MainWorkflow> class MainWorkflow : public QObject, public Singleton<MainWorkflow>
{ {
...@@ -139,6 +141,8 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow> ...@@ -139,6 +141,8 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
friend class Singleton<MainWorkflow>; friend class Singleton<MainWorkflow>;
EffectsEngine* m_effectEngine;
private slots: private slots:
void tracksPaused(); void tracksPaused();
void tracksRenderCompleted(); void tracksRenderCompleted();
......
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