basesink: implement faster ACCEPT_CAPS query

This commit is contained in:
Wim Taymans 2012-02-10 11:24:28 +01:00
parent 34f770a900
commit b30b397c46

View file

@ -4536,6 +4536,19 @@ gst_base_sink_default_query (GstBaseSink * basesink, GstQuery * query)
res = TRUE;
break;
}
case GST_QUERY_ACCEPT_CAPS:
{
GstCaps *caps, *allowed;
gboolean subset;
/* slightly faster than the default implementation */
gst_query_parse_accept_caps (query, &caps);
allowed = gst_base_sink_query_caps (basesink, basesink->sinkpad, NULL);
subset = gst_caps_is_subset (caps, allowed);
gst_query_set_accept_caps_result (query, subset);
res = TRUE;
break;
}
default:
res =
gst_pad_query_default (basesink->sinkpad, GST_OBJECT_CAST (basesink),