[webrtc-pc] Shouldn't call sender/receiver.getCapabilities() from other algorithms (#2849)

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

== Shouldn't call sender/receiver.getCapabilities() from other algorithms ==
[RTCRtpSender.getCapabilities](https://w3c.github.io/webrtc-pc/#dom-rtcrtpsender-getcapabilities) and [RTCRtpSender.getCapabilities](https://w3c.github.io/webrtc-pc/#dom-rtcrtpreceiver-getcapabilities) lack algorithms.

Because of this, other methods end up referring to their output: _"The codecs sequence passed into [setCodecPreferences](https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-setcodecpreferences) can only contain codecs that are returned by [RTCRtpSender](https://w3c.github.io/webrtc-pc/#dom-rtcrtpsender).[getCapabilities](https://w3c.github.io/webrtc-pc/#dom-rtcrtpsender-getcapabilities)(kind) or [RTCRtpReceiver](https://w3c.github.io/webrtc-pc/#dom-rtcrtpreceiver).[getCapabilities](https://w3c.github.io/webrtc-pc/#dom-rtcrtpreceiver-getcapabilities)(kind),"_

It's usually bad to imply that one WebIDL method call into another.

I thought about adding an internal slot, but this being a static method there's no obvious object to pin it to, so an internal algorithm seems the way to go.

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


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

Received on Wednesday, 29 March 2023 19:08:51 UTC