summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVaL Doroshchuk <valentyn.doroshchuk@qt.io>2020-01-31 16:20:10 +0100
committerAndy Shaw <andy.shaw@qt.io>2020-03-03 14:43:57 +0000
commit89dc35385037339072159d1e5fc8e325010b2dc0 (patch)
tree0f843c3339bd9640e0bf1f5bfaac6903b0c8a6cb
parentcdb568606b9eab946c2cacff374a911dc4cfd2f0 (diff)
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 <andy.shaw@qt.io>
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinsession.cpp10
1 files 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() &&