From a42a5ae6191ecbe317a00d8261bc53e842967052 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Mon, 17 Nov 2014 17:03:30 +0100 Subject: GStreamer: restart camerabin pipeline when changing camera mode. With Gstreamer 0.10, the camera was always restarded, either by us (for older Gstreamer versions) or by the camerabin. With GStreamer 1.0, camerabin doesn't restart the pipeline anymore when changing the camera mode. Caps are not properly re-negotiated after changing the mode, leading to errors when trying to capture alternately images and videos. Work around this by always restarting the pipeline when changing the camera mode. Change-Id: I6a5663a17ca2fc006414cbaa0ffca95286f6dba1 Reviewed-by: Andrew den Exter --- src/plugins/gstreamer/camerabin/camerabincontrol.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/plugins/gstreamer/camerabin/camerabincontrol.cpp b/src/plugins/gstreamer/camerabin/camerabincontrol.cpp index 2fe9cc73c..8c6b8b0ea 100644 --- a/src/plugins/gstreamer/camerabin/camerabincontrol.cpp +++ b/src/plugins/gstreamer/camerabin/camerabincontrol.cpp @@ -95,11 +95,6 @@ void CameraBinControl::setCaptureMode(QCamera::CaptureModes mode) captureMode() == QCamera::CaptureStillImage ? CamerabinResourcePolicy::ImageCaptureResources : CamerabinResourcePolicy::VideoCaptureResources); -#if !GST_CHECK_VERSION(0,10,23) - //due to bug in v4l2src, it's necessary to reload camera on video caps changes - //https://bugzilla.gnome.org/show_bug.cgi?id=649832 - reloadLater(); -#endif } emit captureModeChanged(mode); } @@ -299,6 +294,8 @@ bool CameraBinControl::canChangeProperty(PropertyChangeType changeType, QCamera: switch (changeType) { case QCameraControl::CaptureMode: + return status != QCamera::ActiveStatus; + break; case QCameraControl::ImageEncodingSettings: case QCameraControl::VideoEncodingSettings: case QCameraControl::Viewfinder: -- cgit v1.2.1