w3c / webrtc-pc

WebRTC 1.0 API
https://w3c.github.io/webrtc-pc/
Other
435 stars 115 forks source link

codec input to setParameters shouldn't be validated by preferred receive codecs #2989

Open jan-ivar opened 2 weeks ago

jan-ivar commented 2 weeks ago

Step 4 of the setParameters validation steps says: "If choosableCodecs is an empty list, set choosableCodecs to transceiver.[[PreferredCodecs]].".

transceiver.[[PreferredCodecs]] are receive codecs set through setCodecPreferences and shouldn't be used to validate send codec.

alvestrand commented 2 weeks ago

Actually [[PreferredCodecs]] includes send codecs if set by this section:

Agree that this is unclear. Ideally, we should validate it over the set of codecs in the remote description, if set; if remote description is not set, it seems to me that it can only be validated over the set of implemented send codecs. (And we may want to include language saying that we enable any implemented send codec that is selected by setParameters).

docfaraday commented 1 week ago

Actually [[PreferredCodecs]] includes send codecs if set by this section:

Agree that this is unclear. Ideally, we should validate it over the set of codecs in the remote description, if set; if remote description is not set, it seems to me that it can only be validated over the set of implemented send codecs. (And we may want to include language saying that we enable any implemented send codec that is selected by setParameters).

I don't see that section setting [[PreferredCodecs]]. It does seem to assume that [[PreferredCodecs]] might contain send codecs, but I do not see anywhere that will put send codecs in there. The language probably needs to be updated to reflect that this will only contain recv codecs.