Bug 1401592 Comment 48 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

`RTCRtpSendParameters.encodings` - in the spec it says "A sequence containing parameters for RTP encodings of media."

MDN says a lot more:

- An array of [RTCRtpEncodingParameters](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpEncodingParameters) objects, each specifying the parameters for a single codec that could be used to encode the track's media.
- The [RTCRtpSendParameters](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSendParameters) dictionary's encodings property is an [RTCRtpEncodingParameters](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpEncodingParameters) object providing configuration settings for the encoder being used for the [RTCRtpSender](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender)'s [track](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/track).
- In a connection in which there's only one remote peer, the encodings array will have just one object in it, describing the encoding to use when transmitting to that peer. For each peer you add the [RTCRtpSender](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender) to, another entry is added to encodings to describe its configuration.

So when using RTCRtpSender get/set Parameters I interpret this to mean that:
- a sender has an associated media track for which it is used to manage sending.
- The sender has a set of possible codecs that it can use to encode that track - listed in object returned by `RTCRtpSender.getParameters()`
- The sender has a set of encodings that indicate which codec it will send if used with a particular peer - also returned by `getParameters()`
- If you have one peer the object returned by `getParameters()` will have just one encoding. 
- If there are multiple peers associated with the sender there will be multiple encodings providing the peer-to-codec relationship.

Is that ^^^ in any way correct?

- So what does it mean that FF does not support the `encodings` for `getParameters()`? - that you can only have one sender associated with one peer, and that any settings are hard coded?
- The reason this is confusing is that the other docs on MDN seem to indicate that you create and add a track to the peer and you're handed a sender. THere's no notion that this sender can be used with multiple peers or why. Is there any kind of explainer for this?
`RTCRtpSendParameters.encodings` - in the spec it says "A sequence containing parameters for RTP encodings of media."

MDN says a lot more:

- An array of [RTCRtpEncodingParameters](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpEncodingParameters) objects, each specifying the parameters for a single codec that could be used to encode the track's media.
- The [RTCRtpSendParameters](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSendParameters) dictionary's encodings property is an [RTCRtpEncodingParameters](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpEncodingParameters) object providing configuration settings for the encoder being used for the [RTCRtpSender](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender)'s [track](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/track).
- In a connection in which there's only one remote peer, the encodings array will have just one object in it, describing the encoding to use when transmitting to that peer. For each peer you add the [RTCRtpSender](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender) to, another entry is added to encodings to describe its configuration.

So when using RTCRtpSender get/set Parameters I interpret this to mean that:
- a sender has an associated media track for which it is used to manage sending.
- The sender has a set of possible codecs that it can use to encode that track - listed in object returned by `RTCRtpSender.getParameters()`
- The sender has a set of encodings that indicate which codec it will send if used with a particular peer - also returned by `getParameters()`
- If you have one peer the object returned by `getParameters()` will have just one encoding. 
- If there are multiple peers associated with the sender there will be multiple encodings providing the peer-to-codec relationship.

Is that ^^^ in any way correct?

- So what does it mean that FF does not support the `codecs` for `getParameters()`? - how do the `encodings` work then?
- The reason this is confusing is that the other docs on MDN seem to indicate that you create and add a track to the peer and you're handed a sender. THere's no notion that this sender can be used with multiple peers or why. Is there any kind of explainer for this?
EDITED: - confirmed that the there is only one peer associated with each sender. Would appreciate confirmation of how this works still. My guess:

- Encodings that are available are set when you call `RTCPeerConnection.addTransceiver()`
- When you call `RTCRtpSender.getParameters()` you'll get this list of encodings. The one that is in use for sending data is the one with the `active` flag set - right? Given the default for the active flag is true does that mean if you have multiples you will have to explicitly set the ones you don't want to use as false or will this happen for you when you set an encoding as active?
- It looks like you can get a list of codecs in the parameters too. However as these are set using `transceiver.setCodecPreferences` from a point of view of set/getParameters these would be read-only right?
- In other words, if you're getting and setting parameters, the interesting one in this discussion is the encodings, since you can use those to change how the data is sent. The codecs are more "for information" at this point..

Is that ^^^ in any way correct?

Back to Bug 1401592 Comment 48