From 3636bc6c4eaf31526cdeadb25f4cfc4691ece5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Bostr=C3=B6m?= Date: Fri, 22 Nov 2024 10:34:33 +0100 Subject: [PATCH] Significant rework of PR --- webrtc.html | 83 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 19 deletions(-) diff --git a/webrtc.html b/webrtc.html index 6a61491c9..63f5e7c83 100644 --- a/webrtc.html +++ b/webrtc.html @@ -2818,9 +2818,9 @@

  • For each encoding in transceiver.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendEncodings]]}}, - if encoding.{{RTCRtpEncodingParameters/codec}} does not - [= codec dictionary match | match =] any entry in codecs, - [=map/remove=] encoding[{{RTCRtpEncodingParameters/codec}}].

    + if encoding.{{RTCRtpEncodingParameters/codec}} does not match any entry in + codecs, using the [= codec dictionary match =] algorithm with ignoreLevels + set to true, [=map/remove=] encoding.{{RTCRtpEncodingParameters/codec}}.

  • @@ -9084,7 +9084,8 @@

  • Any encoding in encodings [=map/exists|contains=] a codec - [= codec dictionary match | not found =] in choosableCodecs. + not found in choosableCodecs, using the [= codec dictionary match =] + algorithm with ignoreLevels set to true.
  • @@ -9789,8 +9790,16 @@

    codec of type RTCRtpCodec
    -

    Optional value selecting which codec is used for this encoding's - RTP stream. If absent, the user agent can chose to use any negotiated codec.

    +

    + Optional value selecting which codec is used for this encoding's + RTP stream. If absent, the user agent can chose to use any negotiated codec. +

    +

    + When {{codec}} is set and {{RTCRtpSender/[[SendCodecs]]}} have been negotiated, + the user agent SHOULD use the first {{RTCRtpSender/[[SendCodecs]]}} matching + {{codec}} for sending, according to the [= codec dictionary match =] algorithm + with ignoreLevels set to true. +

    @@ -11393,7 +11402,7 @@

  • - Remove any [= codec dictionary match | duplicate =] values in + Remove any [= codec dictionary match | duplicate values =] in codecs, ensuring that the first occurrence of each value remains in place.

    @@ -11439,9 +11448,11 @@

  • -

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

    + The codec dictionary match algorithm given two + {{RTCRtpCodec}} dictionaries first and second, and + an ignoreLevels boolean defaulting to false if not + specified, is as follows:

      @@ -11468,19 +11479,53 @@

    1. -

      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. Two FMTP lines are the same as long as they convey the same - information, including omitting parameters with well defined defaults or using - different order. In this step, the user agent MUST NOT consider two FMTP lines - different if "media format" is the same and only the highest complying bitstream - level differs. + return false.

      -
      +
    2. +
    3. +

      + If both first.{{RTCRtpCodec/sdpFmtpLine}} and + second.{{RTCRtpCodec/sdpFmtpLine}} [=map/exist=], run the following + steps: +

      +
        +
      1. +

        + Let firstMediaFormat be a key-value map of the media formats constructed + from first.{{RTCRtpCodec/sdpFmtpLine}} and secondMediaFormat + be a key-value map of the media formats constructed from + second.{{RTCRtpCodec/sdpFmtpLine}}. +

        +

        + Which FMTP parameters make up the media format is codec specific. In some cases + a parameter can be omitted and still be inferred, in which case it is also a part + of the media format of that codec. +

        +
      2. +
      3. +

        + If firstMediaFormat is not equal to secondMediaFormat, return + false. +

        +
      4. +
      5. +
        +

        + If ignoreLevels is false and the highest complying bitstream + levels inferred from first.{{RTCRtpCodec/sdpFmtpLine}} and + second.{{RTCRtpCodec/sdpFmtpLine}} are different, return false. +

        +

        + Even if ignoreLevels is true, some codecs (such as H.264) have + bistream levels that are not distinct from their media formats and as such cannot be + ignored in this algorithm. +

        +
        +
      6. +