From 319a5e5779e1bae7e26fa157fd24f57fc9b9f1e6 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 25 Mar 2020 14:46:15 +1100 Subject: [PATCH] webrtc: mark streams as active on renegotiation as well. Otherwise when bundling, only the changed streams would be considered as to whether the bundled transport needs to be blocked as all streams are inactive. Scenario is one transceiver changes direction to inactive and as that is the only change in transciever direction, the entire bundled transport would be blocked even if there are other active transceivers inside the same bundled transport that are still active. Fix by always checking the activeness of a stream regardless of if the transceiverr has changed direction. --- ext/webrtc/gstwebrtcbin.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c index 34b1bbadce..fd6e812536 100644 --- a/ext/webrtc/gstwebrtcbin.c +++ b/ext/webrtc/gstwebrtcbin.c @@ -3794,8 +3794,24 @@ _update_transceiver_from_sdp_media (GstWebRTCBin * webrtc, } } + if (new_dir == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE) { + if (!bundled) { + /* Not a bundled stream means this entire transport is inactive, + * so set the receive state to BLOCK below */ + stream->active = FALSE; + receive_state = RECEIVE_STATE_BLOCK; + } + } else { + /* If this transceiver is active for sending or receiving, + * we still need receive at least RTCP, so need to unblock + * the receive bin below. */ + GST_LOG_OBJECT (webrtc, "marking stream %p as active", stream); + receive_state = RECEIVE_STATE_PASS; + stream->active = TRUE; + } + if (new_dir != prev_dir) { - GST_TRACE_OBJECT (webrtc, "transceiver direction change"); + GST_DEBUG_OBJECT (webrtc, "transceiver direction change"); if (new_dir == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE) { GstWebRTCBinPad *pad; @@ -3814,20 +3830,7 @@ _update_transceiver_from_sdp_media (GstWebRTCBin * webrtc, gst_object_unref (pad); } - if (!bundled) { - /* Not a bundled stream means this entire transport is inactive, - * so set the receive state to BLOCK below */ - stream->active = FALSE; - receive_state = RECEIVE_STATE_BLOCK; - } - /* XXX: send eos event up the sink pad as well? */ - } else { - /* If this transceiver is active for sending or receiving, - * we still need receive at least RTCP, so need to unblock - * the receive bin below. */ - receive_state = RECEIVE_STATE_PASS; - stream->active = TRUE; } if (new_dir == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY ||