v4l2: add gst_v4l2_object_probe_caps

Add a variant of gst_v4l2_object_get_caps that bypasses the probed_caps cache.

https://bugzilla.gnome.org/show_bug.cgi?id=733827
This commit is contained in:
Philipp Zabel 2015-03-27 15:02:33 +01:00 committed by Nicolas Dufresne
parent 1435974c2d
commit cf29e6c0b7
2 changed files with 38 additions and 22 deletions

View file

@ -3560,13 +3560,12 @@ done:
}
GstCaps *
gst_v4l2_object_get_caps (GstV4l2Object * v4l2object, GstCaps * filter)
gst_v4l2_object_probe_caps (GstV4l2Object * v4l2object, GstCaps * filter)
{
GstCaps *ret;
GSList *walk;
GSList *formats;
if (v4l2object->probed_caps == NULL) {
formats = gst_v4l2_object_get_format_list (v4l2object);
ret = gst_caps_new_empty ();
@ -3594,9 +3593,24 @@ gst_v4l2_object_get_caps (GstV4l2Object * v4l2object, GstCaps * filter)
format->pixelformat);
}
}
v4l2object->probed_caps = ret;
if (filter) {
ret = gst_caps_intersect_full (filter, ret, GST_CAPS_INTERSECT_FIRST);
} else {
ret = gst_caps_ref (ret);
}
return ret;
}
GstCaps *
gst_v4l2_object_get_caps (GstV4l2Object * v4l2object, GstCaps * filter)
{
GstCaps *ret;
if (v4l2object->probed_caps == NULL)
v4l2object->probed_caps = gst_v4l2_object_probe_caps (v4l2object, NULL);
if (filter) {
ret = gst_caps_intersect_full (filter, v4l2object->probed_caps,
GST_CAPS_INTERSECT_FIRST);

View file

@ -260,6 +260,8 @@ gboolean gst_v4l2_object_unlock_stop (GstV4l2Object * v4l2object);
gboolean gst_v4l2_object_stop (GstV4l2Object * v4l2object);
GstCaps * gst_v4l2_object_probe_caps (GstV4l2Object * v4l2object,
GstCaps * filter);
GstCaps * gst_v4l2_object_get_caps (GstV4l2Object * v4l2object,
GstCaps * filter);