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

Yikai Lu luyikei.qmltu at gmail.com
Sun Apr 17 11:02:26 CEST 2016


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

diff --git a/src/Gui/preview/PreviewWidget.cpp b/src/Gui/preview/PreviewWidget.cpp
index 6564d3b..7e61658 100644
--- a/src/Gui/preview/PreviewWidget.cpp
+++ b/src/Gui/preview/PreviewWidget.cpp
@@ -21,9 +21,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#include <memory>
+
 #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"
@@ -124,6 +127,9 @@ PreviewWidget::frameChanged( qint64 currentFrame, Vlmc::FrameChangedReason reaso
 void
 PreviewWidget::on_pushButtonPlay_clicked()
 {
+    if ( m_renderer->isRendering() == false )
+        m_renderer->setRenderTarget( std::unique_ptr<Backend::IRenderTarget>( new Backend::WidgetTarget( (void*)m_ui->renderWidget->id() ) ) );
+
     if ( m_previewStopped == true )
         m_previewStopped = false;
     m_renderer->togglePlayPause();
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..5997c16 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -84,6 +84,7 @@ WorkflowRenderer::setupRenderer()
 
     delete m_sourceRenderer;
     m_sourceRenderer = m_source->createRenderer( m_eventWatcher );
+    m_renderTarget->configure( m_sourceRenderer );
     m_sourceRenderer->setName( "WorkflowRenderer" );
     m_sourceRenderer->enableMemoryInput( m_esHandler, getLockCallback(), getUnlockCallback() );
 }
-- 
1.9.1



More information about the Vlmc-devel mailing list