gst-plugins-bad: wrappercamerabinsrc: Avoid clearing recording caps

Thiago Sousa Santos thiagoss at kemper.freedesktop.org
Fri Mar 11 13:41:33 PST 2011


Module: gst-plugins-bad
Branch: master
Commit: 18602e6e4e24cc37ab17a4bda80ff0151204e07d
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=18602e6e4e24cc37ab17a4bda80ff0151204e07d

Author: Thiago Santos <thiago.sousa.santos at collabora.co.uk>
Date:   Thu Mar 10 11:38:18 2011 -0300

wrappercamerabinsrc: Avoid clearing recording caps

When recording 2 videos in sequence with the same video-capture-caps,
the second video would get a not-negotiated error because the
src caps were being cleared without any intention of
renegotiating it back to the requested capture caps.

This patch avoids this caps reset procedure unless a new
caps was set.

---

 gst/camerabin2/gstwrappercamerabinsrc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c
index 591deb2..74ff324 100644
--- a/gst/camerabin2/gstwrappercamerabinsrc.c
+++ b/gst/camerabin2/gstwrappercamerabinsrc.c
@@ -922,11 +922,11 @@ gst_wrapper_camera_bin_src_start_capture (GstBaseCameraSrc * camerasrc)
   } else if (src->mode == MODE_VIDEO) {
     GstCaps *caps = NULL;
 
-    g_mutex_unlock (camerasrc->capturing_mutex);
-    gst_wrapper_camera_bin_reset_video_src_caps (src, NULL);
-    g_mutex_lock (camerasrc->capturing_mutex);
-
     if (src->video_renegotiate) {
+      g_mutex_unlock (camerasrc->capturing_mutex);
+      gst_wrapper_camera_bin_reset_video_src_caps (src, NULL);
+      g_mutex_lock (camerasrc->capturing_mutex);
+
       /* clean capsfilter caps so they don't interfere here */
       g_object_set (src->src_filter, "caps", NULL, NULL);
       if (src->src_zoom_filter)



More information about the gstreamer-commits mailing list