diff options
author | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2014-11-17 17:03:30 +0100 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2014-11-18 12:52:46 +0100 |
commit | a42a5ae6191ecbe317a00d8261bc53e842967052 (patch) | |
tree | 461ca0b0fcc64a6421eff4a66dc62d57bb917b3d | |
parent | af4933b6cdfaf34680ce074649ef3fe3048732f0 (diff) | |
download | qtmultimedia-wip/gstreamer-1.0.tar.gz |
GStreamer: restart camerabin pipeline when changing camera mode.wip/gstreamer-1.0baserock/qt5.4-wip-gstreamer-1.0
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 <andrew.den.exter@qinetic.com.au>
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabincontrol.cpp | 7 |
1 files 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: |