You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.bs
+58-20Lines changed: 58 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -81,15 +81,16 @@ It uses an additional API on {{RTCRtpSender}} and {{RTCRtpReceiver}} to
81
81
insert the processing into the pipeline.
82
82
83
83
<pre class="idl">
84
-
typedef (SFrameTransform or RTCRtpScriptTransform) RTCRtpTransform;
84
+
typedef (SFrameSenderTransform or RTCRtpScriptTransform) RTCRtpSenderTransform;
85
+
typedef (SFrameReceiverTransform or RTCRtpScriptTransform) RTCRtpReceiverTransform;
85
86
86
87
// New methods for RTCRtpSender and RTCRtpReceiver
87
88
partial interface RTCRtpSender {
88
-
attribute RTCRtpTransform? transform;
89
+
attribute RTCRtpSenderTransform? transform;
89
90
};
90
91
91
92
partial interface RTCRtpReceiver {
92
-
attribute RTCRtpTransform? transform;
93
+
attribute RTCRtpReceiverTransform? transform;
93
94
};
94
95
</pre>
95
96
@@ -203,7 +204,7 @@ There is no guarantee on which frame will happen the switch from the previous tr
203
204
If a web application sets the transform synchronously at creation of the {{RTCRtpSender}} (for instance when calling addTrack), the transform will receive the first frame generated by the {{RTCRtpSender}}'s encoder.
204
205
Similarly, if a web application sets the transform synchronously at creation of the {{RTCRtpReceiver}} (for instance when calling addTrack, or at track event handler), the transform will receive the first full frame generated by the {{RTCRtpReceiver}}'s packetizer.
205
206
206
-
# SFrameTransform # {#sframe}
207
+
# SFrame transforms # {#sframe}
207
208
208
209
<p>
209
210
The APIs presented in this section allow applications to process SFrame data using specific cipher suites defined in [[RFC9605]].
The <dfn constructor for="SFrameTransform" lt="SFrameTransform(options)"><code>new SFrameTransform(<var>options</var>)</code></dfn> constructor steps are:
289
+
The <dfn constructor for="SFrameSenderTransform" lt="SFrameSenderTransform(options)"><code>new SFrameSenderTransform(<var>options</var>)</code></dfn> constructor steps are:
277
290
1. Let |options| be the method's first argument.
278
291
1. Run the [=SFrame initialization algorithm=] with |this| and |options|.
292
+
1. Set |this|.`[[role]]` to 'encrypt'.
293
+
294
+
The <dfn constructor for="SFrameReceiverTransform" lt="SFrameReceiverTransform(options)"><code>new SFrameReceiverTransform(<var>options</var>)</code></dfn> constructor steps are:
295
+
1. Let |options| be the method's first argument.
296
+
1. Run the [=SFrame initialization algorithm=] with |this| and |options|.
297
+
1. Set |this|.`[[role]]` to 'decrypt'.
279
298
280
299
The <dfn constructor for="SFrameEncrypterStream" lt="SFrameEncrypterStream(options)"><code>new SFrameEncrypterStream(<var>options</var>)</code></dfn> constructor steps are:
281
300
1. Let |options| be the method's first argument.
@@ -324,14 +343,33 @@ The <dfn>SFrame transform algorithm</dfn>, given |this| and |frame|, runs these
324
343
1. [=ReadableStream/Enqueue=] |frame| in |this|.`[[transform]]`.
325
344
326
345
## Methods ## {#sframe-transform-methods}
327
-
The <dfn method for="SFrameTransform">setEncryptionKey(|key|, |keyID|)</dfn> method steps are:
346
+
The <dfn method for="SFrameEncrypterManager">setEncryptionKey(|key|, |keyId|)</dfn> method steps are:
328
347
1. Let |promise| be [=a new promise=].
329
-
2. If |keyID| is a {{bigint}} which cannot be represented as a integer between 0 and 2<sup>64</sup>-1 inclusive, [=reject=] |promise| with a {{RangeError}} exception.
330
-
3. Otherwise, [=in parallel=], run the following steps:
331
-
1. Set |key| with its optional |keyID| as key material to use for the SFrame transform algorithm, as defined by [[RFC9605]].
332
-
2. If setting the key material fails, [=reject=] |promise| with an {{InvalidModificationError}} exception and abort these steps.
333
-
3. [=Resolve=] |promise| with undefined.
334
-
4. Return |promise|.
348
+
1. If |keyId| is a {{bigint}} which cannot be represented as a integer between 0 and 2<sup>64</sup>-1 inclusive, [=reject=] |promise| with a {{RangeError}} exception and abort these steps.
349
+
1. [=In parallel=], run the following steps:
350
+
1. Set the SFrame transform encryption algorithm's key material to |key| and |keyId|, as defined by [[RFC9605]].
351
+
1. If setting the key material fails, [=queue a task=] to [=reject=] |promise| with an {{InvalidModificationError}} exception and abort these steps.
352
+
1. [=Queue a task=] to [=resolve=] |promise| with undefined.
353
+
1. Return |promise|.
354
+
355
+
The <dfn method for="SFrameDecrypterManager">addDecryptionKey(|key|, |keyId|)</dfn> method steps are:
356
+
1. Let |promise| be [=a new promise=].
357
+
1. If |keyId| is a {{bigint}} which cannot be represented as a integer between 0 and 2<sup>64</sup>-1 inclusive, [=reject=] |promise| with a {{RangeError}} exception, and abort these steps.
358
+
1. [=In parallel=], run the following steps:
359
+
1. Let |keyStore| be the key store used for the SFrame transform algorithm, as defined by [[RFC9605]].
360
+
1. [=map/set|Set=] |keyStore|[|keyId|] to |keyValue|.
361
+
1. If setting the key material fails, [=queue a task=] to [=reject=] |promise| with an {{InvalidModificationError}} exception and abort these steps.
362
+
1. [=Queue a task=] to [=resolve=] |promise| with undefined.
363
+
1. Return |promise|.
364
+
365
+
The <dfn method for="SFrameDecrypterManager">removeDecryptionKey(|keyId|)</dfn> method steps are:
366
+
1. Let |promise| be [=a new promise=].
367
+
1. If |keyId| is a {{bigint}} which cannot be represented as a integer between 0 and 2<sup>64</sup>-1 inclusive, [=reject=] |promise| with a {{RangeError}} exception, and abort these steps.
368
+
1. [=In parallel=], run the following steps:
369
+
1. Let |keyStore| be the key store used for the SFrame transform algorithm, as defined by [[RFC9605]].
370
+
1. [=map/remove|Remove=] |keyStore|[|keyId|].
371
+
1. [=Queue a task=] to [=resolve=] |promise| with undefined.
@@ -1087,7 +1125,7 @@ The <dfn abstract-op>generate key frame algorithm</dfn>, given |promise|, |frame
1087
1125
For any [=encoder=] associated with an {{RTCRtpScriptTransformer}} |transformer|, the user agent MUST run the following steps just before any |frame| is [=ReadableStream/enqueued=] into |transformer|.{{[[readable]]}}:
1088
1126
1. Let |encoder| be |transformer|.{{[[frameSource]]}}.
1089
1127
1. If |encoder|.`[[pendingKeyFrameTasks]]` is undefined, abort these steps.
1090
-
1. If |frame| is not a video {{RTCEncodedVideoFrameType/"key"}} frame, abort these steps.
1128
+
1. If |frame| is not a video {{EncodedVideoChunkType/"key"}} frame, abort these steps.
1091
1129
1. For each |task| in |encoder|.`[[pendingKeyFrameTasks]]`, run the following steps:
1092
1130
1. If |frame| was generated for a layer [=list/contained=] in |task|.`[[layers]]`,
0 commit comments