[vlmc-devel] Bugfix: 237, Detached Vout Display on Mac OS
Rohit Yadav
git at videolan.org
Fri Mar 25 09:06:09 CET 2011
vlmc | branch: master | Rohit Yadav <rohityadav89 at gmail.com> | Fri Mar 25 19:00:34 2011 +0530| [bc4260995acd418e49c45ce386a4e79ea26081b7] | committer: Rohit Yadav
Bugfix: 237, Detached Vout Display on Mac OS
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=bc4260995acd418e49c45ce386a4e79ea26081b7
---
src/Gui/preview/PreviewWidget.cpp | 6 ++++++
src/Gui/preview/ui/PreviewWidget.ui | 8 +++++++-
src/Renderer/GenericRenderer.cpp | 4 +++-
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/Gui/preview/PreviewWidget.cpp b/src/Gui/preview/PreviewWidget.cpp
index 87410c3..8125d32 100644
--- a/src/Gui/preview/PreviewWidget.cpp
+++ b/src/Gui/preview/PreviewWidget.cpp
@@ -23,6 +23,7 @@
#include "PreviewWidget.h"
#include "PreviewRuler.h"
+#include "RenderWidget.h"
#include "ui_PreviewWidget.h"
#include "ClipRenderer.h"
#include "Clip.h"
@@ -78,6 +79,11 @@ PreviewWidget::setRenderer( GenericRenderer *renderer )
m_renderer->setRenderWidget( m_ui->renderWidget );
+#if defined ( Q_WS_MAC )
+ /* Releases the NSView in the RenderWidget*/
+ m_ui->renderWidget->release();
+#endif
+
connect( m_renderer, SIGNAL( stopped() ), this, SLOT( videoStopped() ) );
connect( m_renderer, SIGNAL( paused() ), this, SLOT( videoPaused() ) );
connect( m_renderer, SIGNAL( playing() ), this, SLOT( videoPlaying() ) );
diff --git a/src/Gui/preview/ui/PreviewWidget.ui b/src/Gui/preview/ui/PreviewWidget.ui
index 5af1f95..7ed5e58 100644
--- a/src/Gui/preview/ui/PreviewWidget.ui
+++ b/src/Gui/preview/ui/PreviewWidget.ui
@@ -33,7 +33,7 @@
<number>0</number>
</property>
<item>
- <widget class="QWidget" name="renderWidget" native="true">
+ <widget class="RenderWidget" name="renderWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@@ -448,6 +448,12 @@
<extends>QLCDNumber</extends>
<header>LCDTimecode.h</header>
</customwidget>
+ <customwidget>
+ <class>RenderWidget</class>
+ <extends>QWidget</extends>
+ <header>RenderWidget.h</header>
+ <container>1</container>
+ </customwidget>
</customwidgets>
<resources>
<include location="../../../../resources.qrc"/>
diff --git a/src/Renderer/GenericRenderer.cpp b/src/Renderer/GenericRenderer.cpp
index a339ea0..1322f1e 100644
--- a/src/Renderer/GenericRenderer.cpp
+++ b/src/Renderer/GenericRenderer.cpp
@@ -22,6 +22,8 @@
#include "GenericRenderer.h"
#include "VLCMediaPlayer.h"
+#include "RenderWidget.h"
+#include <QtGlobal>
GenericRenderer::GenericRenderer() :
m_paused( false )
@@ -38,7 +40,7 @@ GenericRenderer::~GenericRenderer()
void
GenericRenderer::setRenderWidget(QWidget *renderWidget)
{
- m_mediaPlayer->setDrawable( renderWidget->winId() );
+ m_mediaPlayer->setDrawable( (void *) static_cast< RenderWidget* >(renderWidget)->id() );
m_renderWidget = renderWidget;
}
#endif
More information about the Vlmc-devel
mailing list