From 02d91dcd24e54f510419655c2c56c2afc83a1ac5 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Thu, 25 Oct 2012 00:44:34 -0300 Subject: [PATCH] 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 --- gst/imagefreeze/gstimagefreeze.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/gst/imagefreeze/gstimagefreeze.c b/gst/imagefreeze/gstimagefreeze.c index 43150475a6..7c56d0e544 100644 --- a/gst/imagefreeze/gstimagefreeze.c +++ b/gst/imagefreeze/gstimagefreeze.c @@ -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 */