Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminate audio RED worker before removing reference #2960

Merged
merged 4 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
Loading