wrappercamerabinsrc: avoid assertion by using null caps as any
authorThiago Santos <thiago.sousa.santos@collabora.com>
Wed, 2 May 2012 18:35:05 +0000 (15:35 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Wed, 2 May 2012 19:21:01 +0000 (16:21 -0300)
NULL caps aren't valid caps, use a reference to 'any' caps

gst/camerabin2/gstwrappercamerabinsrc.c

index 3721d6f215873548d3634a61d4b9ff4217abaf95..b69a08880ffb4ecf8c968871732d63260dbd8555 100644 (file)
@@ -792,7 +792,9 @@ gst_wrapper_camera_bin_src_set_mode (GstBaseCameraSrc * bcamsrc,
       g_object_set (G_OBJECT (photography), "capture-mode", mode, NULL);
     }
   } else {
-    gst_wrapper_camera_bin_reset_video_src_caps (self, NULL);
+    GstCaps *anycaps = gst_caps_new_any ();
+    gst_wrapper_camera_bin_reset_video_src_caps (self, anycaps);
+    gst_caps_unref (anycaps);
   }
 
   return TRUE;
@@ -1002,8 +1004,9 @@ gst_wrapper_camera_bin_src_start_capture (GstBaseCameraSrc * camerasrc)
     GstCaps *caps = NULL;
 
     if (src->video_renegotiate) {
+      GstCaps *anycaps = gst_caps_new_any ();
       g_mutex_unlock (&camerasrc->capturing_mutex);
-      gst_wrapper_camera_bin_reset_video_src_caps (src, NULL);
+      gst_wrapper_camera_bin_reset_video_src_caps (src, anycaps);
       g_mutex_lock (&camerasrc->capturing_mutex);
 
       /* clean capsfilter caps so they don't interfere here */
@@ -1020,6 +1023,7 @@ gst_wrapper_camera_bin_src_start_capture (GstBaseCameraSrc * camerasrc)
       gst_wrapper_camera_bin_reset_video_src_caps (src, caps);
       g_mutex_lock (&camerasrc->capturing_mutex);
       gst_caps_unref (caps);
+      gst_caps_unref (anycaps);
     }
     if (src->video_rec_status == GST_VIDEO_RECORDING_STATUS_DONE) {
       src->video_rec_status = GST_VIDEO_RECORDING_STATUS_STARTING;