[vlmc-devel] commit: Deactivating effect engine. (Hugo Beauzee-Luyssen )

git at videolan.org git at videolan.org
Wed Apr 7 15:22:47 CEST 2010


vlmc | branch: master | Hugo Beauzee-Luyssen <beauze.h at gmail.com> | Wed Apr  7 15:15:02 2010 +0200| [5df4fd435ea1fc2cd9aa81372db9cabff867e8c9] | committer: Hugo Beauzee-Luyssen 

Deactivating effect engine.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=5df4fd435ea1fc2cd9aa81372db9cabff867e8c9
---

 src/Gui/MainWindow.cpp        |   16 ++++++++--------
 src/Workflow/MainWorkflow.cpp |   26 +++++++-------------------
 src/Workflow/MainWorkflow.h   |    9 ---------
 src/Workflow/TrackHandler.cpp |   27 ++++++++++-----------------
 src/Workflow/TrackHandler.h   |   13 ++-----------
 5 files changed, 27 insertions(+), 64 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index a9ffff5..246059e 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -505,15 +505,15 @@ void    MainWindow::toolButtonClicked( int id )
     emit toolChanged( (ToolButtons)id );
 }
 
-void MainWindow::on_actionBypass_effects_engine_toggled(bool toggled)
-{
-    EffectsEngine*  ee;
-
-    ee = MainWorkflow::getInstance()->getEffectsEngine();
-    if (toggled)
-        ee->enable();
-    else
-       ee->disable();
+void MainWindow::on_actionBypass_effects_engine_toggled(bool)
+{
+//    EffectsEngine*  ee;
+//
+//    ee = MainWorkflow::getInstance()->getEffectsEngine();
+//    if (toggled)
+//        ee->enable();
+//    else
+//       ee->disable();
     return ;
 }
 
diff --git a/src/Workflow/MainWorkflow.cpp b/src/Workflow/MainWorkflow.cpp
index b81b8d3..438da09 100644
--- a/src/Workflow/MainWorkflow.cpp
+++ b/src/Workflow/MainWorkflow.cpp
@@ -47,16 +47,13 @@ MainWorkflow::MainWorkflow( int trackCount ) :
     m_currentFrameLock = new QReadWriteLock;
     m_renderStartedMutex = new QMutex;
 
-    m_effectEngine = new EffectsEngine;
-    m_effectEngine->disable();
-
     m_tracks = new TrackHandler*[MainWorkflow::NbTrackType];
     m_currentFrame = new qint64[MainWorkflow::NbTrackType];
     for ( unsigned int i = 0; i < MainWorkflow::NbTrackType; ++i )
     {
         MainWorkflow::TrackType trackType =
                 (i == 0 ? MainWorkflow::VideoTrack : MainWorkflow::AudioTrack );
-        m_tracks[i] = new TrackHandler( trackCount, trackType, m_effectEngine );
+        m_tracks[i] = new TrackHandler( trackCount, trackType );
         connect( m_tracks[i], SIGNAL( tracksEndReached() ),
                  this, SLOT( tracksEndReached() ) );
         m_currentFrame[i] = 0;
@@ -66,7 +63,6 @@ MainWorkflow::MainWorkflow( int trackCount ) :
 
 MainWorkflow::~MainWorkflow()
 {
-    delete m_effectEngine;
     delete m_renderStartedMutex;
     delete m_currentFrameLock;
     delete m_currentFrame;
@@ -75,12 +71,6 @@ MainWorkflow::~MainWorkflow()
     delete[] m_tracks;
 }
 
-EffectsEngine*
-MainWorkflow::getEffectsEngine()
-{
-    return m_effectEngine;
-}
-
 void
 MainWorkflow::addClip( Clip *clip, unsigned int trackId,
                                         qint64 start, MainWorkflow::TrackType trackType )
@@ -134,21 +124,19 @@ MainWorkflow::getOutput( TrackType trackType, bool paused )
     {
         QReadLocker         lock2( m_currentFrameLock );
 
-        m_tracks[trackType]->getOutput( m_currentFrame[VideoTrack],
+        void*   ret = m_tracks[trackType]->getOutput( m_currentFrame[VideoTrack],
                                         m_currentFrame[trackType], paused );
         if ( trackType == MainWorkflow::VideoTrack )
         {
-            m_effectEngine->render();
-            const LightVideoFrame &tmp = m_effectEngine->getVideoOutput( 1 );
-            if ( tmp->nboctets == 0 )
-                m_outputBuffers->video = blackOutput;
+            LightVideoFrame*    frame = static_cast<LightVideoFrame*>( ret );
+            if ( frame == NULL )
+                m_outputBuffers->video = MainWorkflow::blackOutput;
             else
-                m_outputBuffers->video = &tmp;
+                m_outputBuffers->video = frame;
         }
         else
         {
-            m_outputBuffers->audio =
-                    m_tracks[MainWorkflow::AudioTrack]->getTmpAudioBuffer();
+            m_outputBuffers->audio = static_cast<AudioClipWorkflow::AudioSample*>( ret );
         }
     }
     return m_outputBuffers;
diff --git a/src/Workflow/MainWorkflow.h b/src/Workflow/MainWorkflow.h
index 6d48dc1..e48ec72 100644
--- a/src/Workflow/MainWorkflow.h
+++ b/src/Workflow/MainWorkflow.h
@@ -124,13 +124,6 @@ class   MainWorkflow : public QObject, public Singleton<MainWorkflow>
          */
         OutputBuffers*          getOutput( TrackType trackType, bool paused );
         /**
-         *  \brief  Returns the effect engine instance used by the workflow
-         *
-         *  \return The effect engine instance used by the workflow
-         */
-        EffectsEngine*          getEffectsEngine();
-
-        /**
          *  \brief              Set the workflow position by the desired frame
          *  \param              currentFrame: The desired frame to render from
          *  \param              reason: The program part which required this frame change
@@ -386,8 +379,6 @@ class   MainWorkflow : public QObject, public Singleton<MainWorkflow>
         /// Pre-allocated buffer, that will contain every computed outputs.
         OutputBuffers*                  m_outputBuffers;
 
-        /// Effect engine instance.
-        EffectsEngine*                  m_effectEngine;
         /// Width used for the render
         quint32                         m_width;
         /// Height used for the render
diff --git a/src/Workflow/TrackHandler.cpp b/src/Workflow/TrackHandler.cpp
index d2d81f8..7a37b6f 100644
--- a/src/Workflow/TrackHandler.cpp
+++ b/src/Workflow/TrackHandler.cpp
@@ -31,12 +31,10 @@
 
 LightVideoFrame* TrackHandler::nullOutput = NULL;
 
-TrackHandler::TrackHandler( unsigned int nbTracks, MainWorkflow::TrackType trackType,
-                            EffectsEngine* effectsEngine ) :
+TrackHandler::TrackHandler( unsigned int nbTracks, MainWorkflow::TrackType trackType ) :
         m_trackCount( nbTracks ),
         m_trackType( trackType ),
-        m_length( 0 ),
-        m_effectEngine( effectsEngine )
+        m_length( 0 )
 {
     TrackHandler::nullOutput = new LightVideoFrame();
 
@@ -113,29 +111,23 @@ TrackHandler::getLength() const
     return m_length;
 }
 
-void
+void*
 TrackHandler::getOutput( qint64 currentFrame, qint64 subFrame, bool paused )
 {
-    m_tmpAudioBuffer = NULL;
-    for ( unsigned int i = 0; i < m_trackCount; ++i )
+    for ( int i = m_trackCount - 1; i >= 0; --i )
     {
         if ( m_trackType == MainWorkflow::VideoTrack )
         {
             if ( m_tracks[i].activated() == false )
-            {
-                m_effectEngine->setVideoInput( i + 1, *TrackHandler::nullOutput );
-            }
+                continue ;
             else
             {
                 void*   ret = m_tracks[i]->getOutput( currentFrame, subFrame, paused );
+                StackedBuffer<LightVideoFrame*>   *buff = reinterpret_cast<StackedBuffer<LightVideoFrame*>*>( ret );
                 if ( ret == NULL )
-                    m_effectEngine->setVideoInput( i + 1, *TrackHandler::nullOutput );
+                    continue ;
                 else
-                {
-                    StackedBuffer<LightVideoFrame*>* stackedBuffer =
-                        reinterpret_cast<StackedBuffer<LightVideoFrame*>*>( ret );
-                    m_effectEngine->setVideoInput( i + 1, *( stackedBuffer->get() ) );
-                }
+                    return buff->get();
             }
         }
         else
@@ -150,10 +142,11 @@ TrackHandler::getOutput( qint64 currentFrame, qint64 subFrame, bool paused )
                 StackedBuffer<AudioClipWorkflow::AudioSample*>* stackedBuffer =
                     reinterpret_cast<StackedBuffer<AudioClipWorkflow::AudioSample*>*> ( ret );
                 if ( stackedBuffer != NULL )
-                    m_tmpAudioBuffer = stackedBuffer->get();
+                    return stackedBuffer->get();
             }
         }
     }
+    return NULL;
 }
 
 void
diff --git a/src/Workflow/TrackHandler.h b/src/Workflow/TrackHandler.h
index 3d8de27..867e8ab 100644
--- a/src/Workflow/TrackHandler.h
+++ b/src/Workflow/TrackHandler.h
@@ -27,10 +27,6 @@
 #include "Toggleable.hpp"
 #include "MainWorkflow.h"
 
-//TEMPORARY:
-#include "AudioClipWorkflow.h"
-
-class   EffectEngine;
 class   TrackWorkflow;
 
 class   QXmlStreamWriter;
@@ -39,7 +35,7 @@ class   TrackHandler : public QObject
 {
     Q_OBJECT
     public:
-        TrackHandler( unsigned int nbTracks, MainWorkflow::TrackType trackType, EffectsEngine* effectsEngine );
+        TrackHandler( unsigned int nbTracks, MainWorkflow::TrackType trackType );
         ~TrackHandler();
 
         void                    addClip( Clip* clip, unsigned int trackId, qint64 start );
@@ -56,7 +52,7 @@ class   TrackHandler : public QObject
          *                              track, it will be different.
          *  \param      paused          The renderer paused state
          */
-        void                    getOutput( qint64 currentFrame, qint64 subFrame,
+        void                    *getOutput( qint64 currentFrame, qint64 subFrame,
                                            bool paused );
         void                    activateAll();
         qint64                  getClipPosition( const QUuid& uuid, unsigned int trackId ) const;
@@ -69,9 +65,6 @@ class   TrackHandler : public QObject
         Clip*                   getClip( const QUuid& uuid, unsigned int trackId );
         void                    clear();
 
-        //FIXME: remove this. This should go by the effect engine.
-        AudioClipWorkflow::AudioSample* getTmpAudioBuffer() { return m_tmpAudioBuffer; }
-
         bool                    endIsReached() const;
 
         void                    save( QXmlStreamWriter& project ) const;
@@ -109,8 +102,6 @@ class   TrackHandler : public QObject
         qint64                          m_length;
         unsigned int                    m_highestTrackNumber;
         bool                            m_endReached;
-        EffectsEngine*                  m_effectEngine;
-        AudioClipWorkflow::AudioSample* m_tmpAudioBuffer;
 
 
     private slots:



More information about the Vlmc-devel mailing list