imagefreeze: the new get_caps already does the filter intersection

It should be faster to pass the caps to intersect as the filter caps,
rather than using NULL and intersecting 'manually' later.

https://bugzilla.gnome.org/show_bug.cgi?id=686837
This commit is contained in:
Thiago Santos 2012-10-25 00:44:34 -03:00
parent 115581eb2e
commit 02d91dcd24

View file

@ -196,17 +196,11 @@ gst_image_freeze_sink_setcaps (GstImageFreeze * self, GstCaps * caps)
intersection = othercaps = NULL;
/* 3. Intersect with downstream peer caps */
othercaps = gst_pad_peer_query_caps (self->srcpad, NULL);
if (othercaps) {
intersection = gst_caps_intersect (caps, othercaps);
GST_DEBUG_OBJECT (pad, "Intersecting: %" GST_PTR_FORMAT, caps);
GST_DEBUG_OBJECT (pad, "with: %" GST_PTR_FORMAT, othercaps);
GST_DEBUG_OBJECT (pad, "gave: %" GST_PTR_FORMAT, intersection);
gst_caps_unref (othercaps);
gst_caps_unref (caps);
caps = intersection;
intersection = othercaps = NULL;
}
othercaps = gst_pad_peer_query_caps (self->srcpad, caps);
GST_DEBUG_OBJECT (pad, "Peer query resulted: %" GST_PTR_FORMAT, othercaps);
gst_caps_unref (caps);
caps = othercaps;
othercaps = NULL;
/* 4. For every candidate check if it's accepted downstream
* and fixate framerate to nearest 25/1 */