[webrtc-pc] Applying a remote offer with unsupported codecs results in stale transceiver (#2927)

mickel8 has just created a new issue for https://github.com/w3c/webrtc-pc:

== Applying a remote offer with unsupported codecs results in stale transceiver ==
Consider scenario where we apply an initial remote offer, which doesn't contain any supported (by us i.e. receiver) codecs.

According to W3C we will create a new transceiver with `recvonly` direction, then we will create an answer that will mark the mline as rejected (as there are no supported codecs) and finally, we will apply the answer as our local description.

Applying a local answer is defined in section `4.4.1.5-4.7.10.1` and it doesn't allow for stopping transceivers. Stopping transceivers is only done when applying a remote description. Beacuse, when applying the remote offer, we didn't create a stopped transceiver, we won't also stop it when applying the local answer. This means that we will end up with an answer with the rejected mline and the transceiver with direction `recvonly` and currentDirection `recvonly` or `inactive` (depending on what we put in the answer as JSEP defines rejecting an mline as setting port to 0, without changing the direction, see [here](https://datatracker.ietf.org/doc/html/rfc8829#section-5.3.1-15)).

What I think should happen is that we should also stop transceivers when applying local description, so I belive we should add in  `4.4.1.5-4.7.10.1` something like in the `4.4.1.5-4.7.10.2` 

"If the [media description](https://www.w3.org/TR/webrtc/#dfn-media-description) is rejected, and transceiver.[[[Stopped]]](https://www.w3.org/TR/webrtc/#dfn-stopped-0) is false, then [stop the RTCRtpTransceiver](https://www.w3.org/TR/webrtc/#dfn-stop-the-rtcrtptransceiver) transceiver."

That's also what Firefox seems to do.

We offer AV1 as Firefox 121 doesn't support it and at the end of the day the transceiver created after setting a remote description is removed when we apply local description.

See https://jsfiddle.net/mickel8/2zjqnutc/



Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2927 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 17 January 2024 20:36:24 UTC