Skip to content

Refactored Encoded Transform management into it's own component for better support of non-redundant audio transforms#3131

Merged
hensmi-amazon merged 11 commits intomainfrom
transform-metrics
Feb 5, 2026
Merged

Refactored Encoded Transform management into it's own component for better support of non-redundant audio transforms#3131
hensmi-amazon merged 11 commits intomainfrom
transform-metrics

Conversation

@hensmi-amazon
Copy link
Contributor

@hensmi-amazon hensmi-amazon commented Jan 8, 2026

Issue #: N/A

Description of changes:

Note that given the size of this PR i am first skipping unit tests to save myself some time in case i need to do significant additional refactoring.

We would like to add transforms for metric/monitoring, and at some point E2EE. This change does that while adding a simple transform PPS metric. First packet metrics will occur in a future PR.

Testing:

  • Confirmed media/RED metrics report and the RED applies. Have tested legacy path by disabling encoded stream transform. Have tested chrome/FF/safari. Have tested init failure, and failure during connection.

Checklist:

  1. Have you successfully run npm run build:release locally?
    n

  2. Do you add, modify, or delete public API definitions? If yes, has that been reviewed and approved?

not really that public :)

  1. Do you change the wire protocol, e.g. the request method? If yes, has that been reviewed and approved?

n

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hensmi-amazon hensmi-amazon requested a review from a team as a code owner January 8, 2026 21:35
}

// Trigger reconnect to recreate peer connection without transforms
const status = new MeetingSessionStatus(MeetingSessionStatusCode.TaskFailed);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought: Should we add EncodedTransformManagerFailed or StartEncodedTransformWorkerTaskFailed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!


// Create transform managers based on disabled configuration
if (!disabledTransforms?.redundantAudio) {
this.redManager = new RedundantAudioEncodedTransformManager(this.worker!, this.logger);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can return Worker instance from createWorker that way we dont have to do this.worker! here.

@@ -124,6 +124,8 @@ export default class MeetingSessionStatus {
return 'The audio connection failed.';
case MeetingSessionStatusCode.SignalingChannelClosedUnexpectedly:
return 'The signaling channel was closed unexpectedly. This may be due to a network change or backend detected failure.';
case MeetingSessionStatusCode.EncodedTransformManagerFailed:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is not a failure code that need to reconnect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically none of these need to be reconnected by the builder, since they are reconnected internally. This just clarifies that it will adjust to make the reconnection successful, which may impact behavior. Kept it pretty vague ofc.

EncodedTransformWorker.redundantAudioEncodedTransform = new RedundantAudioEncodedTransform();
EncodedTransformWorker.audioSenderMetricsTransform = new AudioSenderMetricsTransform();
EncodedTransformWorker.audioReceiverMetricsTransform = new AudioReceiverMetricsTransform();
EncodedTransformWorker.videoSenderMetricsTransform = new VideoSenderMetricsTransform();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I misunderstand but its a bit confusing that a class named RedundantAudio... also has video metrics

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class isn't called RendundantAudio :). It's meant to be the management layer on top of all transforms (since the worker is shared).

// Handle legacy createEncodedStreams() API
if (message.msgType === 'StartEncodedTransformWorker') {
EncodedTransformWorker.log('Setting up legacy encoded streams');
const disabledTransforms: DisabledEncodedTransformsConfiguration =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is audio redundant the default option? Otherwise, feel like we could name this as EncodedTransformsConfiguration isntead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup it's default on. I think all transforms would be default on in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^classic last words ofc.

@hensmi-amazon hensmi-amazon enabled auto-merge (squash) February 5, 2026 19:35
@hensmi-amazon hensmi-amazon merged commit 2df262f into main Feb 5, 2026
6 checks passed
@hensmi-amazon hensmi-amazon deleted the transform-metrics branch February 5, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants