From 67a826716a9a58659f7272cbce3c450af384da5a Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Mon, 5 Nov 2018 09:26:18 +0100 Subject: Windows: Repaint QVideoWidget when WM_PAINT or WM_ERASEBKGND received Since updates are disabled, and no paint events will be sent to QVideoWidget, need to somehow repaint the video window. When BeginPaint is called outside of the expose event, the window might not be refreshed. So moved calling the repainting within the expose event. Also added repainting when the display rect is changed to immediate refreshing. Task-number: QTBUG-71326 Change-Id: I7c29b3f8ad35e33590c7b138a5141546ce3c1a42 Reviewed-by: Oliver Wolff Reviewed-by: Christian Stromme --- src/plugins/common/evr/evrvideowindowcontrol.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/plugins/common/evr') diff --git a/src/plugins/common/evr/evrvideowindowcontrol.cpp b/src/plugins/common/evr/evrvideowindowcontrol.cpp index ce837c553..95f63c2e7 100644 --- a/src/plugins/common/evr/evrvideowindowcontrol.cpp +++ b/src/plugins/common/evr/evrvideowindowcontrol.cpp @@ -158,6 +158,9 @@ void EvrVideoWindowControl::setDisplayRect(const QRect &rect) } else { m_displayControl->SetVideoPosition(NULL, &displayRect); } + + // To refresh content immediately. + repaint(); } } -- cgit v1.2.1 From a9889e9e853b2b0e9b3736a258c908fa7559b35c Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Thu, 29 Nov 2018 11:52:51 +0100 Subject: DirectShow: Restart not active surface when frame is received If playback is not stopped but EndOfMedia is received, it would be still possible to seek to previous position and start playback again which will cause empty video output because the surface has been already stopped and should be restarted. Task-number: QTBUG-42057 Change-Id: I5ca496ba3af5c27c0ad61edb35d758e201061595 Reviewed-by: Oliver Wolff --- src/plugins/common/evr/evrcustompresenter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/common/evr') diff --git a/src/plugins/common/evr/evrcustompresenter.cpp b/src/plugins/common/evr/evrcustompresenter.cpp index 5ebde2dda..872b97bcc 100644 --- a/src/plugins/common/evr/evrcustompresenter.cpp +++ b/src/plugins/common/evr/evrcustompresenter.cpp @@ -1925,12 +1925,12 @@ void EVRCustomPresenter::presentSample(IMFSample *sample) return; } - if (!m_surface || !m_surface->isActive() || !m_presentEngine->videoSurfaceFormat().isValid()) + if (!m_surface || !m_presentEngine->videoSurfaceFormat().isValid()) return; QVideoFrame frame = m_presentEngine->makeVideoFrame(sample); - if (m_surface->isActive() && m_surface->surfaceFormat() != m_presentEngine->videoSurfaceFormat()) { + if (!m_surface->isActive() || m_surface->surfaceFormat() != m_presentEngine->videoSurfaceFormat()) { m_surface->stop(); if (!m_surface->start(m_presentEngine->videoSurfaceFormat())) return; -- cgit v1.2.1