summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré de la Rocha <andre.rocha@qt.io>2021-06-16 18:46:25 +0200
committerAndré de la Rocha <andre.rocha@qt.io>2021-06-16 22:12:20 +0200
commitd19031d94fc28241229348e449a0d6bf69ba8b2f (patch)
tree31627b6440bd8501bde6561344c79bc637b8a548
parentf6dc1df986dacbc018a482f7e21b93bda6fc69fc (diff)
Windows: Fix active camera set in media device session
Resets the active camera in the media device session when a null camera is set in the capture session. Change-Id: Id843ac556e98dab880720be13beed1bb9c621e0c Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/multimedia/platform/windows/mediacapture/qwindowscamera.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/multimedia/platform/windows/mediacapture/qwindowscamera.cpp b/src/multimedia/platform/windows/mediacapture/qwindowscamera.cpp
index 8be1ab1e1..137c0e8b8 100644
--- a/src/multimedia/platform/windows/mediacapture/qwindowscamera.cpp
+++ b/src/multimedia/platform/windows/mediacapture/qwindowscamera.cpp
@@ -107,8 +107,11 @@ void QWindowsCamera::setCaptureSession(QPlatformMediaCaptureSession *session)
if (m_captureService == captureService)
return;
- if (m_mediaDeviceSession)
+ if (m_mediaDeviceSession) {
m_mediaDeviceSession->setActive(false);
+ m_mediaDeviceSession->setCameraFormat({});
+ m_mediaDeviceSession->setActiveCamera({});
+ }
m_captureService = captureService;
if (!m_captureService) {