[vlmc-devel] commit: TrackWorkflow: Apply filters. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Sun Aug 29 21:38:11 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Aug 29 20:42:52 2010 +0200| [3220a33310e1fdb020e85bc03cdcc813bff9a641] | committer: Hugo Beauzée-Luyssen 

TrackWorkflow: Apply filters.

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

 src/Workflow/TrackWorkflow.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/Workflow/TrackWorkflow.cpp b/src/Workflow/TrackWorkflow.cpp
index 9dd8ca0..1d18810 100644
--- a/src/Workflow/TrackWorkflow.cpp
+++ b/src/Workflow/TrackWorkflow.cpp
@@ -346,6 +346,7 @@ TrackWorkflow::getOutput( qint64 currentFrame, qint64 subFrame, bool paused )
     //Handle mixers:
     if ( m_trackType == Workflow::VideoTrack )
     {
+        QReadLocker     lock2( m_effectsLock );
         EffectsEngine::EffectHelper* mixer = EffectsEngine::getMixer( m_mixers, currentFrame );
         if ( mixer != NULL && frames[0] != NULL ) //There's no point using the mixer if there's no frame rendered.
         {
@@ -355,11 +356,15 @@ TrackWorkflow::getOutput( qint64 currentFrame, qint64 subFrame, bool paused )
                                     frames[1] != NULL ? frames[1]->buffer() : MainWorkflow::getInstance()->blackOutput()->buffer(),
                                     NULL, m_mixerBuffer->buffer() );
             m_mixerBuffer->ptsDiff = frames[0]->ptsDiff;
-            m_lastFrame = subFrame;
-            return m_mixerBuffer;
+            ret = m_mixerBuffer;
         }
         else //If there's no mixer, just use the first frame, ignore the rest. It will be cleaned by the responsible ClipWorkflow.
             ret = frames[0];
+        //Now handle filters :
+        quint32     *newFrame = EffectsEngine::applyFilters( m_filters, static_cast<const Workflow::Frame*>( ret ),
+                                                             currentFrame, currentFrame * 1000.0 / m_fps );
+        if ( newFrame != NULL )
+            static_cast<Workflow::Frame*>( ret )->setBuffer( newFrame );
     }
     m_lastFrame = subFrame;
     return ret;



More information about the Vlmc-devel mailing list