webrtcbin: Ignore current caps for codec negotiation

On the sink pad, we want the caps of the current stream, those
are the "received_caps" field. If we haven't received caps yet, then
we only care about the caps that the next element can accept, that is
the caps from the peer pad (and the preferences). Otherwise, we prevent
re-negotiation to a better codec when possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
This commit is contained in:
Olivier Crête 2021-05-06 17:50:38 -04:00
parent 4bb94c6970
commit 3065ac49fb

View file

@ -1650,8 +1650,6 @@ _find_codec_preferences (GstWebRTCBin * webrtc,
if (pad->received_caps) {
caps = gst_caps_ref (pad->received_caps);
} else if ((caps = gst_pad_get_current_caps (GST_PAD (pad)))) {
GST_LOG_OBJECT (webrtc, "Using current pad caps: %" GST_PTR_FORMAT, caps);
} else {
static GstStaticCaps static_filter =
GST_STATIC_CAPS ("application/x-rtp, "