Skip to content
Merged
Changes from 2 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
14 changes: 13 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@ dictionary SFrameTransformOptions {
required SFrameCipherSuite cipherSuite;
};

enum SFrameType {
"per-frame",
"per-packet"
};

dictionary RTCSFrameSenderTransformOptions : SFrameTransformOptions {
SFrameType type = "per-frame";
};

typedef [EnforceRange] unsigned long long SmallCryptoKeyID;
typedef (SmallCryptoKeyID or bigint) CryptoKeyID;

Expand All @@ -268,7 +277,7 @@ interface mixin SFrameDecrypterManager {

[Exposed=Window]
interface RTCSFrameSenderTransform {
constructor(optional SFrameTransformOptions options = {});
constructor(optional RTCSFrameSenderTransformOptions options = {});
Copy link
Copy Markdown

@k-wasniowski k-wasniowski Feb 6, 2026

Choose a reason for hiding this comment

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

@youennf
Should there be a requirement that for sender packet transformers should be applied after frame transformers?
In theory you could create RTCRtpScriptTransform with couple transformers attached like:

onrtctransform = transformer => {
  const encrypter = new RTCSFrameSenderTransform({mode: `packet`);
  transformer.readable
.pipeThrough(new TransformStream(myMetadataTransform1))
    .pipeThrough(encrypter)
    .pipeThrough(new TransformStream(myMetadataTransform2))
    .pipeTo(writable);
};

Where myMetadataTransformX should work on the frame level transformations

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

RTCSFrameSenderTransform can only be used on RTCRtpSender, not as part of regular whatwg streams.

};
RTCSFrameSenderTransform includes SFrameEncrypterManager;

Expand Down Expand Up @@ -340,6 +349,9 @@ The <dfn constructor for="SFrameDecrypterStream" lt="SFrameDecrypterStream(optio

The <dfn>SFrame initialization algorithm</dfn>, given |this| and |options|, runs these steps:
1. Let |transformAlgorithm| be an algorithm which takes a |frame| as input and runs the [=SFrame transform algorithm=] with |this| and |frame|.
1. If |options|["{{RTCSFrameSenderTransformOptions/type}}"] is present, run these steps:
Comment thread
youennf marked this conversation as resolved.
Outdated
1. If |options|["{{RTCSFrameSenderTransformOptions/type}}"] is 'per-frame', use per-frame sending as defined in [[RTP-SFRAME-PAYLOAD]].
1. Otherwise, use per-packet sending as defined in [[RTP-SFRAME-PAYLOAD]].
Comment thread
youennf marked this conversation as resolved.
Outdated
1. Set |this|.`[[transform]]` to a new {{TransformStream}}.
1. <a dfn for="ReadableStream">Set up</a> [=this=].`[[transform]]` with [=TransformStream/set up/transformAlgorithm=] set to |transformAlgorithm|.
1. Set |this|.`[[cipherSuite]]` to |options|["{{SFrameTransformOptions/cipherSuite}}"].
Expand Down