allowed = gst_pad_query_caps (pad, caps);
if (allowed) {
- GST_DEBUG_OBJECT (pad, "allowed caps %" GST_PTR_FORMAT, allowed);
- result = gst_caps_is_subset (caps, allowed);
+ if (GST_PAD_IS_ACCEPT_INTERSECT (pad)) {
+ GST_DEBUG_OBJECT (pad,
+ "allowed caps intersect %" GST_PTR_FORMAT ", caps %" GST_PTR_FORMAT,
+ allowed, caps);
+ result = gst_caps_can_intersect (caps, allowed);
+ } else {
+ GST_DEBUG_OBJECT (pad, "allowed caps subset %" GST_PTR_FORMAT ", caps %"
+ GST_PTR_FORMAT, allowed, caps);
+ result = gst_caps_is_subset (caps, allowed);
+ }
gst_caps_unref (allowed);
} else {
GST_DEBUG_OBJECT (pad, "no compatible caps allowed on the pad");
* @GST_PAD_FLAG_PROXY_SCHEDULING: the default query handler will forward
* scheduling queries to the internally linked pads
* instead of discarding them.
+ * @GST_PAD_FLAG_ACCEPT_INTERSECT: the default accept-caps handler will check
+ * it the caps intersect the query-caps result instead
+ * of checking for a subset. This is interesting for
+ * parsers that can accept incompletely specified caps.
* @GST_PAD_FLAG_LAST: offset to define more flags
*
* Pad state flags
GST_PAD_FLAG_PROXY_CAPS = (GST_OBJECT_FLAG_LAST << 8),
GST_PAD_FLAG_PROXY_ALLOCATION = (GST_OBJECT_FLAG_LAST << 9),
GST_PAD_FLAG_PROXY_SCHEDULING = (GST_OBJECT_FLAG_LAST << 10),
+ GST_PAD_FLAG_ACCEPT_INTERSECT = (GST_OBJECT_FLAG_LAST << 11),
/* padding */
GST_PAD_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 16)
} GstPadFlags;
#define GST_PAD_SET_PROXY_SCHEDULING(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_SCHEDULING))
#define GST_PAD_UNSET_PROXY_SCHEDULING(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_SCHEDULING))
+#define GST_PAD_IS_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT))
+#define GST_PAD_SET_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT))
+#define GST_PAD_UNSET_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT))
+
/**
* GST_PAD_GET_STREAM_LOCK:
* @pad: a #GstPad