diff --git a/amendments.json b/amendments.json index 0fca23066..0d8f16ead 100644 --- a/amendments.json +++ b/amendments.json @@ -440,5 +440,14 @@ "status": "candidate", "id": 30 } + ], + "setcodecparameters-algorithm": [ + { + "description": "Fix ambiguities in the setCodecPreferences() algorithm", + "pr": 2847, + "type": "correction", + "status": "candidate", + "id": 31 + } ] } diff --git a/webrtc.html b/webrtc.html index fee0e333b..89bb174de 100644 --- a/webrtc.html +++ b/webrtc.html @@ -11109,18 +11109,13 @@

be removed from the mapping of payload types in the SDP.

- The codecs sequence passed into - {{setCodecPreferences}} can only contain codecs that are - returned by + {{setCodecPreferences}} will reject attempts to set codecs + [= codec match | not matching =] codecs found in {{RTCRtpSender}}.{{RTCRtpSender/getCapabilities}}(kind) or {{RTCRtpReceiver}}.{{RTCRtpReceiver/getCapabilities}}(kind), where kind is the kind of the {{RTCRtpTransceiver}} on which the method is called. - Additionally, the {{RTCRtpCodecCapability}} dictionary - members cannot be modified. If codecs does not - fulfill these requirements, the user agent MUST [= - exception/throw =] an {{InvalidModificationError}}.

Due to a recommendation in [[!SDP]], calls to @@ -11196,9 +11191,10 @@

For each codec in codecs,

    -
  1. If codec is not in - codecCapabilities, throw - {{InvalidModificationError}}. +
  2. +

    If codec does [= codec match | not match any codec =] + in codecCapabilities, throw {{InvalidModificationError}}. +

@@ -11209,6 +11205,47 @@

+

+ The codec match algorithm given two {{RTCRtpCodec}} + first and second is as follows: +

+
    +
  1. +

    + If first.{{RTCRtpCodec/mimeType}} is different from + second.{{RTCRtpCodec/mimeType}}, return false. +

    +
  2. +
  3. +

    + If first.{{RTCRtpCodec/clockRate}} is different from + second.{{RTCRtpCodec/clockRate}}, return false. +

    +
  4. +
  5. +

    + If either (but not both) of first.{{RTCRtpCodec/channels}} + and second.{{RTCRtpCodec/channels}} are [= map/exist | missing =], + or if they both [= map/exist =] and first.{{RTCRtpCodec/channels}} + is different from second.{{RTCRtpCodec/channels}}, return + false. +

    +
  6. +
  7. +

    + If either (but not both) of first.{{RTCRtpCodec/sdpFmtpLine}} + and second.{{RTCRtpCodec/sdpFmtpLine}} are [= map/exist | missing =], + or if they both [=map/exist=] and first.{{RTCRtpCodec/sdpFmtpLine}} + is different from second.{{RTCRtpCodec/sdpFmtpLine}}, return + false. +

    +
  8. +
  9. +

    + Return true. +

    +
  10. +

If set, the offerer's codec preferences will decide the order of the codecs in the offer. If the answerer does not have any