summaryrefslogtreecommitdiffstats
path: root/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-12-17 16:53:41 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-12-17 16:53:41 +0100
commit47698fc57fbc66f4b2921eeedb9cb8e71f8fb2d9 (patch)
treeed7cd0b18c15f8ec57c26011e5aa3dddb15bdb5d /src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp
parentaa38d3dfb16e76e8e2ce2d270020a6cb5cc8d3e9 (diff)
parenta864bfa4129f27f744ad223bbd14460afc049670 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: .qmake.conf Change-Id: I31e377cdccf8bf5c1ea8143faf2001ac99608c27
Diffstat (limited to 'src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp')
-rw-r--r--src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp
index 175fec1d5..031a176fc 100644
--- a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp
+++ b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp
@@ -44,6 +44,7 @@
#include <QtCore/qfunctions_winrt.h>
#include <QtCore/QGlobalStatic>
#include <QtCore/QMetaMethod>
+#include <QtCore/QPointer>
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLTexture>
#include <QtMultimedia/QAbstractVideoBuffer>
@@ -181,7 +182,7 @@ enum DirtyState {
class QWinRTAbstractVideoRendererControlPrivate
{
public:
- QAbstractVideoSurface *surface;
+ QPointer<QAbstractVideoSurface> surface;
QVideoSurfaceFormat format;
DirtyState dirtyState;
@@ -219,7 +220,6 @@ QWinRTAbstractVideoRendererControl::QWinRTAbstractVideoRendererControl(const QSi
{
Q_D(QWinRTAbstractVideoRendererControl);
- d->surface = Q_NULLPTR;
d->format = QVideoSurfaceFormat(size, QVideoFrame::Format_BGRA32,
QAbstractVideoBuffer::GLTextureHandle);
d->dirtyState = TextureDirty;
@@ -310,6 +310,16 @@ void QWinRTAbstractVideoRendererControl::setSize(const QSize &size)
d->dirtyState = TextureDirty;
}
+void QWinRTAbstractVideoRendererControl::setScanLineDirection(QVideoSurfaceFormat::Direction scanLineDirection)
+{
+ Q_D(QWinRTAbstractVideoRendererControl);
+
+ if (d->format.scanLineDirection() == scanLineDirection)
+ return;
+
+ d->format.setScanLineDirection(scanLineDirection);
+}
+
void QWinRTAbstractVideoRendererControl::setActive(bool active)
{
Q_D(QWinRTAbstractVideoRendererControl);
@@ -330,6 +340,8 @@ void QWinRTAbstractVideoRendererControl::setActive(bool active)
}
d->renderThread.requestInterruption();
+ if (d->surface && d->surface->isActive())
+ d->surface->stop();
}
void QWinRTAbstractVideoRendererControl::present()