Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add [[Mid]] internal slot & separate JSEP state #2505

Merged
merged 4 commits into from
Apr 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 48 additions & 32 deletions webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -1196,19 +1196,23 @@ <h4>Set the RTCSessionDescription</h4>
with a newly [= exception/create | created =]
{{InvalidStateError}} and abort these steps.</p>
</li>
<li>
<p>Let <var>jsepSetOfTransceivers</var> be a shallow copy of
<var>connection</var>'s [=set of transceivers =].</p>
</li>
<li>
<p data-tests="">In parallel, start the process to apply <var>description</var>
as described in <span data-jsep=
"processing-a-local-desc processing-a-remote-desc">[[!JSEP]]</span>,
with the additional restriction that if applying <var>description</var>
leads to modifying a transceiver <var>transceiver</var>, and
<var>transceiver</var>.<a>[[\Sender]]</a>.<a>[[\SendEncodings]]</a>
is non-empty, and not equal to the encodings that would result from
processing <var>description</var>, the process of applying <var>description</var>
fails.
This specification does not allow remotely initiated RID renegotiation.
</p>

as described in <span data-jsep=
"processing-a-local-desc processing-a-remote-desc">[[!JSEP]]</span>,
with these additional restrictions: Use <var>jsepSetOfTransceivers</var>
jan-ivar marked this conversation as resolved.
Show resolved Hide resolved
as the source of truth with regard to what "RtpTransceivers" exist, and
their <a>[[\JsepMid]]</a> internal slot as their "mid property".
If applying <var>description</var>
leads to modifying a transceiver <var>transceiver</var>, and
<var>transceiver</var>.<a>[[\Sender]]</a>.<a>[[\SendEncodings]]</a>
is non-empty, and not equal to the encodings that would result from
processing <var>description</var>, the process of applying <var>description</var>
fails. This specification does not allow remotely initiated RID renegotiation.</p>
<ol>
<li>
<p>If the process to apply <var>description</var> fails for any
Expand Down Expand Up @@ -1449,7 +1453,7 @@ <h4>Set the RTCSessionDescription</h4>
<var>description</var>:</p>
<ol>
<li>
<p>If the [= media description =] is not yet [= associated =]
<p>If the [= media description =] was not yet [= associated =]
with an {{RTCRtpTransceiver}} object then run
the following steps:</p>
<ol>
Expand All @@ -1459,8 +1463,7 @@ <h4>Set the RTCSessionDescription</h4>
[= media description =].</p>
</li>
<li data-tests="RTCPeerConnection-setDescription-transceiver.html,RTCPeerConnection-transceivers.https.html,RTCRtpTransceiver.https.html">
<p>Set <var>transceiver</var>.{{RTCRtpTransceiver/mid}} value to the [= media stream "identification-tag" =] of
the [= media description =].</p>
<p>Set <var>transceiver</var>.<a>[[\Mid]]</a> to <var>transceiver</var>.<a>[[\JsepMid]]</a>.</p>
</li>
<li data-tests="RTCRtpTransceiver-stop.html">
<p>If <var>transceiver</var>.<a>[[\Stopped]]</a>
Expand Down Expand Up @@ -1670,11 +1673,8 @@ <h4>Set the RTCSessionDescription</h4>
</ol>
</li>
<li data-tests="RTCPeerConnection-setDescription-transceiver.html,RTCRtpTransceiver.https.html">
<p>Set <var>transceiver</var>.{{RTCRtpTransceiver/mid}} value to the [= media stream "identification-tag" =] of
the corresponding [= media description =]. If the [=media
description =] has no [= media stream "identification-tag" =], and <var>transceiver</var>.{{RTCRtpTransceiver/mid}}
is unset then generate a random value as described in
<span data-jsep="applying-a-remote-desc">[[!JSEP]]</span>.</p>
<p>Set <var>transceiver</var>.<a>[[\Mid]]</a> to
<var>transceiver</var>.<a>[[\JsepMid]]</a>.</p>
</li>
<li>
<p>Let <var>direction</var> be an
Expand Down Expand Up @@ -1789,7 +1789,9 @@ <h4>Set the RTCSessionDescription</h4>
<p>If the <var>transceiver</var> was not [= associated =] with
a [= media description =] prior to applying the
{{RTCSessionDescription}} that is being rolled
back, disassociate it and set <var>transceiver</var>.{{RTCRtpTransceiver/mid}} value
back, disassociate it and set both
<var>transceiver</var>.<a>[[\JsepMid]]</a> and
<var>transceiver</var>.<a>[[\Mid]]</a>
to <code>null</code>.</p>
</li>
<li>
Expand Down Expand Up @@ -5444,7 +5446,8 @@ <h2>Methods</h2>
<p data-tests="RTCPeerConnection-addTransceiver.https.html">The initial value of {{RTCRtpTransceiver/mid}} is null. Setting a new
{{RTCSessionDescription}} may change it to a
non-null value, as defined in <span data-jsep=
"processing-a-local-desc processing-a-remote-desc">[[!JSEP]]</span>.</p>
"processing-a-local-desc processing-a-remote-desc">[[!JSEP]]</span>
and [= setting an RTCSessionDescription =].</p>
<p data-tests="protocol/simulcast-offer.html">The {{RTCRtpTransceiverInit/sendEncodings}} argument can be used to
specify the number of offered simulcast encodings, and
optionally their RIDs and encoding parameters.</p>
Expand Down Expand Up @@ -7158,10 +7161,16 @@ <h3><dfn>RTCRtpTransceiver</dfn> Interface</h3>
{{RTCRtpReceiver}} that share a common
[= media stream "identification-tag" =]. As defined in <span data-jsep="rtptransceivers">[[!JSEP]]</span>,
an {{RTCRtpTransceiver}} is said to be <dfn>associated</dfn> with
a [= media description =] if its {{RTCRtpTransceiver/mid}}
property is non-null; otherwise it is said to be disassociated. Conceptually, an
[= associated =] transceiver is one that's represented in the last applied session
description.</p>
a [= media description =] if its "mid"
property is non-null and matches a [= media stream "identification-tag" =]
in the [= media description =]; otherwise it is said to be disassociated
with that [= media description =].</p>
<div class="note">
<p>A {{RTCRtpTransceiver}} may become associated with a new pending
description in JSEP while still being disassociated with the current
description. This may happen in [= check if negotiation is needed =].
</p>
</div>
<p>The <dfn>transceiver kind</dfn> of an
{{RTCRtpTransceiver}} is defined by the kind of the
associated {{RTCRtpReceiver}}'s
Expand Down Expand Up @@ -7212,6 +7221,16 @@ <h3><dfn>RTCRtpTransceiver</dfn> Interface</h3>
<p>Let <var>transceiver</var> have a <dfn>[[\PreferredCodecs]]</dfn> internal slot,
initialized to an empty list.</p>
</li>
<li class="untestable">
<p>Let <var>transceiver</var> have a <dfn>[[\JsepMid]]</dfn> internal slot,
initialized to <code>null</code>. This is the "RtpTransceiver mid property" defined in
<span data-jsep="initial-offers initial-answers">[[!JSEP]]</span>, and is only modified
there.</p>
</li>
<li data-tests="RTCRtpTransceiver.https.html">
<p>Let <var>transceiver</var> have a <dfn>[[\Mid]]</dfn> internal slot,
initialized to <code>null</code>.</p>
</li>
<li class="no-test-needed">
<p>Return <var>transceiver</var>.</p>
</li>
Expand Down Expand Up @@ -7242,18 +7261,15 @@ <h2>Attributes</h2>
<dd>
<p>The {{mid}}
attribute is the [= media stream "identification-tag" =] negotiated and present in the
local and remote descriptions as defined in <span data-jsep=
"initial-offers initial-answers">[[!JSEP]]</span>. Before
negotiation is complete, the {{mid}} value may be null.
After rollbacks, the value may change from a non-null value
to null.</p>
local and remote descriptions. On getting, the
attribute MUST return the value of the <a>[[\Mid]]</a> slot.</p>
</dd>
<dt data-tests="RTCPeerConnection-transceivers.https.html,RTCRtpTransceiver.https.html"><dfn data-idl>sender</dfn> of type <span class=
"idlAttrType">{{RTCRtpSender}}</span>, readonly</dt>
<dd>
<p>The {{sender}} attribute exposes the
{{RTCRtpSender}} corresponding to the RTP media
that may be sent with mid = {{mid}}. On getting,
that may be sent with mid = <a>[[\Mid]]</a>. On getting,
the attribute MUST return the value of the <a>[[\Sender]]</a>
slot.</p>
</dd>
Expand All @@ -7262,7 +7278,7 @@ <h2>Attributes</h2>
<dd>
<p>The {{receiver}} attribute is the
{{RTCRtpReceiver}} corresponding to the RTP media
that may be received with mid = {{mid}}. On
that may be received with mid = <a>[[\Mid]]</a>. On
getting the attribute MUST return the value of the
<a>[[\Receiver]]</a> slot.</p>
</dd>
Expand Down