From 70aa381243e200039db61d92ca65b282a59dda75 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Wed, 8 May 2024 12:37:07 +0200 Subject: [PATCH 01/10] Separate Send/ReceiveCodecs and NegotiatedCodecs This makes it unambiguous what to return in RTCRtpSender/Receiver's getParameters() function (null before negotiation, filled in after) Fixes: 2956 --- webrtc.html | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/webrtc.html b/webrtc.html index f31a14958..8483e49d3 100644 --- a/webrtc.html +++ b/webrtc.html @@ -1864,9 +1864,9 @@

  • Set - transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[LastStableStateReceiveCodecs]]}} + transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[LastStableStateNegotiatedCodecs]]}} to - transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[ReceiveCodecs]]}}. + transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[NegotiatedCodecs]]}}.

  • @@ -2189,11 +2189,15 @@

  • - For each of the codecs that description negotiates for receiving, execute the following steps: + Clear the transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[NegotiatedCodecs]]}} slot. +

    +

    + Then, For each of the codecs that description negotiates for receiving, execute the following steps:

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

    @@ -2244,11 +2248,15 @@

  • - For each of the codecs that description negotiates for sending, execute the following steps: + Clear the transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[NegotiatedCodecs]]}} slot. +

    +

    + Then, 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. If the matching codec description is not found, abort these steps.
    3. Set the "enabled" flag in the matching codec description to "true".
    4. +
    5. Add the codec description to the {{RTCRtpReceiver/[[NegotiatedCodecs]]}} internal slot.
  • @@ -2693,9 +2701,9 @@

  • Set - transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[ReceiveCodecs]]}} + transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[NegotiatedCodecs]]}} to - transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[LastStableStateReceiveCodecs]]}}. + transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[LastStableStateNegotiatedCodecs]]}}.

  • @@ -8800,6 +8808,10 @@

    [=RTCRtpSender/list of implemented send codecs=], with the "enabled" flag set in an implementation defined manner.

    +

  • +

    + Let sender have a [[\NegotiatedCodecs]] internal slot, consisting of {{RTCRtpCodecParameters}}, and initialized to an empty list. +

  • @@ -9188,8 +9200,7 @@

  • {{RTCRtpParameters/codecs}} is set to the codecs from the - {{RTCRtpSender/[[SendCodecs]]}} internal slot where the - "enabled" flag is true. + {{RTCRtpSender/[[NegotiatedCodecs]]}} internal slot.
  • {{RTCRtpParameters/rtcp}}.{{RTCRtcpParameters/cname}} is @@ -10225,11 +10236,14 @@

    list of implemented receive codecs for kind, and with the "enabled" flag set in an implementation defined manner.

    +

    + Let receiver have a [[\NegotiatedCodecs]] internal slot, consisting of {{RTCRtpCodecParameters}}, and initialized to an empty list. +

  • Let receiver have a - [[\LastStableStateReceiveCodecs]] internal slot and + [[\LastStableStateNegotiatedCodecs]] internal slot and initialize it to an empty list.

  • @@ -10507,7 +10521,7 @@

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

    Both the local and remote description may affect this From 50bc2186b8d615dfcbdeb45c0a53e2cb01cb8729 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Wed, 8 May 2024 13:06:18 +0200 Subject: [PATCH 02/10] Fix markup. Set NegotiatedCodecs only on answers for both senders and receivers. --- webrtc.html | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/webrtc.html b/webrtc.html index 8483e49d3..8519952b7 100644 --- a/webrtc.html +++ b/webrtc.html @@ -2187,28 +2187,6 @@

    false.

  • -
  • -

    - Clear the transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[NegotiatedCodecs]]}} slot. -

    -

    - Then, For each of the codecs that description negotiates for receiving, execute the following steps: -

      -
    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. -
    7. Add the codec description to the {{RTCRtpReceiver/[[NegotiatedCodecs]]}} internal slot.
    8. -
    - -

    -

    - If the direction is - {{RTCRtpTransceiverDirection/"sendonly"}} or - {{RTCRtpTransceiverDirection/"inactive"}}, - the receiver is not prepared to receive - anything, and the list will be empty. -

    -
  • If description is of type @@ -2248,17 +2226,37 @@

  • - Clear the transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[NegotiatedCodecs]]}} slot. -

    -

    + Clear the transceiver.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[NegotiatedCodecs]]}} slot. +
    Then, 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. If the matching codec description is not found, abort these steps.
    3. Set the "enabled" flag in the matching codec description to "true".
    4. -
    5. Add the codec description to the {{RTCRtpReceiver/[[NegotiatedCodecs]]}} internal slot.
    6. +
    7. Add the codec description to the sender's {{RTCRtpSender/[[NegotiatedCodecs]]}} internal slot.
  • +
  • +

    + Clear the transceiver.{{RTCRtpTransceiver/[[Receiver]]}}.{{RTCRtpReceiver/[[NegotiatedCodecs]]}} slot. +
    + Then, for each of the codecs that description negotiates for receiving, execute the following steps: +

      +
    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. +
    7. Add the codec description to the receiver's {{RTCRtpReceiver/[[NegotiatedCodecs]]}} internal slot.
    8. +
    + +

    +

    + If the direction is + {{RTCRtpTransceiverDirection/"sendonly"}} or + {{RTCRtpTransceiverDirection/"inactive"}}, + the receiver is not prepared to receive + anything, and the list will be empty. +

    +
  • Set transceiver.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[LastReturnedParameters]]}} to null. From be077ac60ffe66b0ca198ada7a0c249dc56d9096 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Mon, 13 May 2024 07:35:03 +0200 Subject: [PATCH 03/10] Fix html bug --- webrtc.html | 1 - 1 file changed, 1 deletion(-) diff --git a/webrtc.html b/webrtc.html index 8519952b7..8938f2605 100644 --- a/webrtc.html +++ b/webrtc.html @@ -8806,7 +8806,6 @@

    [=RTCRtpSender/list of implemented send codecs=], with the "enabled" flag set in an implementation defined manner.

    -

  • Let sender have a [[\NegotiatedCodecs]] internal slot, consisting of {{RTCRtpCodecParameters}}, and initialized to an empty list.

    From 2da8426eaf5a18694b37e26f9ad74e0256921c0f Mon Sep 17 00:00:00 2001 From: Dominique Hazael-Massieux Date: Mon, 13 May 2024 11:41:38 +0200 Subject: [PATCH 04/10] Improve error communicate in amemendment checker --- tools/check-rec-amendment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/check-rec-amendment.js b/tools/check-rec-amendment.js index 826f03280..c8d1ffb84 100644 --- a/tools/check-rec-amendment.js +++ b/tools/check-rec-amendment.js @@ -10,10 +10,10 @@ module.exports = async ({github, context, core}) => { } const amendments = require(process.env.GITHUB_WORKSPACE + '/amendments.json'); const prAmendmentSection = Object.values(amendments).find(list => list.find(a => Array.isArray(a.pr) ? a.pr.includes(context.issue.number) : a.pr === context.issue.number )); - const prAmendment = prAmendmentSection.find(a => Array.isArray(a.pr) ? a.pr.includes(context.issue.number) : a.pr === context.issue.number ); - if (!prAmendment) { + if (!prAmendmentSection) { core.setFailed(`Pull request ${context.issue.number} not labeled as editorial and not referenced in amendments.json`); } + const prAmendment = prAmendmentSection.find(a => Array.isArray(a.pr) ? a.pr.includes(context.issue.number) : a.pr === context.issue.number ); if (!prAmendment.testUpdates || !prAmendment.testUpdates.length === 0) { core.setFailed(`Pull request ${context.issue.number} declares an amendment but does not document its test status in testUpdates`); } From 805ca44aefffd5edb58243590a259e3d7832653f Mon Sep 17 00:00:00 2001 From: Dominique Hazael-Massieux Date: Mon, 13 May 2024 11:43:06 +0200 Subject: [PATCH 05/10] Improve error communicate in amemendment checker --- tools/check-rec-amendment.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/check-rec-amendment.js b/tools/check-rec-amendment.js index c8d1ffb84..fa1b0818f 100644 --- a/tools/check-rec-amendment.js +++ b/tools/check-rec-amendment.js @@ -12,16 +12,20 @@ module.exports = async ({github, context, core}) => { const prAmendmentSection = Object.values(amendments).find(list => list.find(a => Array.isArray(a.pr) ? a.pr.includes(context.issue.number) : a.pr === context.issue.number )); if (!prAmendmentSection) { core.setFailed(`Pull request ${context.issue.number} not labeled as editorial and not referenced in amendments.json`); + process.exit(2); } const prAmendment = prAmendmentSection.find(a => Array.isArray(a.pr) ? a.pr.includes(context.issue.number) : a.pr === context.issue.number ); if (!prAmendment.testUpdates || !prAmendment.testUpdates.length === 0) { core.setFailed(`Pull request ${context.issue.number} declares an amendment but does not document its test status in testUpdates`); + process.exit(2); } const validTestUpdates = ["already-tested", "not-testable"]; if (typeof prAmendment.testUpdates === "string" && !validTestUpdates.includes(prAmendment.testUpdates)) { core.setFailed(`Pull request ${context.issue.number} declares an invalid test status in its amendment testUpdates field`); + process.exit(2); } if (Array.isArray(prAmendment.testUpdates) && !prAmendment.testUpdates.every(t => t.match(/^web-platform-tests\/wpt#[0-9]+$/))) { core.setFailed(`Pull request ${context.issue.number} declares test updates but not using the expected format to point to web-platform-tests PRs: "web-platform-tests/wpt#NNN"`); + process.exit(2); } }; From 8991050c073bf7d746c1550b268e8dfcd44f30be Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Tue, 21 May 2024 15:02:30 +0200 Subject: [PATCH 06/10] Attempt at amendments.json --- amendments.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/amendments.json b/amendments.json index 8a86a36e0..c846d097d 100644 --- a/amendments.json +++ b/amendments.json @@ -605,6 +605,13 @@ "status": "candidate", "id": 26 } + { + "description": "Separate Send/ReceiveCodecs and NegotiatedCodecs.", + "pr": 2972, + "difftype": "modify", + "type": "correction", + "status": "candidate", + "id": 47 ], "create-answer-restrictions": [ { @@ -841,6 +848,14 @@ "type": "addition", "status": "candidate", "id": 41 + }, + { + "description": "Separate Send/ReceiveCodecs and NegotiatedCodecs.", + "pr": 2972, + "difftype": "modify", + "type": "correction", + "status": "candidate", + "id": 47 } ], "rtcrtpreceiver-laststablestatereceivecodecs": [ From 10bc2077ae951187de0fd32b8db505a63d36c5af Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Wed, 22 May 2024 12:03:35 +0200 Subject: [PATCH 07/10] Fix syntax error --- amendments.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/amendments.json b/amendments.json index c846d097d..93615c7a8 100644 --- a/amendments.json +++ b/amendments.json @@ -604,7 +604,7 @@ "type": "correction", "status": "candidate", "id": 26 - } + }, { "description": "Separate Send/ReceiveCodecs and NegotiatedCodecs.", "pr": 2972, @@ -612,6 +612,7 @@ "type": "correction", "status": "candidate", "id": 47 + } ], "create-answer-restrictions": [ { From 62f77eb6a1abb534e58b44419486c03fe0a0c26d Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Thu, 20 Jun 2024 16:26:17 +0200 Subject: [PATCH 08/10] Reference test --- amendments.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/amendments.json b/amendments.json index 93615c7a8..55340c0d4 100644 --- a/amendments.json +++ b/amendments.json @@ -609,6 +609,13 @@ "description": "Separate Send/ReceiveCodecs and NegotiatedCodecs.", "pr": 2972, "difftype": "modify", + "tests": [ + "webrtc/RTCRtpSender-getParameters.html", + "webrtc/RTCRtpReceiver-getParameters.html", + ], + "testUpdates": [ + "web-platform-tests/wpt#46840" + ], "type": "correction", "status": "candidate", "id": 47 From 8dacfdca6e3ae8e57d3d8d502bf50fdb5ee01793 Mon Sep 17 00:00:00 2001 From: Dominique Hazael-Massieux Date: Fri, 21 Jun 2024 10:26:17 +0200 Subject: [PATCH 09/10] Fix JSON in amendments.json --- amendments.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amendments.json b/amendments.json index 55340c0d4..2fa1863ae 100644 --- a/amendments.json +++ b/amendments.json @@ -611,7 +611,7 @@ "difftype": "modify", "tests": [ "webrtc/RTCRtpSender-getParameters.html", - "webrtc/RTCRtpReceiver-getParameters.html", + "webrtc/RTCRtpReceiver-getParameters.html" ], "testUpdates": [ "web-platform-tests/wpt#46840" From ea357214bc624ec385c346b688ec4c5885a3fad4 Mon Sep 17 00:00:00 2001 From: Dominique Hazael-Massieux Date: Fri, 21 Jun 2024 11:28:39 +0200 Subject: [PATCH 10/10] Simplify data in amendments --- amendments.json | 1 - 1 file changed, 1 deletion(-) diff --git a/amendments.json b/amendments.json index 2fa1863ae..64822e39d 100644 --- a/amendments.json +++ b/amendments.json @@ -860,7 +860,6 @@ { "description": "Separate Send/ReceiveCodecs and NegotiatedCodecs.", "pr": 2972, - "difftype": "modify", "type": "correction", "status": "candidate", "id": 47