mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +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;
|
GList *item;
|
||||||
|
|
||||||
if (!GST_V4L_IS_OPEN (GST_V4LELEMENT (v4lsrc))) {
|
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) {
|
if (!v4lsrc->autoprobe) {
|
||||||
|
GstCaps *caps, *intersection;
|
||||||
|
|
||||||
/* FIXME: query current caps and return those, with _any appended */
|
/* 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) {
|
if (!v4lsrc->colorspaces) {
|
||||||
|
@ -451,6 +469,15 @@ gst_v4lsrc_get_caps (GstBaseSrc * src, GstCaps * filter)
|
||||||
gst_caps_append (list, one);
|
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;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue