From 12a72d2b086d3052afa41774db62821039bafcad Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Wed, 19 Jun 2013 12:19:02 +0200 Subject: [PATCH] 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 --- libs/gst/base/gstbasetransform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index f18625ba4e..df672bf873 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -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");