mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
v4l: Make sure to return a subset of the filter caps in getcaps
This commit is contained in:
parent
a477837ffe
commit
330456456e
1 changed files with 29 additions and 2 deletions
|
@ -371,12 +371,30 @@ gst_v4lsrc_get_caps (GstBaseSrc * src, GstCaps * filter)
|
|||
GList *item;
|
||||
|
||||
if (!GST_V4L_IS_OPEN (GST_V4LELEMENT (v4lsrc))) {
|
||||
return gst_v4lsrc_get_any_caps ();
|
||||
GstCaps *caps, *intersection;
|
||||
|
||||
caps = gst_v4lsrc_get_any_caps ();
|
||||
if (filter) {
|
||||
intersection =
|
||||
gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
|
||||
gst_caps_unref (caps);
|
||||
caps = intersection;
|
||||
}
|
||||
return caps;
|
||||
}
|
||||
|
||||
if (!v4lsrc->autoprobe) {
|
||||
GstCaps *caps, *intersection;
|
||||
|
||||
/* FIXME: query current caps and return those, with _any appended */
|
||||
return gst_v4lsrc_get_any_caps ();
|
||||
caps = gst_v4lsrc_get_any_caps ();
|
||||
if (filter) {
|
||||
intersection =
|
||||
gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
|
||||
gst_caps_unref (caps);
|
||||
caps = intersection;
|
||||
}
|
||||
return caps;
|
||||
}
|
||||
|
||||
if (!v4lsrc->colorspaces) {
|
||||
|
@ -451,6 +469,15 @@ gst_v4lsrc_get_caps (GstBaseSrc * src, GstCaps * filter)
|
|||
gst_caps_append (list, one);
|
||||
}
|
||||
|
||||
if (filter) {
|
||||
GstCaps *intersection;
|
||||
|
||||
intersection =
|
||||
gst_caps_intersect_full (filter, list, GST_CAPS_INTERSECT_FIRST);
|
||||
gst_caps_unref (list);
|
||||
list = intersection;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue