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
+12-7
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,8 @@ 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]]` with its [=ReadableStream/set up/pullAlgorithm=] set to [$readEncodedData$] given |this| as parameter and its [=ReadableStream/set up/highWaterMark=] set to <code>Infinity</code>.
90
+
<p class="note">highWaterMark is set to Infinity to explicitly disable backpressure. The goal is to limit buffering as much as possible.</p>
90
91
5. Set [=this=].`[[readable]]`.`[[owner]]` to |this|.
91
92
6. Initialize [=this=].`[[writable]]` to a new {{WritableStream}}.
92
93
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>.
@@ -104,12 +105,16 @@ At construction of each {{RTCRtpSender}} or {{RTCRtpReceiver}}, run the followin
104
105
### Stream processing ### {#stream-processing}
105
106
106
107
The <dfn abstract-op>readEncodedData</dfn> algorithm is given a |rtcObject| as parameter. It is defined by running the following steps:
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
-
1. Increment |rtcObject|.`[[lastEnqueuedFrameCounter]]` by <code>1</code>.
109
-
1. Let |frame| be the newly produced frame.
110
-
1. Set |frame|.`[[owner]]` to |rtcObject|.
111
-
1. Set |frame|.`[[counter]]` to |rtcObject|.`[[lastEnqueuedFrameCounter]]`.
112
-
1. [=ReadableStream/Enqueue=] |frame| in |rtcObject|.`[[readable]]`.
108
+
1. Let |p| be a new promise.
109
+
1. Run the following steps in parallel:
110
+
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}}.
111
+
1. Increment |rtcObject|.`[[lastEnqueuedFrameCounter]]` by <code>1</code>.
112
+
1. Let |frame| be the newly produced frame.
113
+
1. Set |frame|.`[[owner]]` to |rtcObject|.
114
+
1. Set |frame|.`[[counter]]` to |rtcObject|.`[[lastEnqueuedFrameCounter]]`.
115
+
1. [=ReadableStream/Enqueue=] |frame| into |rtcObject|.`[[readable]]`.
116
+
1. Resolve |p| with <code>undefined</code>.
117
+
1. return |p|.
113
118
114
119
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
120
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.
0 commit comments