basetransform: optimize default acceptcaps implementation

Pass the fixed caps we're asked to accept as a filter for the caps
query, so we don't get a fully-expanded set of caps back (which we don't
need and can take a lot of time for intersection).

This reduces the time for camerabin to produce a second frame on a
logitech C910 camera from around 52 seconds to a bit less then 16
seconds on my system.

https://bugzilla.gnome.org/show_bug.cgi?id=702632
This commit is contained in:
Sjoerd Simons 2013-06-19 12:19:02 +02:00 committed by Sjoerd Simons
parent 0d57bd3198
commit 12a72d2b08

View file

@ -1236,9 +1236,9 @@ gst_base_transform_acceptcaps_default (GstBaseTransform * trans,
/* get all the formats we can handle on this pad */
if (direction == GST_PAD_SRC)
allowed = gst_pad_query_caps (trans->srcpad, NULL);
allowed = gst_pad_query_caps (trans->srcpad, caps);
else
allowed = gst_pad_query_caps (trans->sinkpad, NULL);
allowed = gst_pad_query_caps (trans->sinkpad, caps);
if (!allowed) {
GST_DEBUG_OBJECT (trans, "gst_pad_query_caps() failed");