From 89dc35385037339072159d1e5fc8e325010b2dc0 Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Fri, 31 Jan 2020 16:20:10 +0100 Subject: GStreamer: Allow using different resolution for capture and viewfinder Currently viewfinder resolution is overridden by image resolution. Fixed to keep it separate. Note, it might be not fully supported by gst camera implementation. Change-Id: Ia04c7819da1410f41aee458d347408f94053170b Reviewed-by: Andy Shaw --- src/plugins/gstreamer/camerabin/camerabinsession.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp index 3e505a413..9445bd9d0 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp @@ -347,10 +347,12 @@ void CameraBinSession::setupCaptureResolution() // If capture resolution is specified, use it also for the viewfinder to avoid caps negotiation // to fail. if (m_usingWrapperCameraBinSrc) { - if (m_captureMode == QCamera::CaptureStillImage && !imageResolution.isEmpty()) - viewfinderResolution = imageResolution; - else if (m_captureMode == QCamera::CaptureVideo && !videoResolution.isEmpty()) - viewfinderResolution = videoResolution; + if (viewfinderResolution.isEmpty()) { + if (m_captureMode == QCamera::CaptureStillImage && !imageResolution.isEmpty()) + viewfinderResolution = imageResolution; + else if (m_captureMode == QCamera::CaptureVideo && !videoResolution.isEmpty()) + viewfinderResolution = videoResolution; + } // Make sure we don't use incompatible frame rate and pixel format with the new resolution if (viewfinderResolution != m_viewfinderSettings.resolution() && -- cgit v1.2.3