[vlmc-devel] [PATCH 2/7] Don't apply effects in WorkflowRenderer
Yikai Lu
luyikei.qmltu at gmail.com
Sat Apr 16 08:22:02 CEST 2016
In terms of consistency, those effects should be applied in TrackHandler, not in WorkflowRenderer. There are two reasons for it.
1) We only save all the information of the timeline in Workflow to Project
2) In terms of separation. If we seperate Workflow from Renderer to establish IPC in the future, Renderer should just be a class to display frames/audio given by Workflow.
---
src/Renderer/WorkflowRenderer.cpp | 15 +++------------
src/Renderer/WorkflowRenderer.h | 2 --
2 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/src/Renderer/WorkflowRenderer.cpp b/src/Renderer/WorkflowRenderer.cpp
index 4caffb3..8587811 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -50,7 +50,6 @@ WorkflowRenderer::WorkflowRenderer( Backend::IBackend* backend, MainWorkflow* ma
, m_nbChannels( 2 )
, m_rate( 48000 )
, m_oldLength( 0 )
- , m_effectFrame( nullptr )
{
m_source = backend->createMemorySource();
m_esHandler = new EsHandler;
@@ -141,12 +140,8 @@ WorkflowRenderer::lockVideo( void* data, int64_t *pts, size_t *bufferSize, const
//this is a bit hackish though... (especially regarding the "no frame computed" detection)
ptsDiff = 1000000 / handler->fps;
}
- m_effectFrame = applyFilters( ret, m_mainWorkflow->getCurrentFrame() );
m_pts = *pts = ptsDiff + m_pts;
- if ( m_effectFrame != nullptr )
- *buffer = m_effectFrame;
- else
- *buffer = ret->buffer();
+ *buffer = ret->buffer();
*bufferSize = ret->size();
#ifdef WITH_GUI
@@ -202,11 +197,9 @@ WorkflowRenderer::lockAudio( EsHandler *handler, int64_t *pts, size_t *bufferSiz
}
void
-WorkflowRenderer::unlock( void *data, const char*, size_t, void* )
+WorkflowRenderer::unlock( void *, const char*, size_t, void* )
{
- EsHandler* handler = reinterpret_cast<EsHandler*>( data );
- delete[] handler->self->m_effectFrame;
- handler->self->m_effectFrame = nullptr;
+ // Nothing to do for now
}
void
@@ -233,7 +226,6 @@ WorkflowRenderer::startRenderToFile( const QString& outputFileName, quint32 widt
m_outputFps = fps;
m_aspectRatio = ar;
- initFilters();
setupRenderer();
m_sourceRenderer->setOutputFile( qPrintable( outputFileName ) );
m_sourceRenderer->setOutputAudioBitrate( abitrate );
@@ -258,7 +250,6 @@ WorkflowRenderer::startPreview()
m_outputFps = project->fps();
m_aspectRatio = project->aspectRatio();
- initFilters();
setupRenderer();
m_mainWorkflow->setFullSpeedRender( false );
start();
diff --git a/src/Renderer/WorkflowRenderer.h b/src/Renderer/WorkflowRenderer.h
index e8a12f4..a44ddd1 100644
--- a/src/Renderer/WorkflowRenderer.h
+++ b/src/Renderer/WorkflowRenderer.h
@@ -244,8 +244,6 @@ class WorkflowRenderer : public GenericRenderer
*/
qint64 m_oldLength;
- quint32 *m_effectFrame;
-
static const quint8 VideoCookie = '0';
static const quint8 AudioCookie = '1';
--
1.9.1
More information about the Vlmc-devel
mailing list