From 9499ffa650443b22946a1c788fe351f57805a007 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Tue, 6 Feb 2024 16:44:33 +0100 Subject: [PATCH] Redefine SendCodecs and ReceiveCodecs to contain all supported codecs, revealing only those that are "enabled" at any given time. Fixes: #2925 --- webrtc.html | 73 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/webrtc.html b/webrtc.html index bec6ff19b..7d641ad19 100644 --- a/webrtc.html +++ b/webrtc.html @@ -2246,11 +2246,13 @@

  • - Set - transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[ReceiveCodecs]]}} - to the codecs that description - negotiates for receiving and which the user - agent is currently prepared to receive. + For each of the codecs that description negotiates for receiving: +

      +
    1. Locate the matching codec description in transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[ReceiveCodecs]]}}.
    2. +
    3. If the matching codec description is not found, abort these steps.
    4. +
    5. Set the "enabled" flag in the matching codec description to "true".
    6. +
    +

    If the direction is @@ -2299,13 +2301,15 @@

  • - Set - transceiver.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendCodecs]]}} - to the codecs that description - negotiates for sending and which the user - agent is currently capable of sending, - and set - transceiver.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[LastReturnedParameters]]}} + For each of the codecs that description negotiates for sending, execute the following steps: +

      +
    1. Locate the matching codec description in transceiver.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendCodecs]]}}.
    2. +
    3. If the matching codec description is not found, abort these steps.
    4. +
    5. Set the "enabled" flag in the matching codec description to "true".
    6. +
    +
  • +
  • + Set transceiver.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[LastReturnedParameters]]}} to null.

  • @@ -2573,11 +2577,12 @@

  • - Set - transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[ReceiveCodecs]]}} - to the codecs that description - negotiates for receiving and which the user - agent is currently prepared to receive. + For each of the codecs that description negotiates for receiving: +

      +
    1. Locate the matching codec description in transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[ReceiveCodecs]]}}.
    2. +
    3. If the matching codec description is not found, abort these steps.
    4. +
    5. Set the "enabled" flag in the matching codec description to "true".
    6. +

  • @@ -2590,11 +2595,12 @@

    1. - Set - transceiver.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendCodecs]]}} - to the codecs that description - negotiates for sending and which the user - agent is currently capable of sending. + For each of the codecs that description negotiates for sending: +

        +
      1. Locate the matching codec description in transceiver.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendCodecs]]}}.
      2. +
      3. If the matching codec description is not found, abort these steps.
      4. +
      5. Set the "enabled" flag in the matching codec description to "true".
      6. +

    2. @@ -3787,8 +3793,7 @@

      transceiver.{{RTCRtpTransceiver/direction}} is {{RTCRtpTransceiverDirection/"sendonly"}} or {{RTCRtpTransceiverDirection/"sendrecv"}}, - exclude any codecs not included in the - [=RTCRtpSender/list of implemented send codecs=] for + include all codecs in the transceiver's {{RTCRtpTransceiver/[[Sender]]}}'s {{RTCRtpSender/[[SendCodecs]]}} for which the "enabled" flag is "true". kind.

    3. @@ -3798,9 +3803,7 @@

      transceiver.{{RTCRtpTransceiver/direction}} is {{RTCRtpTransceiverDirection/"recvonly"}} or {{RTCRtpTransceiverDirection/"sendrecv"}}, - exclude any codecs not included in the - [=list of implemented receive codecs=] for - kind. + include all codecs in the transceiver's {{RTCRtpTransceiver/[[Receiver]]}}'s {{RTCRtpReceiver/[[ReceiveCodecs]]}} for which the "enabled" flag is "true".

    @@ -8851,8 +8854,10 @@

  • Let sender have a [[\SendCodecs]] internal - slot, representing a list of {{RTCRtpCodecParameters}} - dictionaries, and initialized to an empty list. + slot, representing a list where each element contains an {{RTCRtpCodecParameters}} + dictionary and an "enabled" boolean, and initialized to the + [=RTCRtpSender/list of implemented send codecs=], with the "enabled" flag + set in an implementation defined manner.

  • @@ -9232,8 +9237,9 @@

  • - {{RTCRtpParameters/codecs}} is set to the value of the - {{RTCRtpSender/[[SendCodecs]]}} internal slot. + {{RTCRtpParameters/codecs}} is set to the codecs from the + {{RTCRtpSender/[[SendCodecs]]}} internal slot where the + "enabled" flag is true.
  • {{RTCRtpParameters/rtcp}}.{{RTCRtcpParameters/cname}} is @@ -10265,7 +10271,9 @@

    Let receiver have a [[\ReceiveCodecs]] internal slot, representing a list of {{RTCRtpCodecParameters}} - dictionaries, and initialized to an empty list. + dictionaries, and initialized to an list containing all the codecs in the + list of implemented receive codecs for kind, and with the "enabled" flag + set in an implementation defined manner.

  • @@ -10427,6 +10435,7 @@

  • {{RTCRtpParameters/codecs}} is set to the value of the + "enabled" codecs from the {{RTCRtpReceiver/[[ReceiveCodecs]]}} internal slot.