mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
pad: check template caps for proxy pads in accept-caps
Validate that the proxy pad indeed accepts the caps by also comparing with the pad template caps, otherwise when the pad had no internally linked pads it would always return true. https://bugzilla.gnome.org/show_bug.cgi?id=754112
This commit is contained in:
parent
2c132becb4
commit
02d88fc3f3
1 changed files with 13 additions and 9 deletions
22
gst/gstpad.c
22
gst/gstpad.c
|
@ -2982,7 +2982,7 @@ static gboolean
|
|||
gst_pad_query_accept_caps_default (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
/* get the caps and see if it intersects to something not empty */
|
||||
GstCaps *caps, *allowed;
|
||||
GstCaps *caps, *allowed = NULL;
|
||||
gboolean result;
|
||||
|
||||
GST_DEBUG_OBJECT (pad, "query accept-caps %" GST_PTR_FORMAT, query);
|
||||
|
@ -2991,17 +2991,21 @@ gst_pad_query_accept_caps_default (GstPad * pad, GstQuery * query)
|
|||
* a PROXY CAPS */
|
||||
if (GST_PAD_IS_PROXY_CAPS (pad)) {
|
||||
result = gst_pad_proxy_query_accept_caps (pad, query);
|
||||
goto done;
|
||||
if (result)
|
||||
allowed = gst_pad_get_pad_template_caps (pad);
|
||||
else
|
||||
goto done;
|
||||
}
|
||||
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_PERFORMANCE, pad,
|
||||
"fallback ACCEPT_CAPS query, consider implementing a specialized version");
|
||||
|
||||
gst_query_parse_accept_caps (query, &caps);
|
||||
if (GST_PAD_IS_ACCEPT_TEMPLATE (pad))
|
||||
allowed = gst_pad_get_pad_template_caps (pad);
|
||||
else
|
||||
allowed = gst_pad_query_caps (pad, caps);
|
||||
if (!allowed) {
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_PERFORMANCE, pad,
|
||||
"fallback ACCEPT_CAPS query, consider implementing a specialized version");
|
||||
if (GST_PAD_IS_ACCEPT_TEMPLATE (pad))
|
||||
allowed = gst_pad_get_pad_template_caps (pad);
|
||||
else
|
||||
allowed = gst_pad_query_caps (pad, caps);
|
||||
}
|
||||
|
||||
if (allowed) {
|
||||
if (GST_PAD_IS_ACCEPT_INTERSECT (pad)) {
|
||||
|
|
Loading…
Reference in a new issue