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
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 */