Skip to content

Commit

Permalink
Fix unnecessary simulcast cropping, vastly simplify simulcast uplink …
Browse files Browse the repository at this point in the history
…policy (#2845)

* Fix unnecessary simulcast cropping, vastly simplify simulcast uplink policy

* Address comments and fix tests

* Fix coverage again
  • Loading branch information
hensmi-amazon authored Feb 23, 2024
1 parent 279b234 commit 6a1422b
Show file tree
Hide file tree
Showing 25 changed files with 2,550 additions and 3,377 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Simplified simulcast uplink policy to not unnecesarily try to compensate for uplink bandwidth estimation.

### Fixed

- Fixed unnecessary cropping on some camera capturers when simulcast was enabled.

## [3.20.0] - 2023-12-12

### Added
Expand Down
2 changes: 1 addition & 1 deletion demos/browser/app/meetingV2/meetingV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3968,7 +3968,7 @@ export class DemoMeetingApp

const chosenVideoSendCodec = (document.getElementById('videoCodecSelect') as HTMLSelectElement).value;
this.videoCodecPreferences = getCodecPreferences(chosenVideoSendCodec);
if (!['av1Main', 'vp9Profile0'].includes(chosenVideoSendCodec)) {
if (['av1Main', 'vp9Profile0'].includes(chosenVideoSendCodec)) {
// Attempting to use simulcast with VP9 or AV1 will lead to unexpected behavior (e.g. SVC instead)
this.enableSimulcast = false;
}
Expand Down
3 changes: 1 addition & 2 deletions demos/browser/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4,754 changes: 2,361 additions & 2,393 deletions docs/assets/js/search.js

Large diffs are not rendered by default.

162 changes: 25 additions & 137 deletions docs/classes/defaultsimulcastuplinkpolicy.html

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions docs/classes/defaultsimulcastuplinkpolicyforcontentshare.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/classes/monitortask.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ <h3>audio<wbr>Video<wbr>Did<wbr>Start</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#audiovideodidstart">audioVideoDidStart</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L269">src/task/MonitorTask.ts:269</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L268">src/task/MonitorTask.ts:268</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -219,7 +219,7 @@ <h3>audio<wbr>Video<wbr>Did<wbr>Start<wbr>Connecting</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#audiovideodidstartconnecting">audioVideoDidStartConnecting</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L274">src/task/MonitorTask.ts:274</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L273">src/task/MonitorTask.ts:273</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -248,7 +248,7 @@ <h3>audio<wbr>Video<wbr>Did<wbr>Stop</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#audiovideodidstop">audioVideoDidStop</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L280">src/task/MonitorTask.ts:280</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L279">src/task/MonitorTask.ts:279</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -306,7 +306,7 @@ <h3>connection<wbr>Health<wbr>Did<wbr>Change</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#connectionhealthdidchange">connectionHealthDidChange</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L215">src/task/MonitorTask.ts:215</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L214">src/task/MonitorTask.ts:214</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -353,7 +353,7 @@ <h3>handle<wbr>Signaling<wbr>Client<wbr>Event</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/signalingclientobserver.html">SignalingClientObserver</a>.<a href="../interfaces/signalingclientobserver.html#handlesignalingclientevent">handleSignalingClientEvent</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L320">src/task/MonitorTask.ts:320</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L319">src/task/MonitorTask.ts:319</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -406,7 +406,7 @@ <h3>metrics<wbr>Did<wbr>Receive</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#metricsdidreceive">metricsDidReceive</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L189">src/task/MonitorTask.ts:189</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L188">src/task/MonitorTask.ts:188</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
2 changes: 1 addition & 1 deletion docs/classes/novideouplinkbandwidthpolicy.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h3>choose<wbr>Media<wbr>Track<wbr>Constraints</h3>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the selected [[MediaTrackConstraints]] to update</p>
<p>This function is deprecated and unused, and will be removed in a future release.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">MediaTrackConstraints</span></h4>
Expand Down
2 changes: 1 addition & 1 deletion docs/classes/nscalevideouplinkbandwidthpolicy.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ <h3>choose<wbr>Media<wbr>Track<wbr>Constraints</h3>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the selected [[MediaTrackConstraints]] to update</p>
<p>This function is deprecated and unused, and will be removed in a future release.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">MediaTrackConstraints</span></h4>
Expand Down
36 changes: 18 additions & 18 deletions docs/classes/simulcastvideostreamindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ <h3>Hierarchy</h3>
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<section class="tsd-index-section tsd-is-inherited">
<h3>Constructors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><a href="simulcastvideostreamindex.html#constructor" class="tsd-kind-icon">constructor</a></li>
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><a href="simulcastvideostreamindex.html#constructor" class="tsd-kind-icon">constructor</a></li>
</ul>
</section>
<section class="tsd-index-section ">
Expand Down Expand Up @@ -151,20 +151,20 @@ <h3>Methods</h3>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<section class="tsd-panel-group tsd-member-group tsd-is-inherited">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite">
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited">
<a name="constructor" class="tsd-anchor"></a>
<h3>constructor</h3>
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite">
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">new <wbr>Simulcast<wbr>Video<wbr>Stream<wbr>Index<span class="tsd-signature-symbol">(</span>logger<span class="tsd-signature-symbol">: </span><a href="../interfaces/logger.html" class="tsd-signature-type" data-tsd-kind="Interface">Logger</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="simulcastvideostreamindex.html" class="tsd-signature-type" data-tsd-kind="Class">SimulcastVideoStreamIndex</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Overrides <a href="defaultvideostreamindex.html">DefaultVideoStreamIndex</a>.<a href="defaultvideostreamindex.html#constructor">constructor</a></p>
<p>Inherited from <a href="defaultvideostreamindex.html">DefaultVideoStreamIndex</a>.<a href="defaultvideostreamindex.html#constructor">constructor</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L35">src/videostreamindex/SimulcastVideoStreamIndex.ts:35</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/DefaultVideoStreamIndex.ts#L39">src/videostreamindex/DefaultVideoStreamIndex.ts:39</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -315,7 +315,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-
<div class="tsd-signature tsd-kind-icon">Bitrates<wbr>Msg<wbr>Frequency<wbr>Ms<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 4000</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L28">src/videostreamindex/SimulcastVideoStreamIndex.ts:28</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L27">src/videostreamindex/SimulcastVideoStreamIndex.ts:27</a></li>
</ul>
</aside>
</section>
Expand All @@ -325,7 +325,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-
<div class="tsd-signature tsd-kind-icon">NOT_<wbr>SENDING_<wbr>STREAM_<wbr>BITRATE<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">0</span><span class="tsd-signature-symbol"> = 0</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L26">src/videostreamindex/SimulcastVideoStreamIndex.ts:26</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L25">src/videostreamindex/SimulcastVideoStreamIndex.ts:25</a></li>
</ul>
</aside>
</section>
Expand All @@ -335,7 +335,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-
<div class="tsd-signature tsd-kind-icon">RECENTLY_<wbr>INACTIVE_<wbr>STREAM_<wbr>BITRATE<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">-1</span><span class="tsd-signature-symbol"> = -1</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L24">src/videostreamindex/SimulcastVideoStreamIndex.ts:24</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L23">src/videostreamindex/SimulcastVideoStreamIndex.ts:23</a></li>
</ul>
</aside>
</section>
Expand All @@ -345,7 +345,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-
<div class="tsd-signature tsd-kind-icon">UNSEEN_<wbr>STREAM_<wbr>BITRATE<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">-2</span><span class="tsd-signature-symbol"> = -2</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L22">src/videostreamindex/SimulcastVideoStreamIndex.ts:22</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L21">src/videostreamindex/SimulcastVideoStreamIndex.ts:21</a></li>
</ul>
</aside>
</section>
Expand Down Expand Up @@ -674,7 +674,7 @@ <h3>integrate<wbr>Bitrates<wbr>Frame</h3>
<aside class="tsd-sources">
<p>Overrides <a href="defaultvideostreamindex.html">DefaultVideoStreamIndex</a>.<a href="defaultvideostreamindex.html#integratebitratesframe">integrateBitratesFrame</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L95">src/videostreamindex/SimulcastVideoStreamIndex.ts:95</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L84">src/videostreamindex/SimulcastVideoStreamIndex.ts:84</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -703,7 +703,7 @@ <h3>integrate<wbr>Index<wbr>Frame</h3>
<aside class="tsd-sources">
<p>Overrides <a href="defaultvideostreamindex.html">DefaultVideoStreamIndex</a>.<a href="defaultvideostreamindex.html#integrateindexframe">integrateIndexFrame</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L164">src/videostreamindex/SimulcastVideoStreamIndex.ts:164</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L127">src/videostreamindex/SimulcastVideoStreamIndex.ts:127</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -732,7 +732,7 @@ <h3>integrate<wbr>Subscribe<wbr>Ack<wbr>Frame</h3>
<aside class="tsd-sources">
<p>Overrides <a href="defaultvideostreamindex.html">DefaultVideoStreamIndex</a>.<a href="defaultvideostreamindex.html#integratesubscribeackframe">integrateSubscribeAckFrame</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L189">src/videostreamindex/SimulcastVideoStreamIndex.ts:189</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L152">src/videostreamindex/SimulcastVideoStreamIndex.ts:152</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -761,7 +761,7 @@ <h3>integrate<wbr>Uplink<wbr>Policy<wbr>Decision</h3>
<aside class="tsd-sources">
<p>Overrides <a href="defaultvideostreamindex.html">DefaultVideoStreamIndex</a>.<a href="defaultvideostreamindex.html#integrateuplinkpolicydecision">integrateUplinkPolicyDecision</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L50">src/videostreamindex/SimulcastVideoStreamIndex.ts:50</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L42">src/videostreamindex/SimulcastVideoStreamIndex.ts:42</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -790,7 +790,7 @@ <h3>local<wbr>Stream<wbr>Descriptions</h3>
<aside class="tsd-sources">
<p>Overrides <a href="defaultvideostreamindex.html">DefaultVideoStreamIndex</a>.<a href="defaultvideostreamindex.html#localstreamdescriptions">localStreamDescriptions</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L42">src/videostreamindex/SimulcastVideoStreamIndex.ts:42</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L34">src/videostreamindex/SimulcastVideoStreamIndex.ts:34</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -921,7 +921,7 @@ <h3>send<wbr>Video<wbr>Stream<wbr>IdFrom<wbr>Rid</h3>
<aside class="tsd-sources">
<p>Overrides <a href="defaultvideostreamindex.html">DefaultVideoStreamIndex</a>.<a href="defaultvideostreamindex.html#sendvideostreamidfromrid">sendVideoStreamIdFromRid</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L219">src/videostreamindex/SimulcastVideoStreamIndex.ts:219</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videostreamindex/SimulcastVideoStreamIndex.ts#L182">src/videostreamindex/SimulcastVideoStreamIndex.ts:182</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1105,7 +1105,7 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
<li class="current tsd-kind-class">
<a href="simulcastvideostreamindex.html" class="tsd-kind-icon">Simulcast<wbr>Video<wbr>Stream<wbr>Index</a>
<ul>
<li class=" tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite">
<li class=" tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited">
<a href="simulcastvideostreamindex.html#constructor" class="tsd-kind-icon">constructor</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
Expand Down
Loading

0 comments on commit 6a1422b

Please sign in to comment.