From 3443517265cbe432ada3b857f68ad981af6cd152 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 3 Dec 2014 13:10:34 +0100 Subject: Fix VideoOutput autoOrientation when switching cameras. The VideoOutput's camera info was not updated when switching cameras. Change-Id: I23537ce98b08009898eaa26ef14d5b9a746ab5f7 Reviewed-by: Andrew Knight --- .../qdeclarativevideooutput_p.h | 1 + .../qdeclarativevideooutput.cpp | 51 +++++++++++++++++----- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h b/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h index 4e77b8d78..e1dbf5646 100644 --- a/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h +++ b/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h @@ -119,6 +119,7 @@ protected: private Q_SLOTS: void _q_updateMediaObject(); + void _q_updateCameraInfo(); void _q_updateNativeSize(); void _q_updateGeometry(); void _q_screenOrientationChanged(int); diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp index f94e0e5f4..d7aab6915 100644 --- a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp +++ b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp @@ -161,8 +161,10 @@ void QDeclarativeVideoOutput::setSource(QObject *source) if (source == m_source.data()) return; - if (m_source && m_sourceType == MediaObjectSource) + if (m_source && m_sourceType == MediaObjectSource) { disconnect(m_source.data(), 0, this, SLOT(_q_updateMediaObject())); + disconnect(m_source.data(), 0, this, SLOT(_q_updateCameraInfo())); + } if (m_backend) m_backend->releaseSource(); @@ -183,6 +185,20 @@ void QDeclarativeVideoOutput::setSource(QObject *source) Qt::DirectConnection, 0); } + + int deviceIdPropertyIndex = metaObject->indexOfProperty("deviceId"); + if (deviceIdPropertyIndex != -1) { // Camera source + const QMetaProperty deviceIdProperty = metaObject->property(deviceIdPropertyIndex); + + if (deviceIdProperty.hasNotifySignal()) { + QMetaMethod method = deviceIdProperty.notifySignal(); + QMetaObject::connect(m_source.data(), method.methodIndex(), + this, this->metaObject()->indexOfSlot("_q_updateCameraInfo()"), + Qt::DirectConnection, 0); + + } + } + m_sourceType = MediaObjectSource; } else if (metaObject->indexOfProperty("videoSurface") != -1) { // Make sure our backend is a QDeclarativeVideoRendererBackend @@ -269,25 +285,38 @@ void QDeclarativeVideoOutput::_q_updateMediaObject() m_mediaObject.clear(); m_service.clear(); - m_cameraInfo = QCameraInfo(); if (mediaObject) { if (QMediaService *service = mediaObject->service()) { if (createBackend(service)) { m_service = service; m_mediaObject = mediaObject; - const QCamera *camera = qobject_cast(mediaObject); - if (camera) { - m_cameraInfo = QCameraInfo(*camera); - - // The camera position and orientation need to be taken into account for - // the viewport auto orientation - if (m_autoOrientation) - _q_screenOrientationChanged(m_screenOrientationHandler->currentOrientation()); - } } } } + + _q_updateCameraInfo(); +} + +void QDeclarativeVideoOutput::_q_updateCameraInfo() +{ + if (m_mediaObject) { + const QCamera *camera = qobject_cast(m_mediaObject); + if (camera) { + QCameraInfo info(*camera); + + if (m_cameraInfo != info) { + m_cameraInfo = info; + + // The camera position and orientation need to be taken into account for + // the viewport auto orientation + if (m_autoOrientation) + _q_screenOrientationChanged(m_screenOrientationHandler->currentOrientation()); + } + } + } else { + m_cameraInfo = QCameraInfo(); + } } /*! -- cgit v1.2.3 From 9496d5fba5439bf4e4c1d80b5e5f76af82b89165 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 3 Dec 2014 16:28:48 +0100 Subject: OpenSL ES: volume support for QAudioInput. The OpenSL volume interface is not available for audio inputs on Android so we apply the volume ourselves on the PCM data. Task-number: QTBUG-42159 Change-Id: If43d8aa576bc70a925681f0db1ca8b40e71f7b29 Reviewed-by: Christian Stromme --- src/plugins/opensles/qopenslesaudioinput.cpp | 21 ++++++++++++++++----- src/plugins/opensles/qopenslesaudioinput.h | 1 + 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/plugins/opensles/qopenslesaudioinput.cpp b/src/plugins/opensles/qopenslesaudioinput.cpp index 181649ae0..30372059f 100644 --- a/src/plugins/opensles/qopenslesaudioinput.cpp +++ b/src/plugins/opensles/qopenslesaudioinput.cpp @@ -35,6 +35,7 @@ #include "qopenslesengine.h" #include +#include #include #ifdef ANDROID @@ -70,6 +71,7 @@ QOpenSLESAudioInput::QOpenSLESAudioInput(const QByteArray &device) , m_errorState(QAudio::NoError) , m_deviceState(QAudio::StoppedState) , m_lastNotifyTime(0) + , m_volume(1.0) , m_bufferSize(0) , m_periodSize(0) , m_intervalTime(1000) @@ -395,9 +397,19 @@ void QOpenSLESAudioInput::writeDataToDevice(const char *data, int size) { m_processedBytes += size; + QByteArray outData; + + // Apply volume + if (m_volume < 1.0f) { + outData.resize(size); + QAudioHelperInternal::qMultiplySamples(m_volume, m_format, data, outData.data(), size); + } else { + outData.append(data, size); + } + if (m_pullMode) { // write buffer to the QIODevice - if (m_audioSource->write(data, size) < 0) { + if (m_audioSource->write(outData) < 0) { stop(); m_errorState = QAudio::IOError; Q_EMIT errorChanged(m_errorState); @@ -405,7 +417,7 @@ void QOpenSLESAudioInput::writeDataToDevice(const char *data, int size) } else { // emits readyRead() so user will call read() on QIODevice to get some audio data if (m_bufferIODevice != 0) { - m_pushBuffer.append(data, size); + m_pushBuffer.append(outData); Q_EMIT m_bufferIODevice->readyRead(); } } @@ -478,13 +490,12 @@ qint64 QOpenSLESAudioInput::elapsedUSecs() const void QOpenSLESAudioInput::setVolume(qreal vol) { - // Volume interface is not available for the recorder on Android - Q_UNUSED(vol); + m_volume = vol; } qreal QOpenSLESAudioInput::volume() const { - return qreal(1.0); + return m_volume; } void QOpenSLESAudioInput::reset() diff --git a/src/plugins/opensles/qopenslesaudioinput.h b/src/plugins/opensles/qopenslesaudioinput.h index 481ff371a..7ffff0470 100644 --- a/src/plugins/opensles/qopenslesaudioinput.h +++ b/src/plugins/opensles/qopenslesaudioinput.h @@ -113,6 +113,7 @@ private: QAudio::State m_deviceState; QTime m_clockStamp; qint64 m_lastNotifyTime; + qreal m_volume; int m_bufferSize; int m_periodSize; int m_intervalTime; -- cgit v1.2.3 From 8b1ee1724071cc4bbe8cefe195e375ef583d9d7f Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 3 Dec 2014 18:44:55 +0100 Subject: Added 5.4.0 change file. Change-Id: I623b42d5f4f565ee7cf2d064e52609a99636bd6a Reviewed-by: Jani Heikkinen --- dist/changes-5.4.0 | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 dist/changes-5.4.0 diff --git a/dist/changes-5.4.0 b/dist/changes-5.4.0 new file mode 100644 index 000000000..543638e7b --- /dev/null +++ b/dist/changes-5.4.0 @@ -0,0 +1,111 @@ +Qt 5.4 introduces many new features and improvements as well as bugfixes +over the 5.3.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://qt-project.org/doc/qt-5.4 + +The Qt version 5.4 series is binary compatible with the 5.3.x series. +Applications compiled for 5.3 will continue to run with 5.4. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt-project.org/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + + - Using QAudioOutput and QSoundEffect with the PulseAudio backend won't + cause the system volume to be automatically changed to the maximum value + anymore. Audio streams will now respect the system-wide volume unless + explicitly set with setVolume(). + - On Linux, both Alsa and PulseAudio backends are now present. PulseAudio + is used by default if available on the system and if the server is + running, otherwise Alsa is used instead. + +**************************************************************************** +* Library * +**************************************************************************** + +QtMultimedia +------------ + + - Added new QAbstractPlanarVideoBuffer class. + + - Camera (QML): + * Added deviceId, displayName, position, orientation, metadata, + viewfinder.resolution, viewfinder.minimumFrameRate and + viewfinder.maximumFrameRate properties. + * Camera device can be selected by setting the deviceId or position + properties. + * + + - QtMultimedia global QML object: + * Added defaultCamera and availableCameras properties. + + - QAbstractVideoBuffer: + * Added mapPlanes() function. + + - QVideoFrame: + * Added support for planar video formats. New planeCount(), + bytesPerLine(int plane) and bits(int plane) functions. + + - [QTBUG-40515] Improved PLS parser. It is now more permissive, allowing + to load virtually any kind of PLS file. It also correctly resolve + relative paths. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Android +------- + + - Changing a media player's position after reaching the end of a media + now correctly works. + - [QTBUG-40314] Fixed playing a QMediaPlaylit with a QMediaPlayer. + +Linux +----- + + - Added support for QCameraInfo::position() and QCameraInfo::orientation(). + - Added support for QCameraFocus::customFocusPoint. + - QMediaRecorder::duration() now returns the correct value when recording + with a camera source. + - QMediaMetaData::ContributingArtist and QMediaMetaData::AlbumArtist + now map to the correct metadata. + - Fixed QMediaPlayer's metaDataAvailableChanged() signal, which was never + emitted. + +OS X +---- + + - OS X 10.6 not being supported anymore, the QuickTime backend has been + removed. + +QNX +--- + + - [QTBUG-40746] Fixed crash when detroying a QML VideoOutput or Video item. + +Windows +------- + + - [QTBUG-32481] Fixed various memory leaks when using a media player. + - [QTBUG-39980] Fixed crash occasionally happening when playing and + stopping repeatedly a media with QMediaPlayer. + - [QTBUG-40954] Buffers retrieved with QAudioProbe now have a correct + startTime(). + - [QTBUG-41158] Fixed crash occasionally happening when destroying a + QML MediaPlayer. + +WinRT +----- + + - Enabled media player support for WinRT. + - Enabled basic camera support for WinRT (viewfinder, still image capture + and camera device selection). -- cgit v1.2.3 From f420ac286a303bc235b8c1047f8c845314df1f8a Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Thu, 4 Dec 2014 14:45:43 +0100 Subject: GStreamer: better camera device name logic. Use the device ID for QCameraInfo::description() when the driver doesn't provide any display name. Change-Id: Iff1f17187ecb52262412f85db04d7108fae71717 Reviewed-by: Andrew den Exter --- src/gsttools/qgstutils.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gsttools/qgstutils.cpp b/src/gsttools/qgstutils.cpp index 556fc03cc..1281d3fc5 100644 --- a/src/gsttools/qgstutils.cpp +++ b/src/gsttools/qgstutils.cpp @@ -510,6 +510,8 @@ QVector QGstUtils::enumerateCameras(GstElementFactory *fa } else { driver = QByteArray((const char*)vcap.driver); name = QString::fromUtf8((const char*)vcap.card); + if (name.isEmpty()) + name = entryInfo.fileName(); } //qDebug() << "found camera: " << name; -- cgit v1.2.3 From 085362ab0f313f4e3947c39a008d801024f6f0b4 Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Thu, 4 Dec 2014 12:53:57 +0200 Subject: Remove private API use from video orientation handler The QPA header isn't needed anymore, as nativeOrientation was added as a QScreen property in 5.2. Change-Id: I7cd00feae769175fd0c4be65b503e74ee910814a Reviewed-by: Yoann Lopes --- src/multimedia/video/qvideooutputorientationhandler.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/multimedia/video/qvideooutputorientationhandler.cpp b/src/multimedia/video/qvideooutputorientationhandler.cpp index e6fa0a180..f50f8f451 100644 --- a/src/multimedia/video/qvideooutputorientationhandler.cpp +++ b/src/multimedia/video/qvideooutputorientationhandler.cpp @@ -35,7 +35,6 @@ #include #include -#include QT_BEGIN_NAMESPACE @@ -63,9 +62,8 @@ int QVideoOutputOrientationHandler::currentOrientation() const void QVideoOutputOrientationHandler::screenOrientationChanged(Qt::ScreenOrientation orientation) { const QScreen *screen = QGuiApplication::primaryScreen(); - const QPlatformScreen *platformScreen = screen->handle(); - const int angle = (360 - screen->angleBetween(platformScreen->nativeOrientation(), orientation)) % 360; + const int angle = (360 - screen->angleBetween(screen->nativeOrientation(), orientation)) % 360; if (angle == m_currentOrientation) return; -- cgit v1.2.3 From 2b181d546970d18a48a0f36f5d1a22418b61cd4d Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 9 Dec 2014 15:34:10 +0100 Subject: Make it compile with no-opengl Change-Id: I71358bb1268e5b28b66b1817a3ec0cd98459cfd2 Reviewed-by: Friedemann Kleint Reviewed-by: Yoann Lopes --- src/multimediawidgets/qpaintervideosurface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/multimediawidgets/qpaintervideosurface.cpp b/src/multimediawidgets/qpaintervideosurface.cpp index 3a880de2f..2ab5dcbf5 100644 --- a/src/multimediawidgets/qpaintervideosurface.cpp +++ b/src/multimediawidgets/qpaintervideosurface.cpp @@ -96,7 +96,9 @@ QVideoSurfaceGenericPainter::QVideoSurfaceGenericPainter() << QVideoFrame::Format_ARGB32 << QVideoFrame::Format_RGB565; // The raster formats should be a subset of the GL formats. +#ifndef QT_NO_OPENGL if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGLES) +#endif m_imagePixelFormats << QVideoFrame::Format_RGB24; } @@ -137,7 +139,9 @@ QAbstractVideoSurface::Error QVideoSurfaceGenericPainter::start(const QVideoSurf const QAbstractVideoBuffer::HandleType t = format.handleType(); if (t == QAbstractVideoBuffer::NoHandle) { bool ok = m_imageFormat != QImage::Format_Invalid && !m_imageSize.isEmpty(); +#ifndef QT_NO_OPENGL if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) +#endif ok &= format.pixelFormat() != QVideoFrame::Format_RGB24; if (ok) return QAbstractVideoSurface::NoError; -- cgit v1.2.3 From 791febc1d3bfc1ec39f4379214ec5fb473ddaeb5 Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Thu, 11 Dec 2014 09:48:52 +0200 Subject: winrt: Fix camera auto rotation There is no Windows Runtime API to find the camera sensor rotation, so assume that phones always have a camera mounting of 270 degrees. Tablet and webcams remain mounted at the default (0 degrees). As the frame is not flipped automatically by the system, the scan line direction is set to BottomToTop for front-facing cameras to achieve compatibility with other platforms. Task-number: QTBUG-41066 Change-Id: Icf17ecd4aca9fa9d5b24d94e5b21b63ee6f21f28 Reviewed-by: Oliver Wolff Reviewed-by: Yoann Lopes --- src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp | 10 ++++++++++ src/plugins/winrt/qwinrtabstractvideorenderercontrol.h | 3 +++ src/plugins/winrt/qwinrtcameracontrol.cpp | 3 +++ src/plugins/winrt/qwinrtvideodeviceselectorcontrol.cpp | 10 ++++++++++ 4 files changed, 26 insertions(+) diff --git a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp index 175fec1d5..be0436261 100644 --- a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp +++ b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp @@ -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); diff --git a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.h b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.h index 86a7b15f9..b06b18a2a 100644 --- a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.h +++ b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.h @@ -43,6 +43,7 @@ #define QWINRTABSTRACTVIDEORENDERERCONTROL_H #include +#include struct ID3D11Device; struct ID3D11Texture2D; @@ -63,6 +64,8 @@ public: QSize size() const; void setSize(const QSize &size); + void setScanLineDirection(QVideoSurfaceFormat::Direction direction); + void setActive(bool active); virtual bool render(ID3D11Texture2D *texture) = 0; diff --git a/src/plugins/winrt/qwinrtcameracontrol.cpp b/src/plugins/winrt/qwinrtcameracontrol.cpp index 619e97315..f4e57b438 100644 --- a/src/plugins/winrt/qwinrtcameracontrol.cpp +++ b/src/plugins/winrt/qwinrtcameracontrol.cpp @@ -677,6 +677,9 @@ HRESULT QWinRTCameraControl::initialize() return E_FAIL; } + if (d->videoDeviceSelector->cameraPosition(deviceName) == QCamera::FrontFace) + d->videoRenderer->setScanLineDirection(QVideoSurfaceFormat::BottomToTop); + ComPtr settings; hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Media_Capture_MediaCaptureInitializationSettings).Get(), &settings); diff --git a/src/plugins/winrt/qwinrtvideodeviceselectorcontrol.cpp b/src/plugins/winrt/qwinrtvideodeviceselectorcontrol.cpp index 8058c3dad..969ef6f30 100644 --- a/src/plugins/winrt/qwinrtvideodeviceselectorcontrol.cpp +++ b/src/plugins/winrt/qwinrtvideodeviceselectorcontrol.cpp @@ -337,7 +337,17 @@ QCamera::Position QWinRTVideoDeviceSelectorControl::cameraPosition(const QString int QWinRTVideoDeviceSelectorControl::cameraOrientation(const QString &deviceName) { +#ifdef Q_OS_WINPHONE + switch (cameraPosition(deviceName)) { + case QCamera::FrontFace: + case QCamera::BackFace: + return 270; + default: + break; + } +#else Q_UNUSED(deviceName); +#endif return 0; } -- cgit v1.2.3 From 1027215920ded41b0e381b0ab740fb8a75c66a62 Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Fri, 5 Dec 2014 10:26:32 +0200 Subject: winrt: Fix encoding properties These should match the capture mode. Additionally, there was a semantic error preventing the encoding properties from being properly selected. This fixes a bug in which the viewfinder was receiving frames too large for display as an OpenGL texture. Task-number: QTBUG-41065 Change-Id: Ia82c8f44bba1692a219edc5f9d78fc76c3d8a4ba Reviewed-by: Maurice Kalinowski --- src/plugins/winrt/qwinrtcameracontrol.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/plugins/winrt/qwinrtcameracontrol.cpp b/src/plugins/winrt/qwinrtcameracontrol.cpp index f4e57b438..3c51de5a4 100644 --- a/src/plugins/winrt/qwinrtcameracontrol.cpp +++ b/src/plugins/winrt/qwinrtcameracontrol.cpp @@ -711,7 +711,20 @@ HRESULT QWinRTCameraControl::initialize() hr = videoDeviceController.As(&deviceController); Q_ASSERT_SUCCEEDED(hr); ComPtr> encodingPropertiesList; - hr = deviceController->GetAvailableMediaStreamProperties(MediaStreamType_Photo, &encodingPropertiesList); + MediaStreamType mediaStreamType; + switch (d->captureMode) { + default: + case QCamera::CaptureViewfinder: + mediaStreamType = MediaStreamType_VideoPreview; + break; + case QCamera::CaptureStillImage: + mediaStreamType = MediaStreamType_Photo; + break; + case QCamera::CaptureVideo: + mediaStreamType = MediaStreamType_VideoRecord; + break; + } + hr = deviceController->GetAvailableMediaStreamProperties(mediaStreamType, &encodingPropertiesList); Q_ASSERT_SUCCEEDED(hr); d->size = QSize(); @@ -724,12 +737,12 @@ HRESULT QWinRTCameraControl::initialize() hr = encodingPropertiesList->GetAt(i, &properties); Q_ASSERT_SUCCEEDED(hr); ComPtr videoProperties; - hr = properties.As(&videoEncodingProperties); + hr = properties.As(&videoProperties); Q_ASSERT_SUCCEEDED(hr); UINT32 width, height; - hr = videoEncodingProperties->get_Width(&width); + hr = videoProperties->get_Width(&width); Q_ASSERT_SUCCEEDED(hr); - hr = videoEncodingProperties->get_Height(&height); + hr = videoProperties->get_Height(&height); Q_ASSERT_SUCCEEDED(hr); // Choose the highest-quality format if (int(width * height) > d->size.width() * d->size.height()) { -- cgit v1.2.3 From ce7b59c28d9298b86c9db34831eefde714a7108d Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Thu, 11 Dec 2014 10:52:18 +0200 Subject: winrt: Add missing QAbstractVideoSurface::stop() call. This was preventing the surface from restarting with a different format. Change-Id: I1f86ddb1b16618f167183c7e2fcb32658df578f3 Reviewed-by: Oliver Wolff --- src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp index be0436261..031a176fc 100644 --- a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp +++ b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -181,7 +182,7 @@ enum DirtyState { class QWinRTAbstractVideoRendererControlPrivate { public: - QAbstractVideoSurface *surface; + QPointer 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; @@ -340,6 +340,8 @@ void QWinRTAbstractVideoRendererControl::setActive(bool active) } d->renderThread.requestInterruption(); + if (d->surface && d->surface->isActive()) + d->surface->stop(); } void QWinRTAbstractVideoRendererControl::present() -- cgit v1.2.3 From cb0fb37b10589da0f7fbc2b0ed705ee8c77a1f1f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 12 Dec 2014 13:48:26 +0100 Subject: Bump version Change-Id: I7e93575a6e3767485e2a5430312e87527b2c9b2d --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 17a3a5783..ccd239ad1 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,4 +1,4 @@ load(qt_build_config) CONFIG += qt_example_installs -MODULE_VERSION = 5.4.0 +MODULE_VERSION = 5.4.1 -- cgit v1.2.3