[vlmc-devel] Configure WidgetTarget for Renderers

Yikai Lu git at videolan.org
Fri Apr 22 16:05:47 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Mon Apr 18 17:32:26 2016 +0900| [c4984f220a346534f6dfc4903a7fcf885ec7db59] | committer: Hugo Beauzée-Luyssen

Configure WidgetTarget for Renderers

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> https://code.videolan.org/videolan/vlmc/commit/c4984f220a346534f6dfc4903a7fcf885ec7db59
---

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

diff --git a/src/Gui/preview/PreviewWidget.cpp b/src/Gui/preview/PreviewWidget.cpp
index 6564d3b..51a5435 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"
@@ -70,6 +73,7 @@ PreviewWidget::setRenderer(GenericRenderer *renderer)
 
     // Give the renderer to the ruler
     m_ui->rulerWidget->setRenderer( m_renderer );
+    m_renderer->setRenderTarget( std::unique_ptr<Backend::IRenderTarget>( 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..8da108d 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() );
 }



More information about the Vlmc-devel mailing list