From e975f6c41895593192936c0a44dee173f2a8f54a Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Mon, 21 Aug 2023 16:59:38 -0400 Subject: [PATCH] Queue two tasks upon finishing ICE gathering. --- webrtc.html | 59 +++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/webrtc.html b/webrtc.html index 74ab4fd2d..ebbaa62be 100644 --- a/webrtc.html +++ b/webrtc.html @@ -11898,16 +11898,11 @@

When the [= ICE Agent =] indicates that it began gathering a [= - generation =] of candidates for an {{RTCIceTransport}} transport, the user + generation =] of candidates for an {{RTCIceTransport}} transport + associated with an {{RTCPeerConnection}} connection, the user agent MUST queue a task that runs the following steps:

    -
  1. -

    - Let connection be the {{RTCPeerConnection}} object - associated with transport. -

    -
  2. If connection.{{RTCPeerConnection/[[IsClosed]]}} is @@ -11954,17 +11949,12 @@

When the [= ICE Agent =] is finished gathering a [= generation =] of - candidates for an {{RTCIceTransport}} transport, and those candidates have been - surfaced to the application, the user agent MUST queue a task that - runs the following steps: + candidates for an {{RTCIceTransport}} transport associated + with an {{RTCPeerConnection}} connection, and those candidates have been + surfaced to the application, the user agent MUST queue two tasks. + The first task MUST run the following steps:

    -
  1. -

    - Let connection be the {{RTCPeerConnection}} object - associated with transport. -

    -
  2. If connection.{{RTCPeerConnection/[[IsClosed]]}} is @@ -11973,24 +11963,39 @@

  3. - Let emptyCandidate be the result of [= creating an + Let endOfGatheringCandidate be the result of [= creating an RTCIceCandidate =] with a new dictionary whose {{RTCIceCandidateInit/sdpMid}} and {{RTCIceCandidateInit/sdpMLineIndex}} are set to the values associated with this {{RTCIceTransport}}, {{RTCIceCandidateInit/usernameFragment}} is set to the username fragment of the [= generation =] of candidates for which - gathering finished, and {{RTCIceCandidateInit/candidate}} is set - to an empty string. + gathering finished, and {{RTCIceCandidateInit/candidate}} is set to `""`.

  4. - If another [= generation =] of candidates is still being - gathered, [= fire an event =] named {{RTCPeerConnection/icecandidate}} using the + [= Fire an event =] named {{RTCPeerConnection/icecandidate}} using the {{RTCPeerConnectionIceEvent}} interface with the candidate - attribute set to emptyCandidate at - connection, and abort these steps. + attribute set to endOfGatheringCandidate at + connection. +

    +
  5. +
+

+ The second task MUST run the following steps: +

+
    +
  1. +

    + If connection.{{RTCPeerConnection/[[IsClosed]]}} is + true, abort these steps. +

    +
  2. +
  3. +

    + If another [= generation =] of candidates is still being + gathered, abort these steps.

    This may occur if an ICE restart is initiated while the ICE agent @@ -12021,14 +12026,6 @@

  4. Do not read or modify state beyond this point.

  5. -
  6. -

    - [= Fire an event =] named {{RTCPeerConnection/icecandidate}} using the - {{RTCPeerConnectionIceEvent}} interface with the candidate - attribute set to emptyCandidate at - connection. -

    -
  7. [= Fire an event =] named {{RTCIceTransport/gatheringstatechange}} at