webrtcbin: Ignore current caps for codec negotiation
authorOlivier Crête <olivier.crete@collabora.com>
Thu, 6 May 2021 21:50:38 +0000 (17:50 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Thu, 13 May 2021 19:05:00 +0000 (15:05 -0400)
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>

ext/webrtc/gstwebrtcbin.c

index c08d837..fe1ce22 100644 (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, "