This will reduce the number of caps created downstream and we don't
need to intersect in the very end with the pad's own caps.
{
GstCaps *mycaps;
GstCaps *caps;
- GstCaps *peercaps;
GstPad *peer;
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
GST_OBJECT_UNLOCK (pad);
mycaps = gst_pad_query_caps (pad, NULL);
- peercaps = gst_pad_query_caps (peer, NULL);
+ caps = gst_pad_query_caps (peer, mycaps);
gst_object_unref (peer);
- caps = gst_caps_intersect (mycaps, peercaps);
- gst_caps_unref (peercaps);
gst_caps_unref (mycaps);
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, "allowed caps %" GST_PTR_FORMAT,