Skip to content

Commit

Permalink
Significant rework of PR
Browse files Browse the repository at this point in the history
  • Loading branch information
henbos committed Nov 22, 2024
1 parent 46142bd commit 3636bc6
Showing 1 changed file with 64 additions and 19 deletions.
83 changes: 64 additions & 19 deletions webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2818,9 +2818,9 @@ <h4>
<li>
<p>For each <var>encoding</var> in
<var>transceiver</var>.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendEncodings]]}},
if <var>encoding</var>.{{RTCRtpEncodingParameters/codec}} does not
[= codec dictionary match | match =] any entry in <var>codecs</var>,
[=map/remove=] <var>encoding</var>[{{RTCRtpEncodingParameters/codec}}].</p>
if <var>encoding</var>.{{RTCRtpEncodingParameters/codec}} does not match any entry in
<var>codecs</var>, using the [= codec dictionary match =] algorithm with <var>ignoreLevels</var>
set to <code>true</code>, [=map/remove=] <var>encoding</var>.{{RTCRtpEncodingParameters/codec}}.</p>
</li>
</ol>
</li>
Expand Down Expand Up @@ -9084,7 +9084,8 @@ <h2>
</li>
<li id="setparameters-codec-validation-4">
Any <var>encoding</var> in encodings [=map/exists|contains=] a codec
[= codec dictionary match | not found =] in <var>choosableCodecs</var>.
not found in <var>choosableCodecs</var>, using the [= codec dictionary match =]
algorithm with <var>ignoreLevels</var> set to <code>true</code>.
</li>
</ul>
</li>
Expand Down Expand Up @@ -9789,8 +9790,16 @@ <h2>
<dfn data-idl>codec</dfn> of type <span class="idlMemberType">RTCRtpCodec</span>
</dt>
<dd>
<p>Optional value selecting which codec is used for this encoding's
RTP stream. If absent, the user agent can chose to use any negotiated codec.</p>
<p>
Optional value selecting which codec is used for this encoding's
RTP stream. If absent, the user agent can chose to use any negotiated codec.
</p>
<p>
When {{codec}} is set and {{RTCRtpSender/[[SendCodecs]]}} have been negotiated,
the user agent SHOULD use the first {{RTCRtpSender/[[SendCodecs]]}} matching
{{codec}} for sending, according to the [= codec dictionary match =] algorithm
with <var>ignoreLevels</var> set to <code>true</code>.
</p>
</dd>
</div>
<div>
Expand Down Expand Up @@ -11393,7 +11402,7 @@ <h2>
</li>
<li>
<p>
Remove any [= codec dictionary match | duplicate =] values in
Remove any [= codec dictionary match | duplicate values =] in
<var>codecs</var>, ensuring that the first occurrence of each
value remains in place.
</p>
Expand Down Expand Up @@ -11439,9 +11448,11 @@ <h2>
</ol>
</div>
<div id="codecmatch-algorithm">
<p> The <dfn class="export">codec dictionary match</dfn> algorithm
given two {{RTCRtpCodec}} dictionaries
<var>first</var> and <var>second</var> is as follows:
<p>
The <dfn class="export">codec dictionary match</dfn> algorithm given two
{{RTCRtpCodec}} dictionaries <var>first</var> and <var>second</var>, and
an <var>ignoreLevels</var> boolean defaulting to <code>false</code> if not
specified, is as follows:
</p>
</div>
<ol class=algorithm>
Expand All @@ -11468,19 +11479,53 @@ <h2>
</p>
</li>
<li>
<div id="codec-match-without-level-id">
<p>
If either (but not both) of <var>first</var>.{{RTCRtpCodec/sdpFmtpLine}}
and <var>second</var>.{{RTCRtpCodec/sdpFmtpLine}} are [= map/exist | missing =],
or if they both [=map/exist=] and <var>first</var>.{{RTCRtpCodec/sdpFmtpLine}}
is different from <var>second</var>.{{RTCRtpCodec/sdpFmtpLine}}, return
<code>false</code>. Two FMTP lines are the same as long as they convey the same
information, including omitting parameters with well defined defaults or using
different order. In this step, the user agent MUST NOT consider two FMTP lines
different if "media format" is the same and only the highest complying bitstream
level differs.
return <code>false</code>.
</p>
</div>
</li>
<li>
<p>
If both <var>first</var>.{{RTCRtpCodec/sdpFmtpLine}} and
<var>second</var>.{{RTCRtpCodec/sdpFmtpLine}} [=map/exist=], run the following
steps:
</p>
<ol>
<li>
<p>
Let <var>firstMediaFormat</var> be a key-value map of the media formats constructed
from <var>first</var>.{{RTCRtpCodec/sdpFmtpLine}} and <var>secondMediaFormat</var>
be a key-value map of the media formats constructed from
<var>second</var>.{{RTCRtpCodec/sdpFmtpLine}}.
</p>
<p class="note">
Which FMTP parameters make up the media format is codec specific. In some cases
a parameter can be omitted and still be inferred, in which case it is also a part
of the media format of that codec.
</p>
</li>
<li>
<p>
If <var>firstMediaFormat</var> is not equal to <var>secondMediaFormat</var>, return
<code>false</code>.
</p>
</li>
<li>
<div id="codec-match-without-level-id">
<p>
If <var>ignoreLevels</var> is <code>false</code> and the highest complying bitstream
levels inferred from <var>first</var>.{{RTCRtpCodec/sdpFmtpLine}} and
<var>second</var>.{{RTCRtpCodec/sdpFmtpLine}} are different, return <code>false</code>.
</p>
<p class="note">
Even if <var>ignoreLevels</var> is <code>true</code>, some codecs (such as H.264) have
bistream levels that are not distinct from their media formats and as such cannot be
ignored in this algorithm.
</p>
</div>
</li>
</ol>
</li>
<li>
<p>
Expand Down

0 comments on commit 3636bc6

Please sign in to comment.