From cdaaae4723518d7b29d8aa9f55e9cbfbae786b8e Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Tue, 20 Aug 2019 13:16:27 +0300 Subject: Add changes file for Qt 5.12.5 Change-Id: I282469f6c634283cec565b692b29b16cf0fdbea4 Reviewed-by: VaL Doroshchuk --- dist/changes-5.12.5 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 dist/changes-5.12.5 diff --git a/dist/changes-5.12.5 b/dist/changes-5.12.5 new file mode 100644 index 000000000..34cf7eed4 --- /dev/null +++ b/dist/changes-5.12.5 @@ -0,0 +1,35 @@ +Qt 5.12.5 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.0 through 5.12.4. + +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.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +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. + + - This release contains only minor code improvements. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +- GStreamer: + * Added "audio/x-raw" codec to use "audio/x-wav" container in QAudioRecorder. + * Fixed bug where a player, without its own video surface, would end up using + another players video surface. + * [QTBUG-65399] Added fix to prevent seeking to the beginning when playback + is started. + +- AVFoundation: + * [QTBUG-77270] Added fix to avoid showing black frames when the current + OpenGL context changes. -- cgit v1.2.1 From 012affe3194a48d8bb10d0a100f1d1bbb24ecf7e Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Tue, 27 Aug 2019 11:15:03 +0200 Subject: DirectShow: Fix crash when there is no surface on flush() When QDeclarativeRendererBackend is being destroyed, it clears the surface and postpones releasing IMediaControl, which is done on worker thread. It also calls flush() where null surface is used. Fixes: QTBUG-77829 Change-Id: I327583c1f8fb7585dbec3c3fb7e80d0155cc4819 Reviewed-by: Timur Pocheptsov --- src/plugins/common/evr/evrcustompresenter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/common/evr/evrcustompresenter.cpp b/src/plugins/common/evr/evrcustompresenter.cpp index 470f670e4..0265c431b 100644 --- a/src/plugins/common/evr/evrcustompresenter.cpp +++ b/src/plugins/common/evr/evrcustompresenter.cpp @@ -1143,7 +1143,7 @@ HRESULT EVRCustomPresenter::flush() sample->Release(); m_frameStep.samples.clear(); - if (m_renderState == RenderStopped && m_surface->isActive()) { + if (m_renderState == RenderStopped && m_surface && m_surface->isActive()) { // Repaint with black. presentSample(NULL); } -- cgit v1.2.1 From 94852a47c130c3dc265d900390bf0d7b53cbab3e Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Thu, 29 Aug 2019 12:46:33 +0200 Subject: DirectShow: Add startTime and endTime to QVideoFrame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the application seeks to a new position, the Media Session restarts the presentation clock at the specified seek time. The media source might deliver samples with a slightly earlier time stamp if the seek time does not fall on a key-frame boundary. And IMFSample->GetSampleTime will return time that is related to a position when the clock has been restarted, and can be also negative. So if it needs to have times from the beginning, it would require to add seeked position to times from IMFSample. It also reverts c4de056a6aa44567cdbf2ce91a464e597ad4af8f Fixes: QTBUG-77849 Change-Id: I1a7cb7bd18aee73087a61d2ed2c3d644ad0fbd50 Reviewed-by: Christian Strømme --- src/plugins/common/evr/evrcustompresenter.cpp | 15 +++++++++++++++ src/plugins/common/evr/evrcustompresenter.h | 4 ++++ src/plugins/common/evr/evrd3dpresentengine.cpp | 11 +++++++++++ src/plugins/directshow/player/directshowplayerservice.cpp | 3 +++ .../directshow/player/directshowvideorenderercontrol.cpp | 1 + .../directshow/player/directshowvideorenderercontrol.h | 1 + 6 files changed, 35 insertions(+) diff --git a/src/plugins/common/evr/evrcustompresenter.cpp b/src/plugins/common/evr/evrcustompresenter.cpp index 0265c431b..ca4b26ded 100644 --- a/src/plugins/common/evr/evrcustompresenter.cpp +++ b/src/plugins/common/evr/evrcustompresenter.cpp @@ -557,6 +557,7 @@ EVRCustomPresenter::EVRCustomPresenter(QAbstractVideoSurface *surface) , m_mediaType(0) , m_surface(0) , m_canRenderToSurface(false) + , m_positionOffset(0) { // Initial source rectangle = (0,0,1,1) m_sourceRect.top = 0; @@ -1930,6 +1931,15 @@ void EVRCustomPresenter::presentSample(IMFSample *sample) QVideoFrame frame = m_presentEngine->makeVideoFrame(sample); + // Since start/end times are related to a position when the clock is started, + // to have times from the beginning, need to adjust it by adding seeked position. + if (m_positionOffset) { + if (frame.startTime()) + frame.setStartTime(frame.startTime() + m_positionOffset); + if (frame.endTime()) + frame.setEndTime(frame.endTime() + m_positionOffset); + } + if (!m_surface->isActive() || m_surface->surfaceFormat() != m_presentEngine->videoSurfaceFormat()) { m_surface->stop(); if (!m_surface->start(m_presentEngine->videoSurfaceFormat())) @@ -1939,6 +1949,11 @@ void EVRCustomPresenter::presentSample(IMFSample *sample) m_surface->present(frame); } +void EVRCustomPresenter::positionChanged(qint64 position) +{ + m_positionOffset = position * 1000; +} + HRESULT setDesiredSampleTime(IMFSample *sample, const LONGLONG &sampleTime, const LONGLONG &duration) { if (!sample) diff --git a/src/plugins/common/evr/evrcustompresenter.h b/src/plugins/common/evr/evrcustompresenter.h index bd04bd952..9e1ee88d6 100644 --- a/src/plugins/common/evr/evrcustompresenter.h +++ b/src/plugins/common/evr/evrcustompresenter.h @@ -264,6 +264,9 @@ public: bool event(QEvent *) override; +public Q_SLOTS: + void positionChanged(qint64 position); + private: HRESULT checkShutdown() const { @@ -364,6 +367,7 @@ private: QAbstractVideoSurface *m_surface; bool m_canRenderToSurface; + qint64 m_positionOffset; // Seek position in microseconds. }; bool qt_evr_setCustomPresenter(IUnknown *evr, EVRCustomPresenter *presenter); diff --git a/src/plugins/common/evr/evrd3dpresentengine.cpp b/src/plugins/common/evr/evrd3dpresentengine.cpp index 4ce5a99d7..d8e2da6d3 100644 --- a/src/plugins/common/evr/evrd3dpresentengine.cpp +++ b/src/plugins/common/evr/evrd3dpresentengine.cpp @@ -593,6 +593,17 @@ QVideoFrame D3DPresentEngine::makeVideoFrame(IMFSample *sample) m_surfaceFormat.frameSize(), m_surfaceFormat.pixelFormat()); + // WMF uses 100-nanosecond units, Qt uses microseconds + LONGLONG startTime = 0; + auto hr = sample->GetSampleTime(&startTime); + if (SUCCEEDED(hr)) { + frame.setStartTime(startTime * 0.1); + + LONGLONG duration = -1; + if (SUCCEEDED(sample->GetSampleDuration(&duration))) + frame.setEndTime((startTime + duration) * 0.1); + } + return frame; } diff --git a/src/plugins/directshow/player/directshowplayerservice.cpp b/src/plugins/directshow/player/directshowplayerservice.cpp index 0d44da722..aed03f9de 100644 --- a/src/plugins/directshow/player/directshowplayerservice.cpp +++ b/src/plugins/directshow/player/directshowplayerservice.cpp @@ -1457,6 +1457,9 @@ void DirectShowPlayerService::customEvent(QEvent *event) if (m_playerControl->mediaStatus() == QMediaPlayer::EndOfMedia) m_playerControl->updateStatus(QMediaPlayer::LoadedMedia); m_playerControl->updatePosition(m_position); + // Emits only when seek has been performed. + if (m_videoRendererControl) + emit m_videoRendererControl->positionChanged(m_position); } else { QMediaService::customEvent(event); } diff --git a/src/plugins/directshow/player/directshowvideorenderercontrol.cpp b/src/plugins/directshow/player/directshowvideorenderercontrol.cpp index 88b5a51eb..bbf7cf8b9 100644 --- a/src/plugins/directshow/player/directshowvideorenderercontrol.cpp +++ b/src/plugins/directshow/player/directshowvideorenderercontrol.cpp @@ -101,6 +101,7 @@ void DirectShowVideoRendererControl::setSurface(QAbstractVideoSurface *surface) if (!qgetenv("QT_DIRECTSHOW_NO_EVR").toInt()) { m_filter = com_new(clsid_EnhancedVideoRenderer); m_evrPresenter = new EVRCustomPresenter(m_surface); + connect(this, &DirectShowVideoRendererControl::positionChanged, m_evrPresenter, &EVRCustomPresenter::positionChanged); if (!m_evrPresenter->isValid() || !qt_evr_setCustomPresenter(m_filter, m_evrPresenter)) { m_filter->Release(); m_filter = 0; diff --git a/src/plugins/directshow/player/directshowvideorenderercontrol.h b/src/plugins/directshow/player/directshowvideorenderercontrol.h index b2abeeaed..930f8a6b1 100644 --- a/src/plugins/directshow/player/directshowvideorenderercontrol.h +++ b/src/plugins/directshow/player/directshowvideorenderercontrol.h @@ -68,6 +68,7 @@ public: Q_SIGNALS: void filterChanged(); + void positionChanged(qint64 position); private: DirectShowEventLoop *m_loop; -- cgit v1.2.1