This can happen if other parts of the pipeline are reconfigured.
Stop streaming even for a short amount of time can be quite visible, so it
should be avoided if possible.
https://bugzilla.gnome.org/show_bug.cgi?id=700503
}
}
+gboolean
+gst_v4l2_object_caps_equal (GstV4l2Object * v4l2object, GstCaps * caps)
+{
+ GstStructure *s;
+ GstCaps *oldcaps;
+
+ if (!v4l2object->pool)
+ return FALSE;
+
+ s = gst_buffer_pool_get_config (GST_BUFFER_POOL_CAST (v4l2object->pool));
+ gst_buffer_pool_config_get_params (s, &oldcaps, NULL, NULL, NULL);
+
+ return oldcaps && gst_caps_is_equal (caps, oldcaps);
+}
+
gboolean
gst_v4l2_object_unlock (GstV4l2Object * v4l2object)
{
gboolean gst_v4l2_object_set_format (GstV4l2Object *v4l2object, GstCaps * caps);
+gboolean gst_v4l2_object_caps_equal (GstV4l2Object * v4l2object, GstCaps * caps);
+
gboolean gst_v4l2_object_unlock (GstV4l2Object *v4l2object);
gboolean gst_v4l2_object_unlock_stop (GstV4l2Object *v4l2object);
return FALSE;
}
+ /* make sure the caps changed before doing anything */
+ if (gst_v4l2_object_caps_equal (obj, caps))
+ return TRUE;
+
if (!gst_v4l2_object_stop (obj))
goto stop_failed;
v4l2src = GST_V4L2SRC (src);
obj = v4l2src->v4l2object;
+ /* make sure the caps changed before doing anything */
+ if (gst_v4l2_object_caps_equal (obj, caps))
+ return TRUE;
+
/* make sure we stop capturing and dealloc buffers */
if (!gst_v4l2_object_stop (obj))
return FALSE;