From c012f0a727144714f9480e98938ca8eb2137c213 Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Tue, 3 Mar 2020 15:10:32 +0200 Subject: Add changes file for Qt 5.14.2 + 1cc4b7e28bf9f8f684bf17ed30a822aa6d1c6735 Doc: Explain that the camera consumes power in Camera.LoadedState + 8427c0be1c262293b27c8bca598108cfe882c84e Doc: Fix QCamera and Camera docs + d63921355aacf5cbd5189ffdbe4d23b9ff318bee Android: Fix loading multimedia plugins + 5e0c4d2fa253922a86378b150852a0ca8bdabc0d Android: JNI_OnLoad return JNI_VERSION_1_6 instead of JNI_VERSION_1_4 + 2d54cb4f460f2665da64e551927e6dbf153c68c1 GStreamer: Don't create encoding profile if container is not supported + 265bfb22e7f0f5333e584f6dd91926b8516e394e AVF: Always lock the capture device when start the camera + daac69f2f9e9ff9be06484dbdc10d139e83ab502 Bump version + 545d4aedc2af40182cd9141d014a02f919592cd9 AVF: Don't use deprecated AVPlayerItem::seekToTime::CMTime + e47ed7b88223c42dd20ef86b829061fcc4f1fc30 AVF: Only resume playback after a stalled buffer if really needed + cbdf4561f5cdb6ee95583f14a3769c3124228586 Android: Flush qrc to tmp file with original name + 7e64b859b6a663f42ee3067930ef132d9e7d2901 Fix false pulse audio dependency of libQt5MultimediaWidgets + aec140743b1a4110c327c46bdfbf15fcddb2dd17 AVF: Fix applying viewfinder settings for iOS + ad3d2afae99506a779ad758f4e7385c9f0b163ba AVF: Don't override AVPlayerLayer's bounds if already set + 19b111fa2f872e8c356ca130ce5a03ae52375934 Android: Fix invalid use of incomplete type 'QDir' + 12460a14bde44d1ff7bedd75bc87c7f22d096588 WMF: Fix memory leak in MFPlayerSession::getStreamType Change-Id: I287736bbe400983bad3966caab675a9386e075d8 Reviewed-by: Paul Wicking --- dist/changes-5.14.2 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 dist/changes-5.14.2 diff --git a/dist/changes-5.14.2 b/dist/changes-5.14.2 new file mode 100644 index 000000000..ad36891cf --- /dev/null +++ b/dist/changes-5.14.2 @@ -0,0 +1,45 @@ +Qt 5.14.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.14.0 through 5.14.1. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.14 series is binary compatible with the 5.13.x series. +Applications compiled for 5.13 will continue to run with 5.14. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +- Android: + * [QTBUG-81006] Fixed issue when multimedia plugins were not loaded. + * [QTBUG-59517] Fixed to prevent multiple copies of one tmp file + when playing video from qrc. + +- GStreamer: + * [QTBUG-81075] Fixed creating incorrect encoding profile + to avoid errors when the media container is not supported + in the video recorder. + * Fixed to have separate resolution settings for capturing and + camera's viewfinder. + +- AVFoundation: + * [QTBUG-81048] Fixed applying viewfinder settings when starting the camera. + * [QTBUG-79935] Fixed applying viewfinder settings for iOS. + * [QTBUG-81804] Removed usage of deperecated AVPlayerItem::seekToTime::CMTime. + * [QTBUG-81912] Fixed to resume playback after a stalled buffer + only if it was already in playing state. + * [QTBUG-65536] Fixed to have proper size bounds when resizing the window + while playing video. + * [QTBUG-82542] Fixed content flickering on resize for video player. + * [QTBUG-82264] Fixed to use only video surface's supported pixel formats in Camera. -- cgit v1.2.3 From 060e2e7846441a65bfdab5cf0afea008b1bbb13f Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Wed, 4 Mar 2020 15:56:09 +0100 Subject: Skip all tst_QMediaPlayerBackend tests when there is no codec available Previously tst_QMediaPlayerBackend::isWavSupported() always returned true unless boot2q env, which is not correct. Since if there is no codec installed in CI (but it is not boot2qt), also need to skip the tests. Change-Id: Ib58864bb3648a3d8f6c99354034f4ad85d5e4f98 Fixes: QTBUG-82673 Reviewed-by: Asmo Saarela Reviewed-by: Friedemann Kleint Reviewed-by: Andy Shaw --- tests/auto/integration/qmediaplayerbackend/qmediaplayerbackend.pro | 2 -- .../auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp | 4 ---- 2 files changed, 6 deletions(-) diff --git a/tests/auto/integration/qmediaplayerbackend/qmediaplayerbackend.pro b/tests/auto/integration/qmediaplayerbackend/qmediaplayerbackend.pro index b9417f7c2..6dd1e8d62 100644 --- a/tests/auto/integration/qmediaplayerbackend/qmediaplayerbackend.pro +++ b/tests/auto/integration/qmediaplayerbackend/qmediaplayerbackend.pro @@ -15,8 +15,6 @@ HEADERS += \ TESTDATA += testdata/* boot2qt: { - # Yocto sysroot does not have gstreamer/wav - QMAKE_CXXFLAGS += -DWAV_SUPPORT_NOT_FORCED # OGV testing is unstable with qemu QMAKE_CXXFLAGS += -DSKIP_OGV_TEST } diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp index 9cd3b7fa9..af4e2c275 100644 --- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp +++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp @@ -177,11 +177,7 @@ QMediaContent tst_QMediaPlayerBackend::selectVideoFile(const QStringList& mediaC bool tst_QMediaPlayerBackend::isWavSupported() { -#ifdef WAV_SUPPORT_NOT_FORCED return !localWavFile.isNull(); -#else - return true; -#endif } void tst_QMediaPlayerBackend::initTestCase() -- cgit v1.2.3 From 9a4ec4b49601e25d7ac0fd4cfd3df47339ff3ddb Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Tue, 18 Feb 2020 11:16:17 +0100 Subject: PulseAudio: Discard buffer with outdated volume in QSoundEffect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the sample is ready, the volume is applied to it and written back to pulse's buffer. When the volume is changed again, need to discard buffer with outdated volume, and rewrite. Change-Id: I51a6ab3ee1a5c799643a43c5628439c2d659f9fc Fixes: QTBUG-79687 Reviewed-by: Andy Shaw Reviewed-by: Tor Arne Vestbø --- src/multimedia/audio/qsoundeffect_pulse_p.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp index 0855c1f67..51cdde026 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp @@ -528,6 +528,21 @@ qreal QSoundEffectPrivate::volume() const return m_volume; } +static void volume_stream_flush_callback(pa_stream *s, int success, void *userdata) +{ + Q_UNUSED(s); + QSoundEffectRef *ref = reinterpret_cast(userdata); + QSoundEffectPrivate *self = ref->soundEffect(); + ref->release(); + if (!self) + return; + + if (!success) + qWarning("QSoundEffect(pulseaudio): failed to drain"); + + QMetaObject::invokeMethod(self, "prepare", Qt::QueuedConnection); +} + void QSoundEffectPrivate::setVolume(qreal volume) { QMutexLocker locker(&m_volumeLock); @@ -537,6 +552,8 @@ void QSoundEffectPrivate::setVolume(qreal volume) m_volume = qBound(qreal(0), volume, qreal(1)); locker.unlock(); + if (!m_playing && m_pulseStream) + pa_stream_flush(m_pulseStream, volume_stream_flush_callback, m_ref->getRef()); emit volumeChanged(); } -- cgit v1.2.3 From cd6a109f6068ea74270cb47736b3e2259e4ace84 Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Fri, 30 Aug 2019 10:44:00 +0200 Subject: DirectShow: Round stop position down to available bytes in IAsyncReader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently requested IMediaSample might contain the end time that exceeds the available bytes which causes returning an error in WaitForNext() and stopping the playback. Regarding to IAsyncReader::Request documentation: The start and stop positions should match the alignment that was decided when the pins connected. The stop position might exceed the real duration. If so, the method rounds the stop position down to the actual alignment. Fixes: QTBUG-77782 Change-Id: I644e25bfc6bb8f6d345b8424b79fb56490d82c0e Reviewed-by: Timur Pocheptsov (cherry picked from commit 9e96fe2cbf79a44039de0edcc854050d84b87588) Reviewed-by: Tor Arne Vestbø --- src/plugins/directshow/player/directshowioreader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/directshow/player/directshowioreader.cpp b/src/plugins/directshow/player/directshowioreader.cpp index ced10ea10..3318d57b5 100644 --- a/src/plugins/directshow/player/directshowioreader.cpp +++ b/src/plugins/directshow/player/directshowioreader.cpp @@ -155,7 +155,7 @@ HRESULT DirectShowIOReader::Request(IMediaSample *pSample, DWORD_PTR dwUser) return VFW_E_SAMPLE_TIME_NOT_SET; } LONGLONG position = startTime / 10000000; - LONG length = (endTime - startTime) / 10000000; + LONG length = qMin((endTime - startTime) / 10000000, m_availableLength); auto request = new DirectShowSampleRequest(pSample, dwUser, position, length, buffer); -- cgit v1.2.3 From 42646fd2d1cfc03101cd1b14277b5462366fc2f7 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 18 Mar 2020 11:38:24 +0100 Subject: DirectShow: Handle QVideoFormat::BGR24 in bytesPerLine() Since we are mapping from MEDIASUBTYPE_RGB24 to QVideoFormat::BGR24 then we should make sure this returns the correct value from bytesPerLine. Change-Id: I8cc31d29a03bf2c1d7682de32448db0db9656cc7 Reviewed-by: VaL Doroshchuk --- src/plugins/directshow/common/directshowmediatype.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/directshow/common/directshowmediatype.cpp b/src/plugins/directshow/common/directshowmediatype.cpp index 103f1ddc1..37106586a 100644 --- a/src/plugins/directshow/common/directshowmediatype.cpp +++ b/src/plugins/directshow/common/directshowmediatype.cpp @@ -294,6 +294,7 @@ int DirectShowMediaType::bytesPerLine(const QVideoSurfaceFormat &format) return format.frameWidth() * 4; // 24 bpp packed formats. case QVideoFrame::Format_RGB24: + case QVideoFrame::Format_BGR24: return PAD_TO_DWORD(format.frameWidth() * 3); // 16 bpp packed formats. case QVideoFrame::Format_RGB565: -- cgit v1.2.3 From a8131f05b9b3290fa4888c617adbbb6253d2b410 Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Fri, 6 Mar 2020 13:05:03 +0100 Subject: Blacklist tst_QAudioOutput tests if it is running in CI Fixes: QTBUG-82683 Fixes: QTBUG-82684 Change-Id: I82387bf4685f96c77a6658a9f8360e89335ba23c Reviewed-by: Liang Qi --- tests/auto/integration/qaudiooutput/BLACKLIST | 3 +-- tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp | 14 -------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/tests/auto/integration/qaudiooutput/BLACKLIST b/tests/auto/integration/qaudiooutput/BLACKLIST index c83b30412..966b48af6 100644 --- a/tests/auto/integration/qaudiooutput/BLACKLIST +++ b/tests/auto/integration/qaudiooutput/BLACKLIST @@ -1,2 +1 @@ -[pullSuspendResume] -opensuse-42.3 +linux ci diff --git a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp index f3a676073..9943ffec2 100644 --- a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp +++ b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp @@ -116,8 +116,6 @@ private: QScopedPointer m_byteArray; QScopedPointer m_buffer; - - bool m_inCISystem; }; QString tst_QAudioOutput::formatToFileName(const QAudioFormat &format) @@ -190,9 +188,6 @@ void tst_QAudioOutput::generate_audiofile_testrows() QTest::newRow(QString("Audio File %1").arg(i).toLocal8Bit().constData()) << audioFiles.at(i) << testFormats.at(i); - // Only run first format in CI system to reduce test times - if (m_inCISystem) - break; } } @@ -278,7 +273,6 @@ void tst_QAudioOutput::initTestCase() file->close(); audioFiles.append(file); } - qgetenv("QT_TEST_CI").toInt(&m_inCISystem,10); } void tst_QAudioOutput::format() @@ -549,10 +543,6 @@ void tst_QAudioOutput::pull() void tst_QAudioOutput::pullSuspendResume() { -#ifdef Q_OS_LINUX - if (m_inCISystem) - QSKIP("QTBUG-26504 Fails 20% of time with pulseaudio backend"); -#endif QFETCH(FilePtr, audioFile); QFETCH(QAudioFormat, audioFormat); QAudioOutput audioOutput(audioFormat, this); @@ -726,10 +716,6 @@ void tst_QAudioOutput::push() void tst_QAudioOutput::pushSuspendResume() { -#ifdef Q_OS_LINUX - if (m_inCISystem) - QSKIP("QTBUG-26504 Fails 20% of time with pulseaudio backend"); -#endif QFETCH(FilePtr, audioFile); QFETCH(QAudioFormat, audioFormat); -- cgit v1.2.3 From 00ae18f986cadc4c888625fb63b2ca89da1f986f Mon Sep 17 00:00:00 2001 From: Ihor Dutchak Date: Sun, 8 Jul 2018 16:58:55 +0300 Subject: Add AVFCameraWindowControl as QVideoWindowControl_iid implementation AVFCameraWindowControl is a renderer backend, when QCamera viewfinder output set to QVideoWidget on macOS or iOS. As it uses native API and lets the OS handle rendering pipeline, it is an efficient alternative to default renderer backend. Task-number: QTBUG-68779 Change-Id: I4d27022655a7d9f4ad7cf99c84b570a0c48cf10a Reviewed-by: VaL Doroshchuk --- src/plugins/avfoundation/camera/avfcameraservice.h | 2 + .../avfoundation/camera/avfcameraservice.mm | 23 +- src/plugins/avfoundation/camera/avfcamerasession.h | 3 + .../avfoundation/camera/avfcamerasession.mm | 33 +++ .../avfoundation/camera/avfcamerawindowcontrol.h | 129 ++++++++++ .../avfoundation/camera/avfcamerawindowcontrol.mm | 262 +++++++++++++++++++++ src/plugins/avfoundation/camera/camera.pro | 6 +- 7 files changed, 455 insertions(+), 3 deletions(-) create mode 100644 src/plugins/avfoundation/camera/avfcamerawindowcontrol.h create mode 100644 src/plugins/avfoundation/camera/avfcamerawindowcontrol.mm diff --git a/src/plugins/avfoundation/camera/avfcameraservice.h b/src/plugins/avfoundation/camera/avfcameraservice.h index 2969882b0..ec2884217 100644 --- a/src/plugins/avfoundation/camera/avfcameraservice.h +++ b/src/plugins/avfoundation/camera/avfcameraservice.h @@ -70,6 +70,7 @@ class AVFMediaRecorderControlIOS; class AVFAudioEncoderSettingsControl; class AVFVideoEncoderSettingsControl; class AVFMediaContainerControl; +class AVFCameraWindowControl; class AVFCameraService : public QMediaService { @@ -120,6 +121,7 @@ private: AVFAudioEncoderSettingsControl *m_audioEncoderSettingsControl; AVFVideoEncoderSettingsControl *m_videoEncoderSettingsControl; AVFMediaContainerControl *m_mediaContainerControl; + AVFCameraWindowControl *m_captureWindowControl; }; QT_END_NAMESPACE diff --git a/src/plugins/avfoundation/camera/avfcameraservice.mm b/src/plugins/avfoundation/camera/avfcameraservice.mm index 33b4b72aa..627ecf67c 100644 --- a/src/plugins/avfoundation/camera/avfcameraservice.mm +++ b/src/plugins/avfoundation/camera/avfcameraservice.mm @@ -61,6 +61,7 @@ #include "avfaudioencodersettingscontrol.h" #include "avfvideoencodersettingscontrol.h" #include "avfmediacontainercontrol.h" +#include "avfcamerawindowcontrol.h" #ifdef Q_OS_IOS #include "avfcamerazoomcontrol.h" @@ -74,7 +75,8 @@ QT_USE_NAMESPACE AVFCameraService::AVFCameraService(QObject *parent): QMediaService(parent), - m_videoOutput(nullptr) + m_videoOutput(nullptr), + m_captureWindowControl(nullptr) { m_session = new AVFCameraSession(this); m_cameraControl = new AVFCameraControl(this); @@ -119,6 +121,12 @@ AVFCameraService::~AVFCameraService() delete m_recorderControl; #endif + if (m_captureWindowControl) { + m_session->setCapturePreviewOutput(nullptr); + delete m_captureWindowControl; + m_captureWindowControl = nullptr; + } + if (m_videoOutput) { m_session->setVideoOutput(nullptr); delete m_videoOutput; @@ -210,6 +218,14 @@ QMediaControl *AVFCameraService::requestControl(const char *name) return m_cameraZoomControl; #endif + if (!m_captureWindowControl) { + if (qstrcmp(name, QVideoWindowControl_iid) == 0) { + m_captureWindowControl = new AVFCameraWindowControl(this); + m_session->setCapturePreviewOutput(m_captureWindowControl); + return m_captureWindowControl; + } + } + if (!m_videoOutput) { if (qstrcmp(name, QVideoRendererControl_iid) == 0) m_videoOutput = new AVFCameraRendererControl(this); @@ -234,6 +250,11 @@ void AVFCameraService::releaseControl(QMediaControl *control) delete m_videoOutput; m_videoOutput = nullptr; } + else if (m_captureWindowControl == control) { + m_session->setCapturePreviewOutput(nullptr); + delete m_captureWindowControl; + m_captureWindowControl = nullptr; + } } diff --git a/src/plugins/avfoundation/camera/avfcamerasession.h b/src/plugins/avfoundation/camera/avfcamerasession.h index 103ec0e17..a449bb806 100644 --- a/src/plugins/avfoundation/camera/avfcamerasession.h +++ b/src/plugins/avfoundation/camera/avfcamerasession.h @@ -54,6 +54,7 @@ class AVFCameraControl; class AVFCameraService; class AVFCameraRendererControl; class AVFMediaVideoProbeControl; +class AVFCameraWindowControl; struct AVFCameraInfo { @@ -79,6 +80,7 @@ public: AVFCameraInfo activeCameraInfo() const { return m_activeCameraInfo; } void setVideoOutput(AVFCameraRendererControl *output); + void setCapturePreviewOutput(AVFCameraWindowControl *output); AVCaptureSession *captureSession() const { return m_captureSession; } AVCaptureDevice *videoCaptureDevice() const; @@ -122,6 +124,7 @@ private: AVFCameraService *m_service; AVFCameraRendererControl *m_videoOutput; + AVFCameraWindowControl *m_capturePreviewWindowOutput; QCamera::State m_state; bool m_active; diff --git a/src/plugins/avfoundation/camera/avfcamerasession.mm b/src/plugins/avfoundation/camera/avfcamerasession.mm index 3c5f8f09a..6ee9c2636 100644 --- a/src/plugins/avfoundation/camera/avfcamerasession.mm +++ b/src/plugins/avfoundation/camera/avfcamerasession.mm @@ -48,6 +48,7 @@ #include "avfcameraviewfindersettingscontrol.h" #include "avfimageencodercontrol.h" #include "avfcamerautility.h" +#include "avfcamerawindowcontrol.h" #include #include @@ -146,6 +147,7 @@ QList AVFCameraSession::m_cameraDevices; AVFCameraSession::AVFCameraSession(AVFCameraService *service, QObject *parent) : QObject(parent) , m_service(service) + , m_capturePreviewWindowOutput(nullptr) , m_state(QCamera::UnloadedState) , m_active(false) , m_videoInput(nil) @@ -160,6 +162,10 @@ AVFCameraSession::AVFCameraSession(AVFCameraService *service, QObject *parent) AVFCameraSession::~AVFCameraSession() { + if (m_capturePreviewWindowOutput) { + m_capturePreviewWindowOutput->setLayer(nil); + } + if (m_videoInput) { [m_captureSession removeInput:m_videoInput]; [m_videoInput release]; @@ -257,6 +263,29 @@ void AVFCameraSession::setVideoOutput(AVFCameraRendererControl *output) output->configureAVCaptureSession(this); } +void AVFCameraSession::setCapturePreviewOutput(AVFCameraWindowControl *output) +{ +#ifdef QT_DEBUG_AVF + qDebug() << Q_FUNC_INFO << output; +#endif + + if (m_capturePreviewWindowOutput == output) + return; + + if (m_capturePreviewWindowOutput) + m_capturePreviewWindowOutput->setLayer(nil); + + m_capturePreviewWindowOutput = output; + + if (m_capturePreviewWindowOutput) { + AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:m_captureSession]; + m_capturePreviewWindowOutput->setLayer(previewLayer); + if (AVFCameraViewfinderSettingsControl2 *vfControl = m_service->viewfinderSettingsControl2()) { + m_capturePreviewWindowOutput->setNativeSize(vfControl->viewfinderSettings().resolution()); + } + } +} + AVCaptureDevice *AVFCameraSession::videoCaptureDevice() const { if (m_videoInput) @@ -409,6 +438,10 @@ bool AVFCameraSession::applyViewfinderSettings() } vfControl->applySettings(vfSettings); + + if (m_capturePreviewWindowOutput) + m_capturePreviewWindowOutput->setNativeSize(vfControl->viewfinderSettings().resolution()); + return !vfSettings.isNull(); } diff --git a/src/plugins/avfoundation/camera/avfcamerawindowcontrol.h b/src/plugins/avfoundation/camera/avfcamerawindowcontrol.h new file mode 100644 index 000000000..d1a950e38 --- /dev/null +++ b/src/plugins/avfoundation/camera/avfcamerawindowcontrol.h @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef AVFCAMERAWINDOWCONTROL_H +#define AVFCAMERAWINDOWCONTROL_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +@class AVCaptureVideoPreviewLayer; +#if defined(Q_OS_MACOS) +@class NSView; +typedef NSView NativeView; +#else +@class UIView; +typedef UIView NativeView; +#endif + +QT_BEGIN_NAMESPACE + +class AVFCameraWindowControl : public QVideoWindowControl +{ + Q_OBJECT +public: + AVFCameraWindowControl(QObject *parent = nullptr); + virtual ~AVFCameraWindowControl() override; + + // QVideoWindowControl interface +public: + WId winId() const override; + void setWinId(WId id) override; + + QRect displayRect() const override; + void setDisplayRect(const QRect &rect) override; + + bool isFullScreen() const override; + void setFullScreen(bool fullScreen) override; + + void repaint() override; + + QSize nativeSize() const override; + + Qt::AspectRatioMode aspectRatioMode() const override; + void setAspectRatioMode(Qt::AspectRatioMode mode) override; + + int brightness() const override; + void setBrightness(int brightness) override; + + int contrast() const override; + void setContrast(int contrast) override; + + int hue() const override; + void setHue(int hue) override; + + int saturation() const override; + void setSaturation(int saturation) override; + + // AVF Camera implementation details + void setNativeSize(QSize size); + void setLayer(AVCaptureVideoPreviewLayer *capturePreviewLayer); + +private: + void updateAspectRatio(); + void updateCaptureLayerBounds(); + + void retainNativeLayer(); + void releaseNativeLayer(); + + void attachNativeLayer(); + void detachNativeLayer(); + + WId m_winId{0}; + QRect m_displayRect; + bool m_fullscreen{false}; + Qt::AspectRatioMode m_aspectRatioMode{Qt::IgnoreAspectRatio}; + QSize m_nativeSize; + AVCaptureVideoPreviewLayer *m_captureLayer{nullptr}; + NativeView *m_nativeView{nullptr}; +}; + +QT_END_NAMESPACE + +#endif // AVFCAMERAWINDOWCONTROL_H diff --git a/src/plugins/avfoundation/camera/avfcamerawindowcontrol.mm b/src/plugins/avfoundation/camera/avfcamerawindowcontrol.mm new file mode 100644 index 000000000..5154d0646 --- /dev/null +++ b/src/plugins/avfoundation/camera/avfcamerawindowcontrol.mm @@ -0,0 +1,262 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd and/or its subsidiary(-ies). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "avfcamerawindowcontrol.h" + +#import +#import + +#if QT_HAS_INCLUDE() +#import +#endif + +#if QT_HAS_INCLUDE() +#import +#endif + +QT_USE_NAMESPACE + +AVFCameraWindowControl::AVFCameraWindowControl(QObject *parent) + : QVideoWindowControl(parent) +{ + setObjectName(QStringLiteral("AVFCameraWindowControl")); +} + +AVFCameraWindowControl::~AVFCameraWindowControl() +{ + releaseNativeLayer(); +} + +WId AVFCameraWindowControl::winId() const +{ + return m_winId; +} + +void AVFCameraWindowControl::setWinId(WId id) +{ + if (m_winId == id) + return; + + m_winId = id; + + detachNativeLayer(); + m_nativeView = (NativeView*)m_winId; + attachNativeLayer(); +} + +QRect AVFCameraWindowControl::displayRect() const +{ + return m_displayRect; +} + +void AVFCameraWindowControl::setDisplayRect(const QRect &rect) +{ + if (m_displayRect != rect) { + m_displayRect = rect; + updateCaptureLayerBounds(); + } +} + +bool AVFCameraWindowControl::isFullScreen() const +{ + return m_fullscreen; +} + +void AVFCameraWindowControl::setFullScreen(bool fullscreen) +{ + if (m_fullscreen != fullscreen) { + m_fullscreen = fullscreen; + Q_EMIT fullScreenChanged(fullscreen); + } +} + +void AVFCameraWindowControl::repaint() +{ + if (m_captureLayer) + [m_captureLayer setNeedsDisplay]; +} + +QSize AVFCameraWindowControl::nativeSize() const +{ + return m_nativeSize; +} + +void AVFCameraWindowControl::setNativeSize(QSize size) +{ + if (m_nativeSize != size) { + m_nativeSize = size; + Q_EMIT nativeSizeChanged(); + } +} + +Qt::AspectRatioMode AVFCameraWindowControl::aspectRatioMode() const +{ + return m_aspectRatioMode; +} + +void AVFCameraWindowControl::setAspectRatioMode(Qt::AspectRatioMode mode) +{ + if (m_aspectRatioMode != mode) { + m_aspectRatioMode = mode; + updateAspectRatio(); + } +} + +int AVFCameraWindowControl::brightness() const +{ + return 0; +} + +void AVFCameraWindowControl::setBrightness(int brightness) +{ + if (0 != brightness) + qWarning("AVFCameraWindowControl doesn't support changing Brightness"); +} + +int AVFCameraWindowControl::contrast() const +{ + return 0; +} + +void AVFCameraWindowControl::setContrast(int contrast) +{ + if (0 != contrast) + qWarning("AVFCameraWindowControl doesn't support changing Contrast"); +} + +int AVFCameraWindowControl::hue() const +{ + return 0; +} + +void AVFCameraWindowControl::setHue(int hue) +{ + if (0 != hue) + qWarning("AVFCameraWindowControl doesn't support changing Hue"); +} + +int AVFCameraWindowControl::saturation() const +{ + return 0; +} + +void AVFCameraWindowControl::setSaturation(int saturation) +{ + if (0 != saturation) + qWarning("AVFCameraWindowControl doesn't support changing Saturation"); +} + +void AVFCameraWindowControl::setLayer(AVCaptureVideoPreviewLayer *capturePreviewLayer) +{ + if (m_captureLayer == capturePreviewLayer) + return; + + releaseNativeLayer(); + + m_captureLayer = capturePreviewLayer; + + if (m_captureLayer) + retainNativeLayer(); +} + +void AVFCameraWindowControl::updateAspectRatio() +{ + if (m_captureLayer) { + switch (m_aspectRatioMode) { + case Qt::IgnoreAspectRatio: + [m_captureLayer setVideoGravity:AVLayerVideoGravityResize]; + break; + case Qt::KeepAspectRatio: + [m_captureLayer setVideoGravity:AVLayerVideoGravityResizeAspect]; + break; + case Qt::KeepAspectRatioByExpanding: + [m_captureLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill]; + break; + default: + break; + } + } +} + +void AVFCameraWindowControl::updateCaptureLayerBounds() +{ + if (m_captureLayer && m_nativeView) { + [CATransaction begin]; + [CATransaction setDisableActions: YES]; // disable animation/flicks + m_captureLayer.frame = m_displayRect.toCGRect(); + [CATransaction commit]; + } +} + +void AVFCameraWindowControl::retainNativeLayer() +{ + [m_captureLayer retain]; + + updateAspectRatio(); + attachNativeLayer(); +} + +void AVFCameraWindowControl::releaseNativeLayer() +{ + if (m_captureLayer) { + detachNativeLayer(); + [m_captureLayer release]; + m_captureLayer = nullptr; + } +} + +void AVFCameraWindowControl::attachNativeLayer() +{ + if (m_captureLayer && m_nativeView) { +#if defined(Q_OS_MACOS) + m_nativeView.wantsLayer = YES; +#endif + CALayer *nativeLayer = m_nativeView.layer; + [nativeLayer addSublayer:m_captureLayer]; + updateCaptureLayerBounds(); + } +} + +void AVFCameraWindowControl::detachNativeLayer() +{ + if (m_captureLayer && m_nativeView) + [m_captureLayer removeFromSuperlayer]; +} + +#include "moc_avfcamerawindowcontrol.cpp" diff --git a/src/plugins/avfoundation/camera/camera.pro b/src/plugins/avfoundation/camera/camera.pro index 4b960ed5a..70caf7536 100644 --- a/src/plugins/avfoundation/camera/camera.pro +++ b/src/plugins/avfoundation/camera/camera.pro @@ -42,7 +42,8 @@ HEADERS += \ avfcameraflashcontrol.h \ avfvideoencodersettingscontrol.h \ avfmediacontainercontrol.h \ - avfaudioencodersettingscontrol.h + avfaudioencodersettingscontrol.h \ + avfcamerawindowcontrol.h OBJECTIVE_SOURCES += \ avfcameraserviceplugin.mm \ @@ -65,7 +66,8 @@ OBJECTIVE_SOURCES += \ avfcameraflashcontrol.mm \ avfvideoencodersettingscontrol.mm \ avfmediacontainercontrol.mm \ - avfaudioencodersettingscontrol.mm + avfaudioencodersettingscontrol.mm \ + avfcamerawindowcontrol.mm osx { -- cgit v1.2.3 From 2a888bc3fb72069e735faad42e8325f60a5d7412 Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Tue, 17 Mar 2020 12:44:38 +0100 Subject: tst_QMediaObject: Remove checking of expected elapsed time It is often failed on CI when no enough resources. Task-number: QTBUG-82582 Change-Id: Ibcddab73e6dfd24c3ab064ed8ea89843ebdc92ea Reviewed-by: Paul Wicking (cherry picked from commit d5d42a24b5b9d2079d584defac70aef1a1feadef) --- tests/auto/unit/qmediaobject/tst_qmediaobject.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp b/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp index bf8704162..f1d5cc327 100644 --- a/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp +++ b/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp @@ -297,10 +297,6 @@ void tst_QMediaObject::notifySignals() timer.start(); QTRY_COMPARE(spy.count(), count); - - qint64 elapsed = timer.elapsed(); - int expectedElapsed = count * interval * 3; // give it some margin of error - QVERIFY2(elapsed < expectedElapsed, QString("elapsed: %1, expected: %2").arg(elapsed).arg(expectedElapsed).toLocal8Bit().constData()); } void tst_QMediaObject::notifyInterval_data() -- cgit v1.2.3 From 46ac981d28240f93af02e4459d9ce02f294c2ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 23 Mar 2020 14:25:16 +0100 Subject: QNetworkReply: Fix use of deprecated error signal Update it to use the new errorOccurred Task-number: QTBUG-82605 Change-Id: Ia7f4f51917ac4694e54e47318cb477aa05c2929e Reviewed-by: Timur Pocheptsov Reviewed-by: VaL Doroshchuk --- src/multimedia/audio/qsamplecache_p.cpp | 2 +- src/multimedia/playback/qplaylistfileparser.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/multimedia/audio/qsamplecache_p.cpp b/src/multimedia/audio/qsamplecache_p.cpp index 8c4fdc210..b293946cc 100644 --- a/src/multimedia/audio/qsamplecache_p.cpp +++ b/src/multimedia/audio/qsamplecache_p.cpp @@ -397,7 +397,7 @@ void QSample::load() qDebug() << "QSample: load [" << m_url << "]"; #endif m_stream = m_parent->networkAccessManager().get(QNetworkRequest(m_url)); - connect(m_stream, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(decoderError())); + connect(m_stream, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), SLOT(decoderError())); m_waveDecoder = new QWaveDecoder(m_stream); connect(m_waveDecoder, SIGNAL(formatKnown()), SLOT(decoderReady())); connect(m_waveDecoder, SIGNAL(parsingError()), SLOT(decoderError())); diff --git a/src/multimedia/playback/qplaylistfileparser.cpp b/src/multimedia/playback/qplaylistfileparser.cpp index 9af447032..d3cd60476 100644 --- a/src/multimedia/playback/qplaylistfileparser.cpp +++ b/src/multimedia/playback/qplaylistfileparser.cpp @@ -552,7 +552,7 @@ void QPlaylistFileParser::start(const QNetworkRequest& request, const QString &m d->m_source.reset(d->m_mgr.get(request)); connect(d->m_source.data(), SIGNAL(readyRead()), this, SLOT(handleData())); connect(d->m_source.data(), SIGNAL(finished()), this, SLOT(handleData())); - connect(d->m_source.data(), SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(handleError())); + connect(d->m_source.data(), SIGNAL(errorOccurred(QNetworkReply::NetworkError)), this, SLOT(handleError())); if (url.isLocalFile()) d->handleData(); -- cgit v1.2.3 From 7f0503acb042d047682b432e68ed97b1644c3f59 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 30 Mar 2020 14:56:40 +0200 Subject: Remove deprecated QTextStream operators from examples Use '\n' instead. Task-number: QTBUG-82532 Change-Id: I01bf8cc3254469514cb0f56f3055b944bac578a2 Reviewed-by: Paul Wicking --- examples/multimedia/audiodecoder/audiodecoder.cpp | 24 +++++++++++------------ examples/multimedia/audiodecoder/main.cpp | 10 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/multimedia/audiodecoder/audiodecoder.cpp b/examples/multimedia/audiodecoder/audiodecoder.cpp index 86904f7c9..f812fd3b6 100644 --- a/examples/multimedia/audiodecoder/audiodecoder.cpp +++ b/examples/multimedia/audiodecoder/audiodecoder.cpp @@ -129,16 +129,16 @@ void AudioDecoder::error(QAudioDecoder::Error error) case QAudioDecoder::NoError: return; case QAudioDecoder::ResourceError: - m_cout << "Resource error" << endl; + m_cout << "Resource error\n"; break; case QAudioDecoder::FormatError: - m_cout << "Format error" << endl; + m_cout << "Format error\n"; break; case QAudioDecoder::AccessDeniedError: - m_cout << "Access denied error" << endl; + m_cout << "Access denied error\n"; break; case QAudioDecoder::ServiceMissingError: - m_cout << "Service missing error" << endl; + m_cout << "Service missing error\n"; break; } @@ -149,10 +149,10 @@ void AudioDecoder::stateChanged(QAudioDecoder::State newState) { switch (newState) { case QAudioDecoder::DecodingState: - m_cout << "Decoding..." << endl; + m_cout << "Decoding...\n"; break; case QAudioDecoder::StoppedState: - m_cout << "Decoding stopped" << endl; + m_cout << "Decoding stopped\n"; break; } } @@ -160,12 +160,12 @@ void AudioDecoder::stateChanged(QAudioDecoder::State newState) void AudioDecoder::finished() { if (!m_fileWriter.close()) - m_cout << "Failed to finilize output file" << endl; + m_cout << "Failed to finilize output file\n"; - m_cout << "Decoding finished" << endl; + m_cout << "Decoding finished\n"; if (m_isPlayback) { - m_cout << "Starting playback" << endl; + m_cout << "Starting playback\n"; m_soundEffect.setSource(QUrl::fromLocalFile(m_targetFilename)); m_soundEffect.play(); } else { @@ -176,7 +176,7 @@ void AudioDecoder::finished() void AudioDecoder::playbackStatusChanged() { if (m_soundEffect.status() == QSoundEffect::Error) { - m_cout << "Playback error" << endl; + m_cout << "Playback error\n"; emit done(); } } @@ -184,7 +184,7 @@ void AudioDecoder::playbackStatusChanged() void AudioDecoder::playingChanged() { if (!m_soundEffect.isPlaying()) { - m_cout << "Playback finished" << endl; + m_cout << "Playback finished\n"; if (m_isDelete) QFile::remove(m_targetFilename); emit done(); @@ -200,7 +200,7 @@ void AudioDecoder::updateProgress() progress = position / (qreal)duration; if (progress > m_progress + 0.1) { - m_cout << "Decoding progress: " << (int)(progress * 100.0) << "%" << endl; + m_cout << "Decoding progress: " << (int)(progress * 100.0) << "%\n"; m_progress = progress; } } diff --git a/examples/multimedia/audiodecoder/main.cpp b/examples/multimedia/audiodecoder/main.cpp index c0947b83f..9c536ef0a 100644 --- a/examples/multimedia/audiodecoder/main.cpp +++ b/examples/multimedia/audiodecoder/main.cpp @@ -63,10 +63,10 @@ int main(int argc, char *argv[]) QTextStream cout(stdout, QIODevice::WriteOnly); if (app.arguments().size() < 2) { - cout << "Usage: audiodecoder [-p] [-pd] SOURCEFILE [TARGETFILE]" << endl; - cout << "Set -p option if you want to play output file." << endl; - cout << "Set -pd option if you want to play output file and delete it after successful playback." << endl; - cout << "Default TARGETFILE name is \"out.wav\" in the same directory as the source file." << endl; + cout << "Usage: audiodecoder [-p] [-pd] SOURCEFILE [TARGETFILE]\n"; + cout << "Set -p option if you want to play output file.\n"; + cout << "Set -pd option if you want to play output file and delete it after successful playback.\n"; + cout << "Default TARGETFILE name is \"out.wav\" in the same directory as the source file.\n"; return 0; } @@ -85,7 +85,7 @@ int main(int argc, char *argv[]) int sourceFileIndex = (isPlayback || isDelete) ? 2 : 1; if (app.arguments().size() <= sourceFileIndex) { - cout << "Error: source filename is not specified." << endl; + cout << "Error: source filename is not specified.\n"; return 0; } sourceFile.setFile(app.arguments().at(sourceFileIndex)); -- cgit v1.2.3 From c39f90e01e51c9fbc8074993a38e7f9b16338dbb Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Mon, 6 Apr 2020 14:14:08 +0200 Subject: WMF: Fix memory leak in MFPlayerSession::getStreamType Receives a pointer to the IMFMediaTypeHandler interface. The caller must release the interface. Fixes: QTBUG-80037 Change-Id: I69682028a5deea256a79d5d067afe2e60e49c8c5 Reviewed-by: Andy Shaw --- src/plugins/wmf/player/mfplayersession.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/wmf/player/mfplayersession.cpp b/src/plugins/wmf/player/mfplayersession.cpp index 24bfda833..9761fd993 100644 --- a/src/plugins/wmf/player/mfplayersession.cpp +++ b/src/plugins/wmf/player/mfplayersession.cpp @@ -277,10 +277,13 @@ MFPlayerSession::MediaType MFPlayerSession::getStreamType(IMFStreamDescriptor *s if (!stream) return Unknown; - IMFMediaTypeHandler *typeHandler = NULL; - if (SUCCEEDED(stream->GetMediaTypeHandler(&typeHandler))) { + struct SafeRelease { + IMFMediaTypeHandler *ptr = nullptr; + ~SafeRelease() { if (ptr) ptr->Release(); } + } typeHandler; + if (SUCCEEDED(stream->GetMediaTypeHandler(&typeHandler.ptr))) { GUID guidMajorType; - if (SUCCEEDED(typeHandler->GetMajorType(&guidMajorType))) { + if (SUCCEEDED(typeHandler.ptr->GetMajorType(&guidMajorType))) { if (guidMajorType == MFMediaType_Audio) return Audio; else if (guidMajorType == MFMediaType_Video) @@ -288,9 +291,6 @@ MFPlayerSession::MediaType MFPlayerSession::getStreamType(IMFStreamDescriptor *s } } - if (typeHandler) - typeHandler->Release(); - return Unknown; } -- cgit v1.2.3 From 0721c05771e89364023309fa252d70bdfafab2b4 Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Tue, 7 Apr 2020 15:39:46 +0200 Subject: DirectShow: Use MEDIASUBTYPE_Y800 as QVideoFrame::Format_Y8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added MEDIASUBTYPE_Y800 with GUID: {30303859-0000-0010-8000-00AA00389B71} Fixes: QTBUG-83071 Change-Id: I2e51ae1d2ae62d4d4cd7f68eecc0605bdc8c7f3a Reviewed-by: Tor Arne Vestbø --- src/plugins/directshow/camera/dscamerasession.cpp | 9 +++++++-- src/plugins/directshow/common/directshowmediatype.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/plugins/directshow/camera/dscamerasession.cpp b/src/plugins/directshow/camera/dscamerasession.cpp index a0c120816..042052421 100644 --- a/src/plugins/directshow/camera/dscamerasession.cpp +++ b/src/plugins/directshow/camera/dscamerasession.cpp @@ -1147,9 +1147,14 @@ void DSCameraSession::updateSourceCapabilities() m_supportedViewfinderSettings.append(settings); m_supportedFormats.append(DirectShowMediaType(*pmt)); } - - + } else { + OLECHAR *guidString = nullptr; + StringFromCLSID(pmt->subtype, &guidString); + if (guidString) + qWarning() << "Unsupported media type:" << QString::fromWCharArray(guidString); + ::CoTaskMemFree(guidString); } + DirectShowMediaType::deleteType(pmt); } } diff --git a/src/plugins/directshow/common/directshowmediatype.cpp b/src/plugins/directshow/common/directshowmediatype.cpp index 37106586a..3429f4848 100644 --- a/src/plugins/directshow/common/directshowmediatype.cpp +++ b/src/plugins/directshow/common/directshowmediatype.cpp @@ -40,6 +40,11 @@ #include "directshowmediatype.h" #include "directshowglobal.h" +#include + +DEFINE_GUID(MEDIASUBTYPE_Y800, 0x30303859, 0x0000, 0x0010, 0x80, 0x00, + 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); + namespace { struct TypeLookup @@ -66,7 +71,8 @@ namespace { QVideoFrame::Format_NV12, MEDIASUBTYPE_NV12 }, { QVideoFrame::Format_YUV420P, MEDIASUBTYPE_IYUV }, { QVideoFrame::Format_YUV420P, MEDIASUBTYPE_I420 }, - { QVideoFrame::Format_Jpeg, MEDIASUBTYPE_MJPG } + { QVideoFrame::Format_Jpeg, MEDIASUBTYPE_MJPG }, + { QVideoFrame::Format_Y8, MEDIASUBTYPE_Y800 }, }; } -- cgit v1.2.3 From 7bd13d3f98a6f1f9cf7aed122fd2f301fbae9d62 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 8 Apr 2020 14:10:14 -0300 Subject: Fix clang warning about mixing || and | || was definitely wrong. Even | would be wrong. ../qmultimedia_common/../qmultimedia_common/mockcameraflashcontrol.h:62:22: warning: use of logical '||' with constant operand [-Wconstant-logical-operand] return (mode || (QCameraExposure::FlashAuto | QCameraExposure::FlashOff | QCameraExposure::FlashOn | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: Ibdc95e9af7bd456a94ecfffd1603e74da919abbc Reviewed-by: Sona Kurazyan --- tests/auto/unit/qmultimedia_common/mockcameraflashcontrol.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/unit/qmultimedia_common/mockcameraflashcontrol.h b/tests/auto/unit/qmultimedia_common/mockcameraflashcontrol.h index daa9f28b6..96e2ebc52 100644 --- a/tests/auto/unit/qmultimedia_common/mockcameraflashcontrol.h +++ b/tests/auto/unit/qmultimedia_common/mockcameraflashcontrol.h @@ -59,9 +59,9 @@ public: bool isFlashModeSupported(QCameraExposure::FlashModes mode) const { - return (mode || (QCameraExposure::FlashAuto | QCameraExposure::FlashOff | QCameraExposure::FlashOn | - QCameraExposure::FlashFill |QCameraExposure::FlashTorch |QCameraExposure::FlashSlowSyncFrontCurtain | - QCameraExposure::FlashRedEyeReduction)); + return (mode & (QCameraExposure::FlashAuto | QCameraExposure::FlashOff | QCameraExposure::FlashOn | + QCameraExposure::FlashFill |QCameraExposure::FlashTorch |QCameraExposure::FlashSlowSyncFrontCurtain | + QCameraExposure::FlashRedEyeReduction)); } bool isFlashReady() const -- cgit v1.2.3 From 19f6faf671438dc9c5165733a1b060fe2dfe1956 Mon Sep 17 00:00:00 2001 From: Stef Boerrigter Date: Mon, 16 Mar 2020 09:09:46 +0100 Subject: GSTVideoRender: Update viewport on gst video buffer crop metadata If the video buffer contains crop metadata update a viewport for the video frame format. Fixes: QTBUG-82448 Change-Id: Iace150c6c03b48662cc9f0112b45fbe6401d6061 Reviewed-by: VaL Doroshchuk --- src/gsttools/qgstvideorenderersink.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gsttools/qgstvideorenderersink.cpp b/src/gsttools/qgstvideorenderersink.cpp index 3b458a978..13edcb820 100644 --- a/src/gsttools/qgstvideorenderersink.cpp +++ b/src/gsttools/qgstvideorenderersink.cpp @@ -141,6 +141,19 @@ bool QGstDefaultVideoRenderer::present(QAbstractVideoSurface *surface, GstBuffer if (!videoBuffer) videoBuffer = new QGstVideoBuffer(buffer, m_videoInfo); + auto meta = gst_buffer_get_video_crop_meta (buffer); + if (meta) { + QRect vp(meta->x, meta->y, meta->width, meta->height); + if (m_format.viewport() != vp) { +#ifdef DEBUG_VIDEO_SURFACE_SINK + qDebug() << Q_FUNC_INFO << " Update viewport on Metadata: [" << meta->height << "x" << meta->width << " | " << meta->x << "x" << meta->y << "]"; +#endif + //Update viewport if data is not the same + m_format.setViewport(vp); + surface->start(m_format); + } + } + QVideoFrame frame( videoBuffer, m_format.frameSize(), -- cgit v1.2.3 From af4db375440d3a0bff5e6ea479da6ff4b0a8da6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 24 Mar 2020 09:58:47 +0100 Subject: Update connect to QSocketNotifier::activated The int-overload will in some cases truncate the descriptor. So it's being replaced. Task-number: QTBUG-70441 Change-Id: Iffee2c8b544e6d329d02c0afea6aa9db9de38ea4 Reviewed-by: VaL Doroshchuk --- src/plugins/qnx-audio/audio/qnxaudioinput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qnx-audio/audio/qnxaudioinput.cpp b/src/plugins/qnx-audio/audio/qnxaudioinput.cpp index 70b83390c..9fca8a7e1 100644 --- a/src/plugins/qnx-audio/audio/qnxaudioinput.cpp +++ b/src/plugins/qnx-audio/audio/qnxaudioinput.cpp @@ -331,7 +331,7 @@ bool QnxAudioInput::open() m_pcmNotifier = new QSocketNotifier(snd_pcm_file_descriptor(m_pcmHandle, SND_PCM_CHANNEL_CAPTURE), QSocketNotifier::Read, this); - connect(m_pcmNotifier, SIGNAL(activated(int)), SLOT(userFeed())); + connect(m_pcmNotifier, SIGNAL(activated(QSocketDescriptor)), SLOT(userFeed())); return true; } -- cgit v1.2.3 From b8525df9434d34f24c488848e320d1bc77de49cd Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Thu, 2 Apr 2020 14:34:50 +0200 Subject: GStreamer: Remove file when CaptureToBuffer is used Capturing the image is handled by camerabin and it saves the image to a file. And we wanted to remove the file if capturing to buffer is requested, but the file is kept and not removed. Change-Id: I21404fc160bf275325deebf0f00b588de3493ee1 Fixes: QTBUG-82572 Reviewed-by: Andy Shaw --- src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp index 52ec75f44..b164bc31a 100644 --- a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp @@ -366,12 +366,9 @@ bool CameraBinImageCapture::processBusMessage(const QGstreamerMessage &message) #ifdef DEBUG_CAPTURE qDebug() << Q_FUNC_INFO << "Dropped saving file" << fileName; #endif - //camerabin creates an empty file when captured buffer is dropped, - //let's remove it QFileInfo info(QString::fromUtf8(fileName)); - if (info.exists() && info.isFile() && info.size() == 0) { + if (info.exists() && info.isFile()) QFile(info.absoluteFilePath()).remove(); - } } } } -- cgit v1.2.3 From d8d072417b08dd75734b3f0aa86c3a49db934770 Mon Sep 17 00:00:00 2001 From: Roman Valov Date: Mon, 13 Apr 2020 12:54:09 +0000 Subject: Gstreamer: fix stream buffering Gstreamer client should handle GST_MESSAGE_BUFFERING to play and pause streams based on buffer-percent value and Qt does it properly. However `updateSessionState` of QGstreamerPlayerControl was implemented to go back into playing state each time session state becomes paused. That behavior resulted into choppy stream playback. Fix with condition to un-pause playback only if it's already buffered. Fixes: QTBUG-83417 Change-Id: Ida4a9e2e196de00050bdc64725fa818c7e939785 Reviewed-by: VaL Doroshchuk --- src/gsttools/qgstreamerplayercontrol.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gsttools/qgstreamerplayercontrol.cpp b/src/gsttools/qgstreamerplayercontrol.cpp index 165978288..d65102e2f 100644 --- a/src/gsttools/qgstreamerplayercontrol.cpp +++ b/src/gsttools/qgstreamerplayercontrol.cpp @@ -439,8 +439,10 @@ void QGstreamerPlayerControl::updateSessionState(QMediaPlayer::State state) } m_pendingSeekPosition = -1; - if (m_currentState == QMediaPlayer::PlayingState) - m_session->play(); + if (m_currentState == QMediaPlayer::PlayingState) { + if (m_mediaStatus == QMediaPlayer::BufferedMedia) + m_session->play(); + } } updateMediaStatus(); -- cgit v1.2.3 From 5e9db9c117309e84adc5dba32f59a05760867558 Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Fri, 17 Apr 2020 10:05:39 +0300 Subject: Add changes file for Qt 5.15.0 Change-Id: I702f45ee8ab811b068ccde6de13cb754544e93e7 Reviewed-by: Paul Wicking --- dist/changes-5.15.0 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 dist/changes-5.15.0 diff --git a/dist/changes-5.15.0 b/dist/changes-5.15.0 new file mode 100644 index 000000000..d4a42d60c --- /dev/null +++ b/dist/changes-5.15.0 @@ -0,0 +1,57 @@ +Qt 5.15 introduces many new features and improvements as well as bugfixes +over the 5.14.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.15 series is binary compatible with the 5.14.x series. +Applications compiled for 5.14 will continue to run with 5.15. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Deprecation Notice * +**************************************************************************** + + - Functions taking or returning QNetworkConfiguration have been + deprecated. + - QCamera::error() (the signal) is deprecated; superseded by + errorOccurred() + - Camera::error() signal is deprecated in favor of errorOccurred(). + - [QTBUG-75943] QMediaService and QMediaControl classes are now + deprecated. + +**************************************************************************** +* Qt 5.15.0 Changes * +**************************************************************************** + + - Introduced QVideoFrame::image() to return an image based on the frame. + - [QTBUG-80431] Introduced videoSurface property to QVideoWidget, + QGraphicsVideoItem and QDeclarativeVideoOutput. + - [QTBUG-80431] Introduced QVideoWidget::videoSurface(), + QGraphicsVideoItem::videoSurface(), QDeclarativeVideoOutput::videoSurface(). + - [QTBUG-32939] Introduced rendering to multiple surfaces. + - [QTBUG-32939] Introduced MediaPlayer::videoOutput property. + - [QTBUG-81902] Removed usage of QGL* APIs. + - [QTBUG-82299] Added flushMode to Video QML element. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +- GStreamer: + * Added watching for zoom and max-zoom property changes in CameraBin. + * Introduced reverse playback. + +- AVFoundation: + * Added watching for QAbstractVideoSurface::supportedFormatsChanged + in the media player to enable gl if the surface starts to support it. + * [QTBUG-69101] Introduced adoption of AVAssetResourceLoaderDelegate protocol. + * [QTBUG-68779] Added QVideoWindowControl implementation, now it is used + by default for QVideoWidget instead of QVideoWidgetControl. -- cgit v1.2.3 From c3b9a8a6bc2a3dc3907f1cc349a7279916b599a4 Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Fri, 3 Apr 2020 15:23:12 +0200 Subject: WindowsAudio: Send stateChanged when QAudioOutput::reset() is called Fixes: QTBUG-83240 Change-Id: Iaa01ee4553f4c0c4d9a1ad829e65b40f13d3847d Reviewed-by: Andy Shaw --- src/plugins/windowsaudio/qwindowsaudiooutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp index 1182647fc..6ccffc8b2 100644 --- a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp +++ b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp @@ -630,7 +630,7 @@ qreal QWindowsAudioOutput::volume() const void QWindowsAudioOutput::reset() { - close(); + stop(); } OutputPrivate::OutputPrivate(QWindowsAudioOutput* audio) -- cgit v1.2.3 From 3ce4b38a7c6711ea378a56baec84b73da55a9c84 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 21 Apr 2020 09:00:49 -0700 Subject: Fix warning about QNetworkConfiguration being deprecated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's going away in Qt 6.0. Task-number: QTBUG-83692 Change-Id: I9709abb1c3734e10a7defffd1607e1160da1e75c Reviewed-by: Mårten Nordheim --- src/multimedia/playback/qmediaplayer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index 3773cfe64..276914ae1 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -731,6 +731,8 @@ void QMediaPlayer::setPlaylist(QMediaPlaylist *playlist) setMedia(m); } +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED /*! \obsolete @@ -747,6 +749,7 @@ void QMediaPlayer::setNetworkConfigurations(const QList & if (d->networkAccessControl) d->networkAccessControl->setConfigurations(configurations); } +QT_WARNING_POP QMediaPlayer::State QMediaPlayer::state() const { @@ -872,6 +875,8 @@ QString QMediaPlayer::errorString() const return d_func()->errorString; } +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED /*! \obsolete @@ -889,6 +894,8 @@ QNetworkConfiguration QMediaPlayer::currentNetworkConfiguration() const return QNetworkConfiguration(); } +QT_WARNING_POP + //public Q_SLOTS: /*! -- cgit v1.2.3 From 5edb1597cf71cebbffb3d05f975cf55702c53abd Mon Sep 17 00:00:00 2001 From: Marius Kittler Date: Sun, 29 Dec 2019 00:39:46 +0100 Subject: Fix case of header file includes for building with mingw-w64 Change-Id: Ie0e6599234c38c5e5a75b681a911f3728871861e Reviewed-by: Thiago Macieira --- config.tests/wshellitem/main.cpp | 2 +- src/plugins/directshow/player/directshowmetadatacontrol.cpp | 2 +- src/plugins/winrt/qwinrtcameracontrol.cpp | 2 +- src/plugins/wmf/player/mfplayersession.cpp | 2 +- src/plugins/wmf/player/mftvideo.cpp | 2 +- src/plugins/wmf/sourceresolver.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config.tests/wshellitem/main.cpp b/config.tests/wshellitem/main.cpp index 799ee5556..459992b77 100644 --- a/config.tests/wshellitem/main.cpp +++ b/config.tests/wshellitem/main.cpp @@ -26,7 +26,7 @@ ** ****************************************************************************/ -#include +#include int main(int, char**) { diff --git a/src/plugins/directshow/player/directshowmetadatacontrol.cpp b/src/plugins/directshow/player/directshowmetadatacontrol.cpp index 46674143e..d9864870a 100644 --- a/src/plugins/directshow/player/directshowmetadatacontrol.cpp +++ b/src/plugins/directshow/player/directshowmetadatacontrol.cpp @@ -64,7 +64,7 @@ #endif #if QT_CONFIG(wshellitem) -#include +#include #include #include diff --git a/src/plugins/winrt/qwinrtcameracontrol.cpp b/src/plugins/winrt/qwinrtcameracontrol.cpp index ede3f6b04..98dd7c2f7 100644 --- a/src/plugins/winrt/qwinrtcameracontrol.cpp +++ b/src/plugins/winrt/qwinrtcameracontrol.cpp @@ -54,7 +54,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/plugins/wmf/player/mfplayersession.cpp b/src/plugins/wmf/player/mfplayersession.cpp index 9761fd993..1d145edc4 100644 --- a/src/plugins/wmf/player/mfplayersession.cpp +++ b/src/plugins/wmf/player/mfplayersession.cpp @@ -56,7 +56,7 @@ #include "mfplayersession.h" #include "mfplayerservice.h" #include "mfmetadatacontrol.h" -#include +#include #include #include "sourceresolver.h" #include "samplegrabber.h" diff --git a/src/plugins/wmf/player/mftvideo.cpp b/src/plugins/wmf/player/mftvideo.cpp index 879911d55..9dce654f2 100644 --- a/src/plugins/wmf/player/mftvideo.cpp +++ b/src/plugins/wmf/player/mftvideo.cpp @@ -40,7 +40,7 @@ #include "mftvideo.h" #include "mfvideoprobecontrol.h" #include -#include +#include #include #include #include diff --git a/src/plugins/wmf/sourceresolver.cpp b/src/plugins/wmf/sourceresolver.cpp index c6f4e8566..15ef6f0ab 100644 --- a/src/plugins/wmf/sourceresolver.cpp +++ b/src/plugins/wmf/sourceresolver.cpp @@ -39,7 +39,7 @@ #include "mfstream.h" #include "sourceresolver.h" -#include +#include #include #include #include -- cgit v1.2.3 From 24a2c57e23fdee0c22b4f957b3b29ddb754b2699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 24 Apr 2020 19:01:17 +0200 Subject: Suppress QMediaNetworkAccessControl related deprecation warnings Change-Id: Ifb64b01463115f81b2edc4e486a3b0f52197e2a1 Reviewed-by: VaL Doroshchuk --- src/multimedia/playback/qmediaplayer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index 3773cfe64..12c84f0f6 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -133,7 +133,10 @@ public: QPointer videoOutput; QMediaPlaylist *playlist; +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED QMediaNetworkAccessControl *networkAccessControl; +QT_WARNING_POP QVideoSurfaceOutput surfaceOutput; QMediaContent qrcMedia; QScopedPointer qrcFile; @@ -599,7 +602,10 @@ QMediaPlayer::QMediaPlayer(QObject *parent, QMediaPlayer::Flags flags): d->error = ServiceMissingError; } else { d->control = qobject_cast(d->service->requestControl(QMediaPlayerControl_iid)); +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED d->networkAccessControl = qobject_cast(d->service->requestControl(QMediaNetworkAccessControl_iid)); +QT_WARNING_POP if (d->control != nullptr) { connect(d->control, SIGNAL(mediaChanged(QMediaContent)), SLOT(_q_handleMediaChanged(QMediaContent))); connect(d->control, SIGNAL(stateChanged(QMediaPlayer::State)), SLOT(_q_stateChanged(QMediaPlayer::State))); @@ -644,8 +650,11 @@ QMediaPlayer::QMediaPlayer(QObject *parent, QMediaPlayer::Flags flags): } } if (d->networkAccessControl != nullptr) { +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED connect(d->networkAccessControl, &QMediaNetworkAccessControl::configurationChanged, this, &QMediaPlayer::networkConfigurationChanged); +QT_WARNING_POP } } } -- cgit v1.2.3 From 516448c651507fc18210108efd68bf6103c570e0 Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Wed, 6 May 2020 14:28:20 +0200 Subject: GStreamer: Fix reverse playback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each gstreamer plugin is responsible for supporting reverse playback and also might require different start/stop types (GST_SEEK_TYPE_SET, GST_SEEK_TYPE_NONE, GST_SEEK_TYPE_END). Some plugins do not support it at all, e.g. wavparse. if rate > 0: change rate from current position to duration. else: change rate from current position to 0. Fixed also seeking with a negative rate. This should work for mp3 or some video formats too. Fixes: QTBUG-83945 Change-Id: I10a98186b9bc63d908667944aa4459da9e63e343 Reviewed-by: Tor Arne Vestbø --- src/gsttools/qgstreamerplayersession.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gsttools/qgstreamerplayersession.cpp b/src/gsttools/qgstreamerplayersession.cpp index c6d2df810..f7f3b7ca1 100644 --- a/src/gsttools/qgstreamerplayersession.cpp +++ b/src/gsttools/qgstreamerplayersession.cpp @@ -494,10 +494,12 @@ void QGstreamerPlayerSession::setPlaybackRate(qreal rate) if (!qFuzzyCompare(m_playbackRate, rate)) { m_playbackRate = rate; if (m_pipeline && m_seekable) { + qint64 from = rate > 0 ? position() : 0; + qint64 to = rate > 0 ? duration() : position(); gst_element_seek(m_pipeline, rate, GST_FORMAT_TIME, GstSeekFlags(GST_SEEK_FLAG_FLUSH), - GST_SEEK_TYPE_NONE,0, - GST_SEEK_TYPE_END, 0); + GST_SEEK_TYPE_SET, from * 1000000, + GST_SEEK_TYPE_SET, to * 1000000); } emit playbackRateChanged(m_playbackRate); } @@ -1078,15 +1080,13 @@ bool QGstreamerPlayerSession::seek(qint64 ms) //seek locks when the video output sink is changing and pad is blocked if (m_pipeline && !m_pendingVideoSink && m_state != QMediaPlayer::StoppedState && m_seekable) { ms = qMax(ms,qint64(0)); - gint64 position = ms * 1000000; - bool isSeeking = gst_element_seek(m_pipeline, - m_playbackRate, - GST_FORMAT_TIME, + qint64 from = m_playbackRate > 0 ? ms : 0; + qint64 to = m_playbackRate > 0 ? duration() : ms; + + bool isSeeking = gst_element_seek(m_pipeline, m_playbackRate, GST_FORMAT_TIME, GstSeekFlags(GST_SEEK_FLAG_FLUSH), - GST_SEEK_TYPE_SET, - position, - GST_SEEK_TYPE_NONE, - 0); + GST_SEEK_TYPE_SET, from * 1000000, + GST_SEEK_TYPE_SET, to * 1000000); if (isSeeking) m_lastPosition = ms; -- cgit v1.2.3 From f48e16dc45cde8f634823c40aa573b18673cf13d Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Mon, 4 May 2020 11:56:22 +0200 Subject: Vivante: Keep only one frame The imx6 vivante implementation of videonode used by qtvideosink holds reference to two frames during rendering. It releases the first frame only when it receives the third frame. This makes jerky playback when frames are not coming at constant rate. It displays the previous frame during video playback. Change-Id: If306bdcd358fac46a1fd0000ccb068424aee813a Reviewed-by: Karim Pinter Reviewed-by: Andy Shaw --- src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp | 10 +++------- src/plugins/videonode/imx6/qsgvivantevideomaterial.h | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp b/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp index e1468fe34..e8371d766 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp +++ b/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp @@ -107,7 +107,7 @@ void QSGVivanteVideoMaterial::updateBlending() { void QSGVivanteVideoMaterial::setCurrentFrame(const QVideoFrame &frame, QSGVideoNode::FrameFlags flags) { QMutexLocker lock(&mFrameMutex); - mNextFrame = frame; + mCurrentFrame = frame; mMappable = mMapError == GL_NO_ERROR && !flags.testFlag(QSGVideoNode::FrameFiltered); #ifdef QT_VIVANTE_VIDEO_DEBUG @@ -124,12 +124,8 @@ void QSGVivanteVideoMaterial::bind() } QMutexLocker lock(&mFrameMutex); - if (mNextFrame.isValid()) { - mCurrentFrame.unmap(); - - mCurrentFrame = mNextFrame; - mCurrentTexture = vivanteMapping(mNextFrame); - } + if (mCurrentFrame.isValid()) + mCurrentTexture = vivanteMapping(mCurrentFrame); else glBindTexture(GL_TEXTURE_2D, mCurrentTexture); } diff --git a/src/plugins/videonode/imx6/qsgvivantevideomaterial.h b/src/plugins/videonode/imx6/qsgvivantevideomaterial.h index adbd960a4..db59e8fc7 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideomaterial.h +++ b/src/plugins/videonode/imx6/qsgvivantevideomaterial.h @@ -78,7 +78,7 @@ private: QVideoFrame::PixelFormat mFormat; QMap mBitsToTextureMap; - QVideoFrame mCurrentFrame, mNextFrame; + QVideoFrame mCurrentFrame; GLuint mCurrentTexture; bool mMappable; GLenum mMapError = GL_NO_ERROR; -- cgit v1.2.3 From 541440649aac5488a8cb44f0c867095b18405c49 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 7 May 2020 20:35:42 +0200 Subject: Remove QRadioTuner from index page It got deprecated in f1648c837b606cb Change-Id: I3f99a5373b0641f15e62ec4270e89c582e451fdb Reviewed-by: VaL Doroshchuk (cherry picked from commit c95aa0e1836f230b2ba3158c65d0767223dd1937) Reviewed-by: Qt Cherry-pick Bot --- src/multimedia/doc/src/qtmultimedia-index.qdoc | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/multimedia/doc/src/qtmultimedia-index.qdoc b/src/multimedia/doc/src/qtmultimedia-index.qdoc index c2734f4a9..abd6a62cc 100644 --- a/src/multimedia/doc/src/qtmultimedia-index.qdoc +++ b/src/multimedia/doc/src/qtmultimedia-index.qdoc @@ -131,9 +131,6 @@ \row \li QMediaPlaylist \li List of media to be played. - \row - \li QRadioTuner - \li Access radio device. \row \li QAbstractVideoSurface \li Base class for video presentation. -- cgit v1.2.3