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
+50-62Lines changed: 50 additions & 62 deletions
Original file line number
Diff line number
Diff line change
@@ -86,10 +86,10 @@ argument, ensure that the codec is disabled and produces no output.
86
86
At construction of each {{RTCRtpSender}} or {{RTCRtpReceiver}}, run the following steps:
87
87
2. Initialize [=this=].`[[transform]]` to null.
88
88
3. Initialize [=this=].`[[readable]]` to a new {{ReadableStream}}.
89
-
4. <a dfn for="ReadableStream">Set up</a>[=this=].`[[readable]]`. [=this=].`[[readable]]` is provided frames using the [=readEncodedData=] algorithm given |this| as parameter.
89
+
4. <a dfn for="ReadableStream">Set up</a>[=this=].`[[readable]]`. [=this=].`[[readable]]` is provided frames using the [$readEncodedData$] algorithm given |this| as parameter.
90
90
5. Set [=this=].`[[readable]]`.`[[owner]]` to |this|.
91
91
6. Initialize [=this=].`[[writable]]` to a new {{WritableStream}}.
92
-
7. <a dfn for="WritableStream">Set up</a>[=this=].`[[writable]]` with its [=WritableStream/set up/writeAlgorithm=] set to [=writeEncodedData=] given |this| as parameter and its [=WritableStream/set up/sizeAlgorithm=] to an algorithm that returns <code>0</code>.
92
+
7. <a dfn for="WritableStream">Set up</a>[=this=].`[[writable]]` with its [=WritableStream/set up/writeAlgorithm=] set to [$writeEncodedData$] given |this| as parameter and its [=WritableStream/set up/sizeAlgorithm=] to an algorithm that returns <code>0</code>.
93
93
<p class="note">Chunk size is set to 0 to explictly disable streams backpressure on the write side.</p>
94
94
8. Set [=this=].`[[writable]]`.`[[owner]]` to |this|.
95
95
9. Initialize [=this=].`[[pipeToController]]` to null.
@@ -103,15 +103,15 @@ At construction of each {{RTCRtpSender}} or {{RTCRtpReceiver}}, run the followin
103
103
104
104
### Stream processing ### {#stream-processing}
105
105
106
-
The <dfn>readEncodedData</dfn> algorithm is given a |rtcObject| as parameter. It is defined by running the following steps:
106
+
The <dfn abstract-op>readEncodedData</dfn> algorithm is given a |rtcObject| as parameter. It is defined by running the following steps:
107
107
1. Wait for a frame to be produced by |rtcObject|'s encoder if it is a {{RTCRtpSender}} or |rtcObject|'s packetizer if it is a {{RTCRtpReceiver}}.
108
108
1. Increment |rtcObject|.`[[lastEnqueuedFrameCounter]]` by <code>1</code>.
109
109
1. Let |frame| be the newly produced frame.
110
110
1. Set |frame|.`[[owner]]` to |rtcObject|.
111
111
1. Set |frame|.`[[counter]]` to |rtcObject|.`[[lastEnqueuedFrameCounter]]`.
112
112
1. [=ReadableStream/Enqueue=] |frame| in |rtcObject|.`[[readable]]`.
113
113
114
-
The <dfn>writeEncodedData</dfn> algorithm is given a |rtcObject| as parameter and a |frame| as input. It is defined by running the following steps:
114
+
The <dfn abstract-op>writeEncodedData</dfn> algorithm is given a |rtcObject| as parameter and a |frame| as input. It is defined by running the following steps:
115
115
1. If |frame|.`[[owner]]` is not equal to |rtcObject|, abort these steps and return [=a promise resolved with=] undefined. A processor cannot create frames, or move frames between streams.
116
116
1. If |frame|.`[[counter]]` is equal or smaller than |rtcObject|.`[[lastReceivedFrameCounter]]`, abort these steps and return [=a promise resolved with=] undefined. A processor cannot reorder frames, although it may delay them or drop them.
117
117
1. Set |rtcObject|.`[[lastReceivedFrameCounter]]` to |frame|`[[counter]]`.
@@ -123,18 +123,18 @@ The <dfn>writeEncodedData</dfn> algorithm is given a |rtcObject| as parameter an
123
123
* If |rtcObject| is a {{RTCRtpReceiver}}, enqueue |frameCopy| it to |rtcObject|'s decoder, to be processed [=in parallel=].
124
124
1. Return [=a promise resolved with=] undefined.
125
125
126
-
On sender side, as part of [=readEncodedData=], frames produced by |rtcObject|'s encoder MUST be enqueued in |rtcObject|.`[[readable]]` in the encoder's output order.
127
-
As [=writeEncodedData=] ensures that the transform cannot reorder frames, the encoder's output order is also the order followed by packetizers to generate RTP packets and assign RTP packet sequence numbers.
126
+
On sender side, as part of [$readEncodedData$], frames produced by |rtcObject|'s encoder MUST be enqueued in |rtcObject|.`[[readable]]` in the encoder's output order.
127
+
As [$writeEncodedData$] ensures that the transform cannot reorder frames, the encoder's output order is also the order followed by packetizers to generate RTP packets and assign RTP packet sequence numbers.
128
128
129
-
On receiver side, as part of [=readEncodedData=], frames produced by |rtcObject|'s packetizer MUST be enqueued in |rtcObject|.`[[readable]]` in the same encoder's output order.
129
+
On receiver side, as part of [$readEncodedData$], frames produced by |rtcObject|'s packetizer MUST be enqueued in |rtcObject|.`[[readable]]` in the same encoder's output order.
130
130
To ensure the order is respected, the depacketizer will typically use RTP packet sequence numbers to reorder RTP packets as needed before enqueuing frames in |rtcObject|.`[[readable]]`.
131
-
As [=writeEncodedData=] ensures that the transform cannot reorder frames, this will be the order expected by |rtcObject|'s decoder.
131
+
As [$writeEncodedData$] ensures that the transform cannot reorder frames, this will be the order expected by |rtcObject|'s decoder.
132
132
133
133
## Extension attribute ## {#attribute}
134
134
135
135
A RTCRtpTransform has two private slots called `[[readable]]` and `[[writable]]`.
136
136
137
-
Each RTCRtpTransform has an <dfn>association steps</dfn> set, which is empty by default.
137
+
Each RTCRtpTransform has an <dfn abstract-op for=RTCRtpTransform>association steps</dfn> set, which is empty by default.
138
138
139
139
The <dfn attribute for="RTCRtpSender,RTCRtpReceiver">transform</dfn> getter steps are:
140
140
1. Return [=this=].`[[transform]]`.
@@ -146,14 +146,14 @@ The `transform` setter steps are:
146
146
4. Let |writer| be the result of [=WritableStream/getting a writer=] for |checkedTransform|.`[[writable]]`.
147
147
5. Initialize |newPipeToController| to a new {{AbortController}}.
148
148
6. If [=this=].`[[pipeToController]]` is not null, run the following steps:
149
-
1. [=AbortSignal/Add=] the [=chain transform algorithm=] to [=this=].`[[pipeToController]]`.signal.
149
+
1. [=AbortSignal/Add=] the [$chain transform algorithm$] to [=this=].`[[pipeToController]]`.signal.
@@ -579,8 +567,8 @@ The <dfn constructor for="RTCRtpScriptTransform" lt="RTCRtpScriptTransform(worke
579
567
580
568
// FIXME: Describe error handling (worker closing flag true at RTCRtpScriptTransform creation time. And worker being terminated while transform is processing data).
581
569
582
-
Each RTCRtpScriptTransform has the following set of [=association steps=], given |rtcObject|:
583
-
1. Let |transform| be the {{RTCRtpScriptTransform}} object that owns the [=association steps=].
570
+
Each RTCRtpScriptTransform has the following set of [$association steps$], given |rtcObject|:
571
+
1. Let |transform| be the {{RTCRtpScriptTransform}} object that owns the [$association steps$].
584
572
1. Let |encoder| be |rtcObject|'s encoder if |rtcObject| is a {{RTCRtpSender}} or undefined otherwise.
585
573
1. Let |depacketizer| be |rtcObject|'s depacketizer if |rtcObject| is a {{RTCRtpReceiver}} or undefined otherwise.
586
574
1. [=Queue a task=] on the DOM manipulation [=task source=] |worker|'s global scope to run the following steps:
@@ -590,12 +578,12 @@ Each RTCRtpScriptTransform has the following set of [=association steps=], given
590
578
591
579
The <dfn method for="RTCRtpScriptTransformer">generateKeyFrame(|rid|)</dfn> method steps are:
592
580
1. Let |promise| be a new promise.
593
-
1. Run the [=generate key frame algorithm=] with |promise|, |this|.`[[encoder]]` and |rid|.
581
+
1. Run the [$generate key frame algorithm$] with |promise|, |this|.`[[encoder]]` and |rid|.
594
582
1. Return |promise|.
595
583
596
584
The <dfn method for="RTCRtpScriptTransformer">sendKeyFrameRequest()</dfn> method steps are:
597
585
1. Let |promise| be a new promise.
598
-
1. Run the [=send request key frame algorithm=] with |promise| and |this|.`[[depacketizer]]`.
586
+
1. Run the [$send request key frame algorithm$] with |promise| and |this|.`[[depacketizer]]`.
0 commit comments