Skip to content

Commit

Permalink
Merge pull request #2985 from Orphis/codec
Browse files Browse the repository at this point in the history
Merge RTCRtpEncodingParameters.codec from webrtc-extensions
  • Loading branch information
Orphis authored Aug 22, 2024
2 parents 465acc6 + 35c676b commit 7f95b53
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
16 changes: 16 additions & 0 deletions amendments.json
Original file line number Diff line number Diff line change
Expand Up @@ -950,5 +950,21 @@
],
"id": 45
}
],
"rtcrtpencodingparamters-attributes-active": [
{
"description": "Add codec to RTCRtpEncodingParameters, moved from webrtc-extensions",
"type": "addition",
"status": "candidate",
"difftype": "append",
"id": 47,
"pr": 2985,
"tests": [
"webrtc/RTCRtpParameters-codec.html"
],
"testUpdates": [
"web-platform-tests/wpt#47663"
]
}
]
}
2 changes: 1 addition & 1 deletion base-rec.html
Original file line number Diff line number Diff line change
Expand Up @@ -9716,7 +9716,7 @@ <h5 id="dictionary-rtcrtpencodingparameters-members">
<dfn data-idl="field" data-export="" data-dfn-type="dict-member" id="dom-rtcrtpencodingparameters-active" data-title="active" data-dfn-for="RTCRtpEncodingParameters" data-type="boolean"><code>active</code></dfn> of type <span class="idlMemberType">boolean</span>, defaulting to
<code>true</code>
</dt>
<dd>
<dd id="rtcrtpencodingparamters-attributes-active">
<p>
Indicates that this encoding is actively being sent.
Setting it to <code>false</code> causes this encoding to no
Expand Down
60 changes: 59 additions & 1 deletion webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2811,6 +2811,23 @@ <h4>
firing on these objects in a queued task.
</p>
</li>
<li>
<p>For each <var>transceiver</var> in <var>connection</var>'s [= set of transceivers =]:</p>
<ol>
<li>
<p>Let <var>codecs</var> be <var>transceiver</var>.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendCodecs]]}}.</p>
</li>
<li>
<p>If <var>codecs</var> is not an empty list:</p>
<ol>
<li>
<p>Remove any <var>codec</var> value in <var>transceiver</var>.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendEncodings]]}}
that does not [= codec dictionary match | match =] any entry in <var>codecs</var>.</p>
</li>
</ol>
</li>
</ol>
</li>
<li data-tests=
"RTCPeerConnection-onnegotiationneeded.html">
<p>
Expand Down Expand Up @@ -8210,6 +8227,17 @@ <h2>
an {{InvalidAccessError}}.
</p>
</li>
<li>
<p>
If any <var>codec</var> parameter in <var>sendEncodings</var> does
[= codec dictionary match | not match =] any codec in {{RTCRtpSender.getCapabilities(kind)}}.<code>codecs</code>,
[= exception/throw =] an {{OperationError}}.</p>
</li>
<li>
<p>If the user agent does not support changing codecs without negotiation or
does not support setting codecs for individual encodings, return a promise
[= rejected =] with a newly [= exception/created =] {{OperationError}}.</p>
</li>
<li data-tests="RTCRtpParameters-encodings.html">
<p>
If <var>kind</var> is `"audio"`, remove the
Expand Down Expand Up @@ -8997,6 +9025,17 @@ <h2>
<li class="no-test-needed">Let <var>codecs</var> be <var>
parameters</var>.{{RTCRtpParameters/codecs}}.
</li>
<li>
<p>Let <var>choosableCodecs</var> be <var>codecs</var>.</p>
</li>
<li>
<p>If <var>choosableCodecs</var> is an empty list, set <var>choosableCodecs</var>
to transceiver.{{RTCRtpTransceiver/[[PreferredCodecs]]}}.</p>
</li>
<li>
<p>If <var>choosableCodecs</var> is still an empty list, set <var>choosableCodecs</var>
to the [=RTCRtpSender/list of implemented send codecs=] for transceiver's kind.</p>
</li>
<li class="no-test-needed">Let <var>N</var> be the number
of {{RTCRtpEncodingParameters}} stored in
<var>sender</var>.{{RTCRtpSender/[[SendEncodings]]}}.
Expand All @@ -9022,6 +9061,10 @@ <h2>
Note that this also applies to
<var>transactionId</var>.
</li>
<li>
Any <var>encoding</var> in encodings [=map/exists|contains=] a codec
[= codec dictionary match | not found =] in <var>choosableCodecs</var>.
</li>
</ul>
</li>
<li data-tests="RTCRtpParameters-encodings.html">
Expand Down Expand Up @@ -9066,6 +9109,12 @@ <h2>
exception/created =] {{RangeError}}.
</p>
</li>
<li>
<p>If the user agent does not support setting the codec for any encoding or mixing
different codec values on the different encodings, return a promise [= rejected =]
with a newly [= exception/created =] {{OperationError}}.
</p>
</li>
</ol>
</li>
<li class="no-test-needed">Let <var>p</var> be a new promise.
Expand Down Expand Up @@ -9685,6 +9734,7 @@ <h3>
<div>
<pre class="idl" id="webidl-rtcrtpencodingparameters">dictionary RTCRtpEncodingParameters : RTCRtpCodingParameters {
boolean active = true;
RTCRtpCodec codec;
unsigned long maxBitrate;
double maxFramerate;
double scaleResolutionDownBy;
Expand All @@ -9701,7 +9751,7 @@ <h2>
"idlMemberType">boolean</span>, defaulting to
<code>true</code>
</dt>
<dd>
<dd id="rtcrtpencodingparamters-attributes-active">
<p>
Indicates that this encoding is actively being sent.
Setting it to <code>false</code> causes this encoding to no
Expand All @@ -9711,6 +9761,14 @@ <h2>
an RTCP BYE is not sent.
</p>
</dd>
<dt class="add-to-rtcrtpencodingparamters-attributes-active"
data-tests="RTCRtpParameters-codec.html">
<dfn data-idl>codec</dfn> of type <span class="idlMemberType">RTCRtpCodec</span>
</dt>
<dd class="add-to-rtcrtpencodingparamters-attributes-active">
<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>
</dd>
<!-- Could add test to validate it does what it says it does with very low values and high values, and check stats-->
<dt data-tests="RTCRtpParameters-encodings.html">
<dfn data-idl="">maxBitrate</dfn> of type <span class=
Expand Down

0 comments on commit 7f95b53

Please sign in to comment.