From: Edward Hervey Date: Fri, 25 Jun 2010 14:31:06 +0000 (+0200) Subject: GstPad: Do not call gst_pad_accept_caps() when caps change X-Git-Tag: RELEASE-0.10.31~298 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7fa58dbebd70d0bee9c7fd4f33ed42f11faa3dfe;p=platform%2Fupstream%2Fgstreamer.git GstPad: Do not call gst_pad_accept_caps() when caps change Instead just check that the caps intersect with the pad template. The elements should properly accept/refuse the caps in setcaps(). Shaves off calling the default implementation of acceptcaps which does an expensive gst_pad_get_caps() (so if you have 50 of those elements in a row, you'd be doing factorial(50) gst_pad_get_caps...). Does not break any module unit test and most apps work fine. https://bugzilla.gnome.org/show_bug.cgi?id=622740 --- diff --git a/gst/gstpad.c b/gst/gstpad.c index 0e0f7de..14aebc9 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -2706,7 +2706,7 @@ gst_pad_configure_sink (GstPad * pad, GstCaps * caps) gboolean res; /* See if pad accepts the caps */ - if (!gst_pad_accept_caps (pad, caps)) + if (!gst_caps_can_intersect (caps, gst_pad_get_pad_template_caps (pad))) goto not_accepted; /* set caps on pad if call succeeds */