If a pad is requested with certain caps and there is already a
transceiver, reject the pad request if the caps don't match.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
gst_object_unref (pad2);
return NULL;
}
+
+ if (caps && trans->codec_preferences) {
+ if (!gst_caps_can_intersect (caps, trans->codec_preferences)) {
+ GST_ERROR_OBJECT (element, "Tried to request a new sink pad %s for"
+ " existing m-line %d, but requested caps %" GST_PTR_FORMAT
+ " don't match existing codec preferences %" GST_PTR_FORMAT,
+ name, serial, caps, trans->codec_preferences);
+ return NULL;
+ }
+ }
}
}