Skip to content

Commit

Permalink
Terminate audio RED worker before removing reference (#2960)
Browse files Browse the repository at this point in the history
  • Loading branch information
hensmi-amazon authored Oct 2, 2024
1 parent 26988b4 commit 5cacbb6
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 17 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Terminate audio RED worker before removing reference.

## [3.24.0] - 2024-07-11

### Added
Expand Down
2 changes: 1 addition & 1 deletion demos/browser/package-lock.json

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

8 changes: 4 additions & 4 deletions docs/classes/defaulttransceivercontroller.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ <h3>add<wbr>Redundant<wbr>Audio<wbr>Recovery<wbr>Metrics<wbr>Observer</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/transceivercontroller.html">TransceiverController</a>.<a href="../interfaces/transceivercontroller.html#addredundantaudiorecoverymetricsobserver">addRedundantAudioRecoveryMetricsObserver</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L841">src/transceivercontroller/DefaultTransceiverController.ts:841</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L842">src/transceivercontroller/DefaultTransceiverController.ts:842</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -478,7 +478,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/transceivercontroller/DefaultTransceiverController.ts#L661">src/transceivercontroller/DefaultTransceiverController.ts:661</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L662">src/transceivercontroller/DefaultTransceiverController.ts:662</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -507,7 +507,7 @@ <h3>remove<wbr>Redundant<wbr>Audio<wbr>Recovery<wbr>Metrics<wbr>Observer</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/transceivercontroller.html">TransceiverController</a>.<a href="../interfaces/transceivercontroller.html#removeredundantaudiorecoverymetricsobserver">removeRedundantAudioRecoveryMetricsObserver</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L845">src/transceivercontroller/DefaultTransceiverController.ts:845</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L846">src/transceivercontroller/DefaultTransceiverController.ts:846</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -617,7 +617,7 @@ <h3>set<wbr>Audio<wbr>Payload<wbr>Types</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/transceivercontroller.html">TransceiverController</a>.<a href="../interfaces/transceivercontroller.html#setaudiopayloadtypes">setAudioPayloadTypes</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L647">src/transceivercontroller/DefaultTransceiverController.ts:647</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L648">src/transceivercontroller/DefaultTransceiverController.ts:648</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
8 changes: 4 additions & 4 deletions docs/classes/simulcastcontentsharetransceivercontroller.html
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ <h3>add<wbr>Redundant<wbr>Audio<wbr>Recovery<wbr>Metrics<wbr>Observer</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="simulcasttransceivercontroller.html">SimulcastTransceiverController</a>.<a href="simulcasttransceivercontroller.html#addredundantaudiorecoverymetricsobserver">addRedundantAudioRecoveryMetricsObserver</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L841">src/transceivercontroller/DefaultTransceiverController.ts:841</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L842">src/transceivercontroller/DefaultTransceiverController.ts:842</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -599,7 +599,7 @@ <h3>metrics<wbr>Did<wbr>Receive</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="simulcasttransceivercontroller.html">SimulcastTransceiverController</a>.<a href="simulcasttransceivercontroller.html#metricsdidreceive">metricsDidReceive</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L661">src/transceivercontroller/DefaultTransceiverController.ts:661</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L662">src/transceivercontroller/DefaultTransceiverController.ts:662</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -628,7 +628,7 @@ <h3>remove<wbr>Redundant<wbr>Audio<wbr>Recovery<wbr>Metrics<wbr>Observer</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="simulcasttransceivercontroller.html">SimulcastTransceiverController</a>.<a href="simulcasttransceivercontroller.html#removeredundantaudiorecoverymetricsobserver">removeRedundantAudioRecoveryMetricsObserver</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L845">src/transceivercontroller/DefaultTransceiverController.ts:845</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L846">src/transceivercontroller/DefaultTransceiverController.ts:846</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -738,7 +738,7 @@ <h3>set<wbr>Audio<wbr>Payload<wbr>Types</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="simulcasttransceivercontroller.html">SimulcastTransceiverController</a>.<a href="simulcasttransceivercontroller.html#setaudiopayloadtypes">setAudioPayloadTypes</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L647">src/transceivercontroller/DefaultTransceiverController.ts:647</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L648">src/transceivercontroller/DefaultTransceiverController.ts:648</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
8 changes: 4 additions & 4 deletions docs/classes/simulcasttransceivercontroller.html
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ <h3>add<wbr>Redundant<wbr>Audio<wbr>Recovery<wbr>Metrics<wbr>Observer</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="defaulttransceivercontroller.html">DefaultTransceiverController</a>.<a href="defaulttransceivercontroller.html#addredundantaudiorecoverymetricsobserver">addRedundantAudioRecoveryMetricsObserver</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L841">src/transceivercontroller/DefaultTransceiverController.ts:841</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L842">src/transceivercontroller/DefaultTransceiverController.ts:842</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -596,7 +596,7 @@ <h3>metrics<wbr>Did<wbr>Receive</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="defaulttransceivercontroller.html">DefaultTransceiverController</a>.<a href="defaulttransceivercontroller.html#metricsdidreceive">metricsDidReceive</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L661">src/transceivercontroller/DefaultTransceiverController.ts:661</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L662">src/transceivercontroller/DefaultTransceiverController.ts:662</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -625,7 +625,7 @@ <h3>remove<wbr>Redundant<wbr>Audio<wbr>Recovery<wbr>Metrics<wbr>Observer</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="defaulttransceivercontroller.html">DefaultTransceiverController</a>.<a href="defaulttransceivercontroller.html#removeredundantaudiorecoverymetricsobserver">removeRedundantAudioRecoveryMetricsObserver</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L845">src/transceivercontroller/DefaultTransceiverController.ts:845</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L846">src/transceivercontroller/DefaultTransceiverController.ts:846</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -735,7 +735,7 @@ <h3>set<wbr>Audio<wbr>Payload<wbr>Types</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="defaulttransceivercontroller.html">DefaultTransceiverController</a>.<a href="defaulttransceivercontroller.html#setaudiopayloadtypes">setAudioPayloadTypes</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L647">src/transceivercontroller/DefaultTransceiverController.ts:647</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L648">src/transceivercontroller/DefaultTransceiverController.ts:648</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
8 changes: 4 additions & 4 deletions docs/classes/videoonlytransceivercontroller.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ <h3>add<wbr>Redundant<wbr>Audio<wbr>Recovery<wbr>Metrics<wbr>Observer</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="defaulttransceivercontroller.html">DefaultTransceiverController</a>.<a href="defaulttransceivercontroller.html#addredundantaudiorecoverymetricsobserver">addRedundantAudioRecoveryMetricsObserver</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L841">src/transceivercontroller/DefaultTransceiverController.ts:841</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L842">src/transceivercontroller/DefaultTransceiverController.ts:842</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -480,7 +480,7 @@ <h3>metrics<wbr>Did<wbr>Receive</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="defaulttransceivercontroller.html">DefaultTransceiverController</a>.<a href="defaulttransceivercontroller.html#metricsdidreceive">metricsDidReceive</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L661">src/transceivercontroller/DefaultTransceiverController.ts:661</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L662">src/transceivercontroller/DefaultTransceiverController.ts:662</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -509,7 +509,7 @@ <h3>remove<wbr>Redundant<wbr>Audio<wbr>Recovery<wbr>Metrics<wbr>Observer</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="defaulttransceivercontroller.html">DefaultTransceiverController</a>.<a href="defaulttransceivercontroller.html#removeredundantaudiorecoverymetricsobserver">removeRedundantAudioRecoveryMetricsObserver</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L845">src/transceivercontroller/DefaultTransceiverController.ts:845</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L846">src/transceivercontroller/DefaultTransceiverController.ts:846</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -619,7 +619,7 @@ <h3>set<wbr>Audio<wbr>Payload<wbr>Types</h3>
<aside class="tsd-sources">
<p>Inherited from <a href="defaulttransceivercontroller.html">DefaultTransceiverController</a>.<a href="defaulttransceivercontroller.html#setaudiopayloadtypes">setAudioPayloadTypes</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L647">src/transceivercontroller/DefaultTransceiverController.ts:647</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L648">src/transceivercontroller/DefaultTransceiverController.ts:648</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
1 change: 1 addition & 0 deletions src/transceivercontroller/DefaultTransceiverController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ export default class DefaultTransceiverController
if (this.audioRedWorker) {
URL.revokeObjectURL(this.audioRedWorkerURL);
this.audioRedWorkerURL = null;
this.audioRedWorker.terminate();
this.audioRedWorker = null;
this.currentNumRedundantEncodings = 0;
this.lastRedHolddownTimerStartTimestampMs = 0;
Expand Down
2 changes: 2 additions & 0 deletions test/dommock/DOMMockBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ export default class DOMMockBuilder {

return true;
}

terminate(): void {}
};

GlobalAny.WebSocket = class MockWebSocket {
Expand Down

0 comments on commit 5cacbb6

Please sign in to comment.