Skip to content

Commit 5f831fc

Browse files
committed
Make use of ReadableStream, WritableStream and TransformStream set up
1 parent 733f771 commit 5f831fc

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

index.bs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@ argument, ensure that the codec is disabled and produces no output.
103103
At construction of each {{RTCRtpSender}} or {{RTCRtpReceiver}}, run the following steps:
104104
1. Initialize [=this=].`[[Streams]]` to null.
105105
2. Initialize [=this=].`[[transform]]` to null.
106-
3. Initialize [=this=].`[[readable]]` to the result of <a dfn for="ReadableStream">creating</a> a {{ReadableStream}}. [=this=].`[[readable]]` is provided frames using the [=readEncodedData=] algorithm given |this| as parameter.
107-
4. Set [=this=].`[[readable]]`.`[[owner]]` to |this|.
108-
5. Initialize [=this=].`[[writable]]` to the result of [=WritableStream/creating=] a {{WritableStream}}, its [=WritableStream/create/writeAlgorithm=] set to [=writeEncodedData=] given |this| as parameter.
109-
6. Set [=this=].`[[writable]]`.`[[owner]]` to |this|.
110-
7. Initialize [=this=].`[[pipeToController]]` to null.
111-
8. Initialize [=this=].`[[lastReceivedFrameTimestamp]]` to zero.
112-
9. If the {{RTCPeerConnection}}'s configuration does not have {{RTCConfiguration/encodedInsertableStreams}} set to "true", [=queue a task=] to run the following steps:
106+
3. Initialize [=this=].`[[readable]]` to a new {{ReadableStream}}.
107+
4. <a dfn for="ReadableStream">Set up</a> [=this=].`[[readable]]`. [=this=].`[[readable]]` is provided frames using the [=readEncodedData=] algorithm given |this| as parameter.
108+
5. Set [=this=].`[[readable]]`.`[[owner]]` to |this|.
109+
6. Initialize [=this=].`[[writable]]` to a new {{WritableStream}}.
110+
7. <a dfn for="WritableStream">Set up</a> [=this=].`[[writable]]` with its [=WritableStream/set up/writeAlgorithm=] set to [=writeEncodedData=] given |this| as parameter.
111+
8. Set [=this=].`[[writable]]`.`[[owner]]` to |this|.
112+
9. Initialize [=this=].`[[pipeToController]]` to null.
113+
10. Initialize [=this=].`[[lastReceivedFrameTimestamp]]` to zero.
114+
11. If the {{RTCPeerConnection}}'s configuration does not have {{RTCConfiguration/encodedInsertableStreams}} set to "true", [=queue a task=] to run the following steps:
113115
1. If [=this=].`[[pipeToController]]` is not null, abort these steps.
114116
2. Set [=this=].`[[pipeToController]]` to a new {{AbortController}}.
115117
<!-- FIXME: Use pipeTo algorithm when available. -->
@@ -204,11 +206,12 @@ SFrameTransform includes GenericTransformStream;
204206

205207
The <dfn constructor for="SFrameTransform" lt="SFrameTransform(options)"><code>new SFrameTransform(<var>options</var>)</code></dfn> constructor steps are:
206208
1. Let |transformAlgorithm| be an algorithm which takes a |frame| as input and runs the <a href="#sframe-transform-algorithm">SFrame transform algorithm</a> with |this| and |frame|.
207-
2. Set |this|.`[[transform]]` to the result of [=TransformStream/creating=] a {{TransformStream}}, with [=TransformStream/create/transformAlgorithm=] set to |transformAlgorithm|.
208-
3. Let |options| be the method's first argument.
209-
4. Set |this|.`[[role]]` to |options|["{{SFrameTransformOptions/role}}"].
210-
5. Set |this|.`[[readable]]` to |this|.`[[transform]]`.`[[readable]]`.
211-
6. Set |this|.`[[writable]]` to |this|.`[[transform]]`.`[[writable]]`.
209+
2. Set |this|.`[[transform]]` to a new {{TransformStream}}.
210+
3. <a dfn for="ReadableStream">Set up</a> [=this=].`[[transform]]` with [=TransformStream/set up/transformAlgorithm=] set to |transformAlgorithm|.
211+
4. Let |options| be the method's first argument.
212+
5. Set |this|.`[[role]]` to |options|["{{SFrameTransformOptions/role}}"].
213+
6. Set |this|.`[[readable]]` to |this|.`[[transform]]`.`[[readable]]`.
214+
7. Set |this|.`[[writable]]` to |this|.`[[transform]]`.`[[writable]]`.
212215

213216
## Algorithm ## {#sframe-transform-algorithm}
214217

@@ -227,7 +230,7 @@ The SFrame transform algorithm, given |sframe| as a SFrameTransform object and |
227230
12. If |frame| is a {{RTCEncodedVideoFrame}}, set |frame|.{{RTCEncodedVideoFrame/data}} to |buffer|.
228231
13. [=ReadableStream/Enqueue=] |frame| in |sframe|.`[[transform]]`.
229232

230-
## Methods {#sframe-transform-methods}
233+
## Methods ## {#sframe-transform-methods}
231234
The <dfn method for="SFrameTransform">setEncryptionKey(|key|, |keyID|)</dfn> method steps are:
232235
1. Let |promise| be [=a new promise=].
233236
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.

0 commit comments

Comments
 (0)