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
The <dfn constructor for="SFrameTransform" lt="SFrameTransform(options)"><code>new SFrameTransform(<var>options</var>)</code></dfn> constructor steps are:
@@ -195,18 +217,29 @@ The <dfn constructor for="SFrameTransform" lt="SFrameTransform(options)"><code>n
195
217
196
218
The SFrame transform algorithm, given |sframe| as a SFrameTransform object and |frame|, runs these steps:
197
219
1. Let |role| be |sframe|.`[[role]]`.
198
-
2. If |frame|.`[[owner]]` is a {{RTCRtpSender}}, set |role| to 'encrypt'.
199
-
3. If |frame|.`[[owner]]` is a {{RTCRtpReceiver}}, set |role| to 'decrypt'.
200
-
4. Let |data| be undefined.
201
-
5. If |frame| is a {{BufferSource}}, set |data| to |frame|.
202
-
6. If |frame| is a {{RTCEncodedAudioFrame}}, set |data| to |frame|.{{RTCEncodedAudioFrame/data}}
203
-
7. If |frame| is a {{RTCEncodedVideoFrame}}, set |data| to |frame|.{{RTCEncodedVideoFrame/data}}
204
-
8. If |data| is undefined, abort these steps.
205
-
9. Let |buffer| be the result of running the SFrame algorithm with |data| and |role| as parameters. This algorithm is defined by the <a href="https://datatracker.ietf.org/doc/draft-omara-sframe/">SFrame specification</a> and returns an {{ArrayBuffer}}.
206
-
10. If |frame| is a {{BufferSource}}, set |frame| to |buffer|.
207
-
11. If |frame| is a {{RTCEncodedAudioFrame}}, set |frame|.{{RTCEncodedAudioFrame/data}} to |buffer|.
208
-
12. If |frame| is a {{RTCEncodedVideoFrame}}, set |frame|.{{RTCEncodedVideoFrame/data}} to |buffer|.
209
-
13. [=ReadableStream/Enqueue=] |frame| in |sframe|.`[[transform]]`.
220
+
1. If |frame|.`[[owner]]` is a {{RTCRtpSender}}, set |role| to 'encrypt'.
221
+
1. If |frame|.`[[owner]]` is a {{RTCRtpReceiver}}, set |role| to 'decrypt'.
222
+
1. Let |data| be undefined.
223
+
1. If |frame| is a {{BufferSource}}, set |data| to |frame|.
224
+
1. If |frame| is a {{RTCEncodedAudioFrame}}, set |data| to |frame|.{{RTCEncodedAudioFrame/data}}
225
+
1. If |frame| is a {{RTCEncodedVideoFrame}}, set |data| to |frame|.{{RTCEncodedVideoFrame/data}}
226
+
1. If |data| is undefined, abort these steps.
227
+
1. Let |buffer| be the result of running the SFrame algorithm with |data| and |role| as parameters. This algorithm is defined by the <a href="https://datatracker.ietf.org/doc/draft-omara-sframe/">SFrame specification</a> and returns an {{ArrayBuffer}}.
228
+
1. If the SFrame algorithm exits abruptly with an error, [=queue a task=] to run the following sub steps:
229
+
1. If the processing fails on decryption side due to |data| not following the SFrame format, [=fire an event=] named {{SFrameTransform/onerror|error}} at |sframe|,
230
+
using the {{SFrameTransformErrorEvent}} interface with its {{SFrameTransformErrorEvent/type}} attribute set to {{SFrameTransformErrorEventType/syntax}}
231
+
and its {{SFrameTransformErrorEvent/frame}} attribute set to |frame|.
232
+
1. If the processing fails on decryption side due to the key identifier parsed in |data| being unknown, [=fire an event=] named {{SFrameTransform/onerror|error}} at |sframe|,
233
+
using the {{SFrameTransformErrorEvent}} interface with its {{SFrameTransformErrorEvent/type}} attribute set to {{SFrameTransformErrorEventType/keyID}},
234
+
its {{SFrameTransformErrorEvent/frame}} attribute set to |frame| and its {{SFrameTransformErrorEvent/keyID}} attribute set to the keyID value parsed in the SFrame header.
235
+
1. If the processing fails on decryption side due to validation of the authentication tag, [=fire an event=] named {{SFrameTransform/onerror|error}} at |sframe|,
236
+
using the {{SFrameTransformErrorEvent}} interface with its {{SFrameTransformErrorEvent/type}} attribute set to {{SFrameTransformErrorEventType/authentication}}
237
+
and its {{SFrameTransformErrorEvent/frame}} attribute set to |frame|.
238
+
1. Abort these steps.
239
+
1. If |frame| is a {{BufferSource}}, set |frame| to |buffer|.
240
+
1. If |frame| is a {{RTCEncodedAudioFrame}}, set |frame|.{{RTCEncodedAudioFrame/data}} to |buffer|.
241
+
1. If |frame| is a {{RTCEncodedVideoFrame}}, set |frame|.{{RTCEncodedVideoFrame/data}} to |buffer|.
242
+
1. [=ReadableStream/Enqueue=] |frame| in |sframe|.`[[transform]]`.
210
243
211
244
## Methods ## {#sframe-transform-methods}
212
245
The <dfn method for="SFrameTransform">setEncryptionKey(|key|, |keyID|)</dfn> method steps are:
0 commit comments