diff options
-rw-r--r-- | dist/changes-5.12.5 | 35 | ||||
-rw-r--r-- | src/plugins/common/evr/evrcustompresenter.cpp | 17 | ||||
-rw-r--r-- | src/plugins/common/evr/evrcustompresenter.h | 4 | ||||
-rw-r--r-- | src/plugins/common/evr/evrd3dpresentengine.cpp | 11 | ||||
-rw-r--r-- | src/plugins/directshow/player/directshowplayerservice.cpp | 3 | ||||
-rw-r--r-- | src/plugins/directshow/player/directshowvideorenderercontrol.cpp | 1 | ||||
-rw-r--r-- | src/plugins/directshow/player/directshowvideorenderercontrol.h | 1 |
7 files changed, 71 insertions, 1 deletions
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. diff --git a/src/plugins/common/evr/evrcustompresenter.cpp b/src/plugins/common/evr/evrcustompresenter.cpp index 84786e9a9..2bc761c45 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; @@ -1143,7 +1144,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); } @@ -1932,6 +1933,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())) @@ -1941,6 +1951,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 f5249e191..def18be74 100644 --- a/src/plugins/directshow/player/directshowplayerservice.cpp +++ b/src/plugins/directshow/player/directshowplayerservice.cpp @@ -1460,6 +1460,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<IBaseFilter>(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; |