[vlmc-devel] [PATCH 6/7] Configure WidgetTarget for Renderers

Yikai Lu luyikei.qmltu at gmail.com
Sat Apr 16 08:22:06 CEST 2016


---
 src/Gui/preview/PreviewWidget.cpp | 2 ++
 src/Renderer/ClipRenderer.cpp     | 1 +
 src/Renderer/WorkflowRenderer.cpp | 1 +
 3 files changed, 4 insertions(+)

diff --git a/src/Gui/preview/PreviewWidget.cpp b/src/Gui/preview/PreviewWidget.cpp
index 6564d3b..d3dc3a9 100644
--- a/src/Gui/preview/PreviewWidget.cpp
+++ b/src/Gui/preview/PreviewWidget.cpp
@@ -24,6 +24,7 @@
 #include "Media/Clip.h"
 #include "Renderer/ClipRenderer.h"
 #include "Backend/ISourceRenderer.h"
+#include "Backend/Target/WidgetTarget.h"
 #include "PreviewWidget.h"
 #include "PreviewRuler.h"
 #include "RenderWidget.h"
@@ -70,6 +71,7 @@ PreviewWidget::setRenderer(GenericRenderer *renderer)
 
     // Give the renderer to the ruler
     m_ui->rulerWidget->setRenderer( m_renderer );
+    m_renderer->setRenderTarget( new Backend::WidgetTarget( (void*)m_ui->renderWidget->id() ) );
 
 #if defined ( Q_OS_MAC )
     /* Releases the NSView in the RenderWidget*/
diff --git a/src/Renderer/ClipRenderer.cpp b/src/Renderer/ClipRenderer.cpp
index d54389f..e40297a 100644
--- a/src/Renderer/ClipRenderer.cpp
+++ b/src/Renderer/ClipRenderer.cpp
@@ -89,6 +89,7 @@ ClipRenderer::startPreview()
 
     delete m_sourceRenderer;
     m_sourceRenderer = m_selectedClip->media()->source()->createRenderer( m_eventWatcher );
+    m_renderTarget->configure( m_sourceRenderer );
 
     connect( m_eventWatcher, SIGNAL( stopped() ), this, SLOT( videoStopped() ) );
     connect( m_eventWatcher, SIGNAL( paused() ),  this, SIGNAL( paused() ) );
diff --git a/src/Renderer/WorkflowRenderer.cpp b/src/Renderer/WorkflowRenderer.cpp
index 8587811..7056555 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -251,6 +251,7 @@ WorkflowRenderer::startPreview()
     m_aspectRatio = project->aspectRatio();
 
     setupRenderer();
+    m_renderTarget->configure( m_sourceRenderer );
     m_mainWorkflow->setFullSpeedRender( false );
     start();
 }
-- 
1.9.1



More information about the Vlmc-devel mailing list