From fdf2f673701fec9c3b99ad5e602d771c0b5ab9c9 Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Fri, 23 Aug 2019 14:50:30 +0200 Subject: Fix deprecation condition for QMediaResource Decided to update only docs that the class is obsolete. QT_DEPRECATED_SINCE is not needed. Also due to deprecation warnings (produced e.g. by Q_DECLARE_METATYPE), QT_DEPRECATED_X is not used. NOTE, QMediaResource will be removed from Qt 6 Change-Id: I24c6b58f90315880839dd137cab3108809a63760 Reviewed-by: Andy Shaw --- src/multimedia/playback/qmediaresource.cpp | 4 ---- src/multimedia/playback/qmediaresource.h | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/multimedia/playback/qmediaresource.cpp b/src/multimedia/playback/qmediaresource.cpp index 181b37525..97d42bd0b 100644 --- a/src/multimedia/playback/qmediaresource.cpp +++ b/src/multimedia/playback/qmediaresource.cpp @@ -39,8 +39,6 @@ #include "qmediaresource.h" -#if QT_DEPRECATED_SINCE(6, 0) - #include #include #include @@ -420,5 +418,3 @@ void QMediaResource::setResolution(int width, int height) values.remove(Resolution); } QT_END_NAMESPACE - -#endif // #if QT_DEPRECATED_SINCE(6, 0) diff --git a/src/multimedia/playback/qmediaresource.h b/src/multimedia/playback/qmediaresource.h index 8cded3128..9740166c6 100644 --- a/src/multimedia/playback/qmediaresource.h +++ b/src/multimedia/playback/qmediaresource.h @@ -46,8 +46,6 @@ #include -#if QT_DEPRECATED_SINCE(6, 0) - QT_BEGIN_NAMESPACE // Class forward declaration required for QDoc bug @@ -126,6 +124,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QMediaResource) Q_DECLARE_METATYPE(QMediaResourceList) -#endif // #if QT_DEPRECATED_SINCE(6, 0) - #endif -- cgit v1.2.3 From bf6ac0f0df5510aa65ecd9bb050bd13d47089d4a Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Tue, 24 Sep 2019 12:25:29 +0200 Subject: Move QVideoFrame::Format_ABGR32 to the end of the Pixel Formats Since ABGR32 was introduced in 5.13.0 but placed in the middle of the list, which breaks enum values. [ChangeLog] In Qt 5.13.0 binary compatibility was broken for usage of the enum QVideoFrame::PixelFormat by introducing QVideoFrame::Format_ABGR32. To minimize the impact of this, the break has been reverted, thus introducing a binary compatibility break with earlier Qt 5.13.x versions, but restoring compatibility with all earlier versions of Qt 5. Change-Id: I3c490f2fc30f3b6914306b2d496724f12729338e Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/multimedia/video/qvideoframe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multimedia/video/qvideoframe.h b/src/multimedia/video/qvideoframe.h index 375f80dac..206658bc5 100644 --- a/src/multimedia/video/qvideoframe.h +++ b/src/multimedia/video/qvideoframe.h @@ -75,7 +75,6 @@ public: Format_ARGB8565_Premultiplied, Format_BGRA32, Format_BGRA32_Premultiplied, - Format_ABGR32, Format_BGR32, Format_BGR24, Format_BGR565, @@ -102,6 +101,7 @@ public: Format_CameraRaw, Format_AdobeDng, + Format_ABGR32, // ### Qt 6: reorder #ifndef Q_QDOC NPixelFormats, -- cgit v1.2.3 From d34c71a67c9a30ab67da0b6ad11c198bfe2b242d Mon Sep 17 00:00:00 2001 From: Ratchanan Srirattanamet Date: Wed, 25 Sep 2019 16:12:18 +0700 Subject: CameraBin: do fetch viewfinder settings even after LoadedStatus Commit 84d0d87699a2a92b3207beae30a52f25e23acb65 (CameraBin: Postpone fetching supported viewfinder settings) checks if the camera is in LoadedStatus before fetching supported viewfinder settings. However, if viewfinder settings is never requested or not (yet) available during LoadedStatus, it won't try to fetch it at e.g. ActiveStatus. In that case, requesting supported viewfinder settings never works. [ChangeLog][CameraBin] CameraBin plugin now fetches supported viewfinder settings at status higher or equal to LoadedStatus if it has not been fetched. Change-Id: Ibd32c25feac9b1a133945e754d26181937190a24 Reviewed-by: VaL Doroshchuk --- src/plugins/gstreamer/camerabin/camerabinsession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp index f064c7c92..b96ba6792 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp @@ -732,7 +732,7 @@ static QList capsToViewfinderSettings(GstCaps *suppor QList CameraBinSession::supportedViewfinderSettings() const { - if (m_status == QCamera::LoadedStatus && m_supportedViewfinderSettings.isEmpty()) { + if (m_status >= QCamera::LoadedStatus && m_supportedViewfinderSettings.isEmpty()) { m_supportedViewfinderSettings = capsToViewfinderSettings(supportedCaps(QCamera::CaptureViewfinder)); } -- cgit v1.2.3 From 5323fcef6cfcaa14ff6a7f53c546020d523f8186 Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Wed, 11 Sep 2019 15:00:03 +0200 Subject: DirectShow: Implement QMediaVideoProbeControl->flush Need to flush when at least one frame is probed and stop is called, EOS or QMediaPlayer is destroyed. Fixes BFAIL : tst_QMediaPlayerBackend::probes() '(probeHandler.isVideoFlushCalled)' returned FALSE. () Task-number: QTBUG-46368 Change-Id: I09ebd6608c9a1b8a0a0707d83200d75ddb435734 Reviewed-by: Ville Voutilainen --- .../directshow/common/directshowvideoprobecontrol.cpp | 12 ++++++++++++ src/plugins/directshow/common/directshowvideoprobecontrol.h | 3 +++ src/plugins/directshow/player/directshowplayerservice.cpp | 9 ++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/plugins/directshow/common/directshowvideoprobecontrol.cpp b/src/plugins/directshow/common/directshowvideoprobecontrol.cpp index 5ec1ff064..0e2e68864 100644 --- a/src/plugins/directshow/common/directshowvideoprobecontrol.cpp +++ b/src/plugins/directshow/common/directshowvideoprobecontrol.cpp @@ -54,4 +54,16 @@ DirectShowVideoProbeControl::~DirectShowVideoProbeControl() qCWarning(qtDirectShowPlugin, "QVideoProbe control destroyed while it's still being referenced!!!"); } +void DirectShowVideoProbeControl::probeVideoFrame(const QVideoFrame &frame) +{ + emit videoFrameProbed(frame); + m_frameProbed = true; +} + +void DirectShowVideoProbeControl::flushVideoFrame() +{ + if (m_frameProbed) + emit flush(); +} + QT_END_NAMESPACE diff --git a/src/plugins/directshow/common/directshowvideoprobecontrol.h b/src/plugins/directshow/common/directshowvideoprobecontrol.h index 458263234..57839f8d3 100644 --- a/src/plugins/directshow/common/directshowvideoprobecontrol.h +++ b/src/plugins/directshow/common/directshowvideoprobecontrol.h @@ -55,8 +55,11 @@ public: bool ref() { return m_ref.ref(); } bool deref() { return m_ref.deref(); } + void probeVideoFrame(const QVideoFrame &frame); + void flushVideoFrame(); private: QAtomicInt m_ref; + bool m_frameProbed = false; }; QT_END_NAMESPACE diff --git a/src/plugins/directshow/player/directshowplayerservice.cpp b/src/plugins/directshow/player/directshowplayerservice.cpp index f5899cb6a..ed131f0bd 100644 --- a/src/plugins/directshow/player/directshowplayerservice.cpp +++ b/src/plugins/directshow/player/directshowplayerservice.cpp @@ -646,6 +646,9 @@ void DirectShowPlayerService::doFinalizeLoad(QMutexLocker *locker) void DirectShowPlayerService::releaseGraph() { + if (m_videoProbeControl) + m_videoProbeControl->flushVideoFrame(); + if (m_graph) { if (m_executingTask != 0) { // {8E1C39A1-DE53-11cf-AA63-0080C744528D} @@ -1023,6 +1026,8 @@ void DirectShowPlayerService::stop() if ((m_executingTask | m_executedTasks) & (Play | Pause | Seek)) { m_pendingTasks |= Stop; + if (m_videoProbeControl) + m_videoProbeControl->flushVideoFrame(); ::SetEvent(m_taskHandle); @@ -1455,6 +1460,8 @@ void DirectShowPlayerService::customEvent(QEvent *event) m_playerControl->updateState(QMediaPlayer::StoppedState); m_playerControl->updateStatus(QMediaPlayer::EndOfMedia); m_playerControl->updatePosition(m_position); + if (m_videoProbeControl) + m_videoProbeControl->flushVideoFrame(); } } else if (event->type() == QEvent::Type(PositionChange)) { QMutexLocker locker(&m_mutex); @@ -1563,7 +1570,7 @@ void DirectShowPlayerService::onVideoBufferAvailable(double time, const QByteArr size, format); - Q_EMIT m_videoProbeControl->videoFrameProbed(frame); + m_videoProbeControl->probeVideoFrame(frame); } QT_WARNING_POP -- cgit v1.2.3 From 5155d1afb36a44a3916cce1abf124c67f9cb4700 Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Fri, 13 Sep 2019 14:43:57 +0200 Subject: DirectShow: Fix tst_QMediaPlayerBackend::surfaceTest YVU formats are likely not supported by the codecs and the pipeline will not be negotiated in this case. Fixes BFAIL : tst_QMediaPlayerBackend::surfaceTest(YVU formats) 'surface.m_totalFrames >= 25' returned FALSE. (Expected >= 25, got 0) Task-number: QTBUG-46368 Change-Id: I6bf1a5822481a018549fe58aaf5fe79c79ff8456 Reviewed-by: Ville Voutilainen --- .../auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp index 25430a189..9d29025c8 100644 --- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp +++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp @@ -39,6 +39,8 @@ #include "../shared/mediafileselector.h" //TESTED_COMPONENT=src/multimedia +#include + QT_USE_NAMESPACE /* @@ -1357,8 +1359,10 @@ void tst_QMediaPlayerBackend::surfaceTest_data() QTest::newRow("RGB formats") << formatsRGB; +#if !QT_CONFIG(directshow) QTest::newRow("YVU formats") << formatsYUV; +#endif QTest::newRow("RGB & YUV formats") << formatsRGB + formatsYUV; -- cgit v1.2.3 From 4444e735104c7db108af99e0ad5c09a445ae9060 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Thu, 19 Sep 2019 15:02:09 +0200 Subject: QGstreamerPlayerSession: build list of debug strings only once Change-Id: I9aab0c5c20f97bc45fa26cc3a0faf6cf10c916d2 Reviewed-by: VaL Doroshchuk --- src/gsttools/qgstreamerplayersession.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gsttools/qgstreamerplayersession.cpp b/src/gsttools/qgstreamerplayersession.cpp index 2d1814a9d..1a74de574 100644 --- a/src/gsttools/qgstreamerplayersession.cpp +++ b/src/gsttools/qgstreamerplayersession.cpp @@ -1142,10 +1142,10 @@ bool QGstreamerPlayerSession::processBusMessage(const QGstreamerMessage &message gst_message_parse_state_changed(gm, &oldState, &newState, &pending); #ifdef DEBUG_PLAYBIN - QStringList states; - states << QStringLiteral("GST_STATE_VOID_PENDING") << QStringLiteral("GST_STATE_NULL") - << QStringLiteral("GST_STATE_READY") << QStringLiteral("GST_STATE_PAUSED") - << QStringLiteral("GST_STATE_PLAYING"); + static QStringList states = { + QStringLiteral("GST_STATE_VOID_PENDING"), QStringLiteral("GST_STATE_NULL"), + QStringLiteral("GST_STATE_READY"), QStringLiteral("GST_STATE_PAUSED"), + QStringLiteral("GST_STATE_PLAYING") }; qDebug() << QStringLiteral("state changed: old: %1 new: %2 pending: %3") \ .arg(states[oldState]) \ -- cgit v1.2.3 From 545959e45ec86c70617f4839d20d931297c30c20 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Thu, 19 Sep 2019 15:07:32 +0200 Subject: GstreamerPlayerControl: use new style connect syntax Change-Id: I2fc8d9c8b951092498f11a4a31c6c890df9d7495 Reviewed-by: VaL Doroshchuk --- src/gsttools/qgstreamerplayercontrol.cpp | 48 ++++++++++++-------------------- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/src/gsttools/qgstreamerplayercontrol.cpp b/src/gsttools/qgstreamerplayercontrol.cpp index 9c7aa3102..7c96b682f 100644 --- a/src/gsttools/qgstreamerplayercontrol.cpp +++ b/src/gsttools/qgstreamerplayercontrol.cpp @@ -64,39 +64,27 @@ QGstreamerPlayerControl::QGstreamerPlayerControl(QGstreamerPlayerSession *sessio m_resources = QMediaResourcePolicy::createResourceSet(); Q_ASSERT(m_resources); - connect(m_session, SIGNAL(positionChanged(qint64)), - this, SIGNAL(positionChanged(qint64))); - connect(m_session, SIGNAL(durationChanged(qint64)), - this, SIGNAL(durationChanged(qint64))); - connect(m_session, SIGNAL(mutedStateChanged(bool)), - this, SIGNAL(mutedChanged(bool))); - connect(m_session, SIGNAL(volumeChanged(int)), - this, SIGNAL(volumeChanged(int))); - connect(m_session, SIGNAL(stateChanged(QMediaPlayer::State)), - this, SLOT(updateSessionState(QMediaPlayer::State))); - connect(m_session,SIGNAL(bufferingProgressChanged(int)), - this, SLOT(setBufferProgress(int))); - connect(m_session, SIGNAL(playbackFinished()), - this, SLOT(processEOS())); - connect(m_session, SIGNAL(audioAvailableChanged(bool)), - this, SIGNAL(audioAvailableChanged(bool))); - connect(m_session, SIGNAL(videoAvailableChanged(bool)), - this, SIGNAL(videoAvailableChanged(bool))); - connect(m_session, SIGNAL(seekableChanged(bool)), - this, SIGNAL(seekableChanged(bool))); - connect(m_session, SIGNAL(error(int,QString)), - this, SIGNAL(error(int,QString))); - connect(m_session, SIGNAL(invalidMedia()), - this, SLOT(handleInvalidMedia())); - connect(m_session, SIGNAL(playbackRateChanged(qreal)), - this, SIGNAL(playbackRateChanged(qreal))); - - connect(m_resources, SIGNAL(resourcesGranted()), SLOT(handleResourcesGranted())); + connect(m_session, &QGstreamerPlayerSession::positionChanged, this, &QGstreamerPlayerControl::positionChanged); + connect(m_session, &QGstreamerPlayerSession::durationChanged, this, &QGstreamerPlayerControl::durationChanged); + connect(m_session, &QGstreamerPlayerSession::mutedStateChanged, this, &QGstreamerPlayerControl::mutedChanged); + connect(m_session, &QGstreamerPlayerSession::volumeChanged, this, &QGstreamerPlayerControl::volumeChanged); + connect(m_session, &QGstreamerPlayerSession::stateChanged, this, &QGstreamerPlayerControl::updateSessionState); + connect(m_session, &QGstreamerPlayerSession::bufferingProgressChanged, this, &QGstreamerPlayerControl::setBufferProgress); + connect(m_session, &QGstreamerPlayerSession::playbackFinished, this, &QGstreamerPlayerControl::processEOS); + connect(m_session, &QGstreamerPlayerSession::audioAvailableChanged, this, &QGstreamerPlayerControl::audioAvailableChanged); + connect(m_session, &QGstreamerPlayerSession::videoAvailableChanged, this, &QGstreamerPlayerControl::videoAvailableChanged); + connect(m_session, &QGstreamerPlayerSession::seekableChanged, this, &QGstreamerPlayerControl::seekableChanged); + connect(m_session, &QGstreamerPlayerSession::error, this, &QGstreamerPlayerControl::error); + connect(m_session, &QGstreamerPlayerSession::invalidMedia, this, &QGstreamerPlayerControl::handleInvalidMedia); + connect(m_session, &QGstreamerPlayerSession::playbackRateChanged, this, &QGstreamerPlayerControl::playbackRateChanged); + + connect(m_resources, &QMediaPlayerResourceSetInterface::resourcesGranted, this, &QGstreamerPlayerControl::handleResourcesGranted); //denied signal should be queued to have correct state update process, //since in playOrPause, when acquire is call on resource set, it may trigger a resourcesDenied signal immediately, //so handleResourcesDenied should be processed later, otherwise it will be overwritten by state update later in playOrPause. - connect(m_resources, SIGNAL(resourcesDenied()), this, SLOT(handleResourcesDenied()), Qt::QueuedConnection); - connect(m_resources, SIGNAL(resourcesLost()), SLOT(handleResourcesLost())); + connect(m_resources, &QMediaPlayerResourceSetInterface::resourcesDenied, + this, &QGstreamerPlayerControl::handleResourcesDenied, Qt::QueuedConnection); + connect(m_resources, &QMediaPlayerResourceSetInterface::resourcesLost, this, &QGstreamerPlayerControl::handleResourcesLost); } QGstreamerPlayerControl::~QGstreamerPlayerControl() -- cgit v1.2.3