-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposing setCodecPreferences to deal with both send and recv codecs #2939
Comments
We don't. If we have nothing to offer this is similar to "we have nothing to answer" which is described as
in https://rtcweb-wg.github.io/jsep/#rfc.section.5.3.1 |
@henbos You may be taking JSEP Section 4.2.6 too literally. It is correct in saying that sCP is not for selecting what is sent. That is true regardless of "For a sendonly stream, the offer SHOULD indicate those formats the offerer is willing to send for this stream. For a recvonly stream, the offer SHOULD indicate those formats the offerer is willing to receive for this stream. For a sendrecv stream, the offer SHOULD indicate those codecs that the offerer is willing to send and receive with." Since this is a SHOULD, there is some wiggle room for sendrecv streams. For example, a sendrecv m-line with preference {H.265, H.264} could be allowed if H.265 can be received but not sent. This would allow negotiation to succeed between a receive-only H.265 Offerer and an Answerer who can send and receive both H.265 and H.264, using only a single sendrecv m-line, as long as the Answerer included both H.265 and H.264 in its Answer. Since non-WebRTC endpoints may not support sendonly and recvonly m-lines, this approach has interoperability advantages. However, concluding that sCP with a sendonly m-line is only about receiving preferences seems like a step too far. Instead I'd suggest that a sendonly transceiver can only offer codecs/profiles that can be sent (send-only or send/recv). In a situation where the browser can send at a different profile/levels than it can receive, only the send profiles can be included when Similarly, a recvonly transceiver can only offer codecs/profiles that can be received (recv-only or send/recv). In a situation where the browser can send at a different profile/levels than it can receive, only the receive profiles are included. This is consistent with JSEP Section 4.2.6. |
@henbos what are next steps here? |
@jan-ivar H.265 is getting close to being enabled behind a flag, so in the near future we will be able to see how receive-only codecs behave, and what the problems are. At that point we can present the issue to the WG in light of the behavior we see. IMHO it would be desirable to converge on recommended changes prior to enabling H.265 by default. |
At TPAC we discussed the different options, including allowing sendrecv transceiver to include recvonly codecs and the potential foot gun there, but there was a strong preference to keep things simple and only include codecs supported in the direction(s) of the transceiver. I.e. sendrecv transceiver can only have sendrecv codecs Let's close this issue in favor of #3006 |
Based on prior discussions such as #2937 (comment), here's a concrete proposal which I think fixes unidirectionality, requires no changes to JSEP (consistent with #2938 (comment)) and avoids backwards compat issues introduced by #2926.
How did we get here?
JSEP has this note (https://rtcweb-wg.github.io/jsep/#rfc.section.4.2.6):
We took this to mean "SCP should only take receive codecs as input", something which JSEP neither says or IMO imply. The note only talks about the direct effect; there's also the indirect effect that the preferences have.
Excluding send codecs was a mistake.
The preferences are relevant even for sendonly transceivers, since we must have something to offer (https://rtcweb-wg.github.io/jsep/#rfc.section.5.2.1):
This does not mean that preferences are irrelevant for the sending use case: the receiver not having called
setCodecPreferences
is a valid use case, in which case the sender's preferences are the ones we use (https://rtcweb-wg.github.io/jsep/#rfc.section.5.3.1):We could simply say we don't care about this use case, but that appears to have some downsides when it comes to unidirectional codecs.
Proposal
"
setCodecPreferences
accepts both send codecs and receive codecs as input."The actual preferences you end up using depend on the createOffer filtering we already apply based on
transceiver.direction
. This makes it valid for...To be discussed
Note that it's possible for the filtering to end up with an empty codec list. There are multiple ways we could deal with this, of which I have no strong preference. Examples:
The text was updated successfully, but these errors were encountered: