Skip to content
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

addTransceiver: 1 sendEncodings vs 0 sendEncodings #2856

Open
henbos opened this issue Apr 12, 2023 · 4 comments
Open

addTransceiver: 1 sendEncodings vs 0 sendEncodings #2856

henbos opened this issue Apr 12, 2023 · 4 comments

Comments

@henbos
Copy link
Contributor

henbos commented Apr 12, 2023

I found this note in addTransceiver and I am wondering if it is reflecting legacy behavior.

NOTE
Providing a single, default RTCRtpEncodingParameters in sendEncodings allows the application to subsequently set encoding parameters using setParameters, even when simulcast isn't used.

This note makes it sound like there is something special about specifying a single encoding. It doesn't say it, but it seem to imply that if you had not specified a single encoding, setParameters() may not have been usable in singlecast. But that doesn't make sense, because there's no such thing as having 0 sendEncodings. If you don't specify any sendEncodings, you get singlecast by default, so surely setParameters() would work with that single encoding regardless.

A few milestones ago Chromium did treat 0 sendEncodings and 1 sendEncodings subtly differently, but this was patched as a bugfix. But finding this note now, I'm curious as to why it is phrased this way?

Should we clarify that "0 sendEncodings == 1 sendEncodings with default values"?

@henbos
Copy link
Contributor Author

henbos commented Apr 12, 2023

@jan-ivar Does Firefox treat 0 vs 1 sendEncodings any differently with regards to being able to do get+setParameters()?

@Orphis
Copy link
Contributor

Orphis commented Apr 13, 2023

We should not have any senders with 0 encodings. The algorithm to create an RTCRtpSender says:

If sendEncodings is given as input to this algorithm, and is non-empty, set the [[SendEncodings]] slot to sendEncodings. Otherwise, set it to a list containing a single new RTCRtpEncodingParameters dictionary, and if kind is "video", add a scaleResolutionDownBy member with the value 1.0 to that dictionary.

So the comment is probably out of date.

@henbos
Copy link
Contributor Author

henbos commented Apr 13, 2023

Great, then it's just a strangely formulated note, but no question about what the implementation should do

@henbos
Copy link
Contributor Author

henbos commented Apr 13, 2023

Editorial label to reflect just re-wording the note

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants