Skip to content

Commit

Permalink
Merge pull request #2801 from jan-ivar/simulcastanswer
Browse files Browse the repository at this point in the history
Prune createAnswer()'s encodings and [[SendEncodings]] in sLD(answer).
  • Loading branch information
jan-ivar authored Dec 13, 2022
2 parents 04bb249 + b5480e2 commit ca339eb
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 14 deletions.
20 changes: 20 additions & 0 deletions amendments.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,5 +365,25 @@
"status": "candidate",
"id": 25
}
],
"apply-local-description": [
{
"description": "Prune createAnswer()'s encodings and SendEncodings in sLD(answer).",
"pr": 2801,
"difftype": "modify",
"type": "correction",
"status": "candidate",
"id": 26
}
],
"create-answer-restrictions": [
{
"description": "Prune createAnswer()'s encodings and SendEncodings in sLD(answer).",
"pr": 2801,
"difftype": "modify",
"type": "correction",
"status": "candidate",
"id": 26
}
]
}
4 changes: 2 additions & 2 deletions base-rec.html
Original file line number Diff line number Diff line change
Expand Up @@ -2773,7 +2773,7 @@ <h5 id="x4-4-1-5-set-the-session-description"><bdi class="secno">4.4.1.5 </bdi>
run the following steps for each <a data-link-type="dfn" href="#dfn-media-description" class="internalDFN" id="ref-for-dfn-media-description-2">media
description</a> in <var>description</var>:
</p>
<ol>
<ol id="apply-local-description">
<li>
<p>
If the <a data-link-type="dfn" href="#dfn-media-description" class="internalDFN" id="ref-for-dfn-media-description-3">media description</a> was not yet <a data-link-type="dfn" href="#dfn-associated" class="internalDFN" id="ref-for-dfn-associated-1">associated</a> with an <a data-link-type="idl" href="#dom-rtcrtptransceiver" class="internalDFN" id="ref-for-dom-rtcrtptransceiver-1"><code><code>RTCRtpTransceiver</code></code></a>
Expand Down Expand Up @@ -4512,7 +4512,7 @@ <h5 id="methods">
generate an SDP answer, <var>sdpString</var>, as
described in <span>[<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc8829" title="JavaScript Session Establishment Protocol (JSEP)">RFC8829</a></cite>] (<a href="https://tools.ietf.org/html/rfc8829#section-5.3">section 5.3.</a>)</span>.
</p>
<ol>
<ol id="create-answer-restrictions">
<li>
<p>
The <i>codec preferences</i> of an m= section's
Expand Down
69 changes: 57 additions & 12 deletions webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2134,7 +2134,7 @@ <h4>
run the following steps for each [= media
description =] in <var>description</var>:
</p>
<ol>
<ol id="apply-local-description">
<li>
<p>
If the [= media description =] was not yet [=
Expand Down Expand Up @@ -2259,6 +2259,35 @@ <h4>
following steps:
</p>
<ol>
<li>
<p>
If <var>transceiver</var>.
{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendEncodings]]}}
.length is greater than <code>1</code>, then
run the following steps:
</p>
<ol>
<li>
<p>
If <var>description</var> is missing
all of the previously negotiated layers,
then remove all dictionaries in
<var>transceiver</var>.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendEncodings]]}}
except the first one, and skip the next
step.
</p>
</li>
<li>
<p>
If <var>description</var> is missing any of
the previously negototiated layers, then
remove the dictionaries that correspond to
the missing layers from
<var>transceiver</var>.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendEncodings]]}}.
</p>
</li>
</ol>
</li>
<li>
<p>
Set
Expand Down Expand Up @@ -3977,7 +4006,7 @@ <h2>
described in <span data-jsep=
"generating-an-answer">[[!RFC8829]]</span>.
</p>
<ol>
<ol id="create-answer-restrictions">
<li>
<p>
The <i>codec preferences</i> of an m= section's
Expand Down Expand Up @@ -4023,17 +4052,33 @@ <h2>
</li>
<li>
<p>
If the length of the {{RTCRtpSender/[[SendEncodings]]}} slot
of the {{RTCRtpSender}} is larger than 1, then for
each encoding given in {{RTCRtpSender/[[SendEncodings]]}} of
the {{RTCRtpSender}}, add an <code class=
"sdp">a=rid send</code> line to the corresponding
media section, and add an <code class=
"sdp">a=simulcast:send</code> line giving the RIDs
in the same order as given in the
{{RTCRtpSendParameters/encodings}} field. No RID
restrictions are set.
If this is an answer to an offer to receive
simulcast, then for each media section requesting
to receive simulcast, exclude from the media section
in the answer any RID not found in the corresponding
transceiver's
{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendEncodings]]}}.
If there are any identically named RIDs in the
<code class="sdp">a=simulcast</code> attribute, remove all
duplicates except the first one. No RID restrictions are set.
</p>
<div class="note">
<p>
When a
{{RTCPeerConnection/setRemoteDescription(offer)}}
establishes a transceiver's [=simulcast envelope=],
the transceiver's
{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendEncodings]]}}
is updated in
{{RTCSignalingState/"have-remote-offer"}}. However,
once a simulcast envelope has been established for
the transceiver, subsequent pruning of the
transceiver's
{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendEncodings]]}}
happen when this answer is set with
{{RTCPeerConnection/setLocalDescription}}.
</p>
</div>
</li>
</ol>
</li>
Expand Down

0 comments on commit ca339eb

Please sign in to comment.