Skip to content

Commit

Permalink
Merge pull request #2926 from fippo/setcodecpreferences-recvonly
Browse files Browse the repository at this point in the history
make setCodecPreferences only look at receive codecs
  • Loading branch information
alvestrand authored Feb 8, 2024
2 parents d3a5c60 + 2f1b2b8 commit 20474d9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
17 changes: 16 additions & 1 deletion amendments.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
],
"dom-datachannel-binarytype-desc": [
{
"description": "Fix binaryType setter requriements",
"description": "Fix binaryType setter requirements",
"pr": 2909,
"type": "correction",
"status": "candidate",
Expand All @@ -548,5 +548,20 @@
"status": "candidate",
"id": 40
}
],
"setcodecpreferences-receive": [
{
"description": "setCodecPreferences only takes into account receive codecs",
"pr": 2926,
"type": "correction",
"status": "candidate",
"tests": [
"webrtc/RTCRtpTransceiver-setCodecPreferences.html"
],
"testUpdates": [
"web-platform-tests/wpt#44318"
],
"id": 40
}
]
}
2 changes: 2 additions & 0 deletions base-rec.html
Original file line number Diff line number Diff line change
Expand Up @@ -11037,6 +11037,7 @@ <h4 id="methods-8">
<dfn data-idl="operation" data-export="" data-dfn-type="method" id="dom-rtcrtptransceiver-setcodecpreferences" data-title="setCodecPreferences" data-dfn-for="RTCRtpTransceiver" data-type="undefined" data-lt="setCodecPreferences()|setCodecPreferences(codecs)" data-local-lt="RTCRtpTransceiver.setCodecPreferences|RTCRtpTransceiver.setCodecPreferences()|setCodecPreferences"><code>setCodecPreferences</code></dfn>
</dt>
<dd>
<div id="setcodecpreferences-receive">
<p class="needs-tests">
The <a data-link-type="idl" href="#dom-rtcrtptransceiver-setcodecpreferences" class="internalDFN" id="ref-for-dom-rtcrtptransceiver-setcodecpreferences-4"><code><code>setCodecPreferences</code></code></a> method overrides the default
codec preferences used by the <a href="#dfn-user-agent" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-user-agent-9">user agent</a>. When
Expand Down Expand Up @@ -11101,6 +11102,7 @@ <h4 id="methods-8">
When <a data-link-type="idl" data-lt="setCodecPreferences()" href="#dom-rtcrtptransceiver-setcodecpreferences" class="internalDFN" id="ref-for-dom-rtcrtptransceiver-setcodecpreferences-6"><code><code>setCodecPreferences</code></code></a><code>()</code> in invoked, the <a href="#dfn-user-agent" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-user-agent-11">user
agent</a> <em class="rfc2119">MUST</em> run the following steps:
</p>
</div>
<ol id="setcodecparameters-algorithm">
<li class="no-test-needed">
<p>
Expand Down
16 changes: 6 additions & 10 deletions webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -11179,9 +11179,10 @@ <h2>
<dfn data-idl="">setCodecPreferences</dfn>
</dt>
<dd>
<div id="setcodecpreferences-receive">
<p>
The {{setCodecPreferences}} method overrides the default
codec preferences used by the <a>user agent</a>. When
receive codec preferences used by the <a>user agent</a>. When
generating a session description using either
{{RTCPeerConnection/createOffer}} or
{{RTCPeerConnection/createAnswer}}, the <a>user agent</a>
Expand Down Expand Up @@ -11219,8 +11220,6 @@ <h2>
<p>
{{setCodecPreferences}} will reject attempts to set <var>codecs</var>
[= codec match | not matching =] codecs found in
{{RTCRtpSender}}.{{RTCRtpSender/getCapabilities}}(<var>kind</var>)
or
{{RTCRtpReceiver}}.{{RTCRtpReceiver/getCapabilities}}(<var>kind</var>),
where <var>kind</var> is the kind of the
{{RTCRtpTransceiver}} on which the method is called.
Expand Down Expand Up @@ -11276,20 +11275,16 @@ <h2>
<li data-tests="RTCRtpTransceiver-setCodecPreferences.html">
<p>
If the intersection between <var>codecs</var> and
{{RTCRtpSender}}.{{RTCRtpSender/getCapabilities}}(<var>kind</var>).{{RTCRtpParameters/codecs}}
or the intersection between <var>codecs</var> and
{{RTCRtpReceiver}}.{{RTCRtpReceiver/getCapabilities}}(<var>kind</var>).{{RTCRtpParameters/codecs}}
only contains RTX, RED or FEC codecs or is an empty set,
only contains RTX, RED, FEC codecs or Comfort Noise codecs or is an empty set,
throw {{InvalidModificationError}}. This ensures that we
always have something to offer, regardless of
<var>transceiver</var>.{{RTCRtpTransceiver/direction}}.
</p>
</li>
<li class="no-test-needed">
<p>
Let <var>codecCapabilities</var> be the union of
{{RTCRtpSender}}.{{RTCRtpSender/getCapabilities}}(<var>kind</var>).{{RTCRtpParameters/codecs}}
and
Let <var>codecCapabilities</var> be
{{RTCRtpReceiver}}.{{RTCRtpReceiver/getCapabilities}}(<var>kind</var>).{{RTCRtpParameters/codecs}}.
</p>
</li>
Expand All @@ -11312,6 +11307,7 @@ <h2>
</p>
</li>
</ol>
</div>
<div id="setcodecparameters-algorithm">
<p> The <dfn class="export">codec match</dfn> algorithm given two {{RTCRtpCodec}}
<var>first</var> and <var>second</var> is as follows:
Expand Down Expand Up @@ -11355,7 +11351,7 @@ <h2>
</ol>
</div>
<p class="note">
If set, the offerer's codec preferences will decide the order
If set, the offerer's receive codec preferences will decide the order
of the codecs in the offer. If the answerer does not have any
codec preferences then the same order will be used in the
answer. However, if the answerer also has codec preferences,
Expand Down

0 comments on commit 20474d9

Please sign in to comment.