Skip to content

Commit

Permalink
Modify the change of selected pair algo in RTCIceTransport.
Browse files Browse the repository at this point in the history
This ensures that each candidate pair has a unique identity, simplifying
the validation of RTCIceCandidatePair arguments to RTCIceTransport
methods.
  • Loading branch information
sam-vi authored and dontcallmedom committed Oct 15, 2024
1 parent 83d5a3c commit cd26c2a
Showing 1 changed file with 63 additions and 52 deletions.
115 changes: 63 additions & 52 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1043,58 +1043,69 @@ <h4>Dictionary <dfn>RTCIceCandidatePairEventInit</dfn> Members</h4>
</section>
</div>
</section>
<p>
The <dfn class="export">candidate match</dfn> algorithm given two {{RTCIceCandidate}} |first:RTCIceCandidate| and
|second:RTCIceCandidate| is as follows:
</p>
<ol class="algorithm">
<li>
<p>
If |first|.{{RTCIceCandidate/candidate}} is not [= string/identical to =] |second|.{{RTCIceCandidate/candidate}}, return <code>false</code>.
</p>
</li>
<li>
<p>
If either (but not both) of |first|.{{RTCIceCandidate/sdpMid}} and |second|.{{RTCIceCandidate/sdpMid}} is
<code>null</code>, return <code>false</code>.
</p>
</li>
<li>
<p>
If neither of |first|.{{RTCIceCandidate/sdpMid}} and |second|.{{RTCIceCandidate/sdpMid}} is <code>null</code>, and |first|.{{RTCIceCandidate/sdpMid}} is not [= string/identical to =]
|second|.{{RTCIceCandidate/sdpMid}}, return <code>false</code>.
</p>
</li>
<li>
<p>
If either (but not both) of |first|.{{RTCIceCandidate/sdpMLineIndex}} and |second|.{{RTCIceCandidate/sdpMLineIndex}} is
<code>null</code>, return <code>false</code>.
</p>
</li>
<li>
<p>
If neither of |first|.{{RTCIceCandidate/sdpMLineIndex}} and |second|.{{RTCIceCandidate/sdpMLineIndex}} is <code>null</code> and |first|.{{RTCIceCandidate/sdpMLineIndex}} is not equal to
|second|.{{RTCIceCandidate/sdpMLineIndex}}, return <code>false</code>.
</p>
</li>
<li>
<p>
If either (but not both) of |first|.{{RTCIceCandidate/usernameFragment}} and |second|.{{RTCIceCandidate/usernameFragment}} is
<code>null</code>, return <code>false</code>.
</p>
</li>
<li>
<p>
If neither of |first|.{{RTCIceCandidate/usernameFragment}} and |second|.{{RTCIceCandidate/usernameFragment}} is <code>null</code> and |first|.{{RTCIceCandidate/usernameFragment}} is not [= string/identical to =]
|second|.{{RTCIceCandidate/usernameFragment}}, return <code>false</code>.
</p>
</li>
<li>
<p>
Return <code>true</code>.
</p>
</li>
</ol>
<section id="rtcicetransport-change-pair-state-modifications">
<h2>Modifications to existing procedures</h2>
<p>
In the steps to [=RTCIceTransport/change the selected candidate pair and state=], if the selected candidate pair was changed, modify the first step to the following:
</p>
<ol class="algorithm">
<li>
Let <var>newCandidatePair</var> be the [= list/item =] [= list/contained =] in |this|.{{RTCIceTransport/[[CandidatePairs]]}} whose {{RTCIceCandidatePair/local}} and {{RTCIceCandidatePair/remote}} attributes respectively [= candidate match | match =] the local and remote candidates of the indicated pair if one is selected, and <code>null</code> otherwise.
</li>
</ol>
<p>
The <dfn class="export">candidate match</dfn> algorithm given two {{RTCIceCandidate}} |first:RTCIceCandidate| and
|second:RTCIceCandidate| is as follows:
</p>
<ol class="algorithm">
<li>
<p>
If |first|.{{RTCIceCandidate/candidate}} is not [= string/identical to =] |second|.{{RTCIceCandidate/candidate}}, return <code>false</code>.
</p>
</li>
<li>
<p>
If either (but not both) of |first|.{{RTCIceCandidate/sdpMid}} and |second|.{{RTCIceCandidate/sdpMid}} is
<code>null</code>, return <code>false</code>.
</p>
</li>
<li>
<p>
If neither of |first|.{{RTCIceCandidate/sdpMid}} and |second|.{{RTCIceCandidate/sdpMid}} is <code>null</code>, and |first|.{{RTCIceCandidate/sdpMid}} is not [= string/identical to =]
|second|.{{RTCIceCandidate/sdpMid}}, return <code>false</code>.
</p>
</li>
<li>
<p>
If either (but not both) of |first|.{{RTCIceCandidate/sdpMLineIndex}} and |second|.{{RTCIceCandidate/sdpMLineIndex}} is
<code>null</code>, return <code>false</code>.
</p>
</li>
<li>
<p>
If neither of |first|.{{RTCIceCandidate/sdpMLineIndex}} and |second|.{{RTCIceCandidate/sdpMLineIndex}} is <code>null</code> and |first|.{{RTCIceCandidate/sdpMLineIndex}} is not equal to
|second|.{{RTCIceCandidate/sdpMLineIndex}}, return <code>false</code>.
</p>
</li>
<li>
<p>
If either (but not both) of |first|.{{RTCIceCandidate/usernameFragment}} and |second|.{{RTCIceCandidate/usernameFragment}} is
<code>null</code>, return <code>false</code>.
</p>
</li>
<li>
<p>
If neither of |first|.{{RTCIceCandidate/usernameFragment}} and |second|.{{RTCIceCandidate/usernameFragment}} is <code>null</code> and |first|.{{RTCIceCandidate/usernameFragment}} is not [= string/identical to =]
|second|.{{RTCIceCandidate/usernameFragment}}, return <code>false</code>.
</p>
</li>
<li>
<p>
Return <code>true</code>.
</p>
</li>
</ol>
</section>
</section>
<section id="rtcrtpcontributingsource-extensions">
<h3>
Expand Down

0 comments on commit cd26c2a

Please sign in to comment.