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
+11-2
Original file line number
Diff line number
Diff line change
@@ -89,8 +89,8 @@ At construction of each {{RTCRtpSender}} or {{RTCRtpReceiver}}, run the followin
89
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>.
93
-
<p class="note">Chunk size is set to 0 to explictly disable streams backpressure on the write side.</p>
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/highWaterMark=]set to <code>Infinity</code>.
93
+
<p class="note">highWaterMark is set to Infinity to explicitly disable backpressure.</p>
94
94
8. Set [=this=].`[[writable]]`.`[[owner]]` to |this|.
95
95
9. Initialize [=this=].`[[pipeToController]]` to null.
96
96
1. Initialize [=this=].`[[lastReceivedFrameCounter]]` to <code>0</code>.
@@ -101,6 +101,15 @@ At construction of each {{RTCRtpSender}} or {{RTCRtpReceiver}}, run the followin
101
101
<!-- FIXME: Use pipeTo algorithm when available. -->
102
102
3. Call <a href="https://streams.spec.whatwg.org/#readable-stream-pipe-to">pipeTo</a> with [=this=].`[[readable]]`, [=this=].`[[writable]]`, preventClose equal to true, preventAbort equal to true, preventCancel equal to true and [=this=].`[[pipeToController]]`.signal.
103
103
104
+
<p class=note>
105
+
Streams backpressure can optimize throughput while limiting processing and memory consumption by pausing data production as early as possible in a data pipeline.
106
+
This proves useful in contexts where reliability is essential and latency is less of a concern.
107
+
On the other hand, WebRTC media pipelines favour low latency over reliability, for instance by allowing to drop frames at various places and by using recovery mechanisms.
108
+
Buffering within a transform would add latency without allowing web applications to adapt much.
109
+
The User Agent is responsible for doing these adaptations, especially since it controls both ends of the transform.
110
+
For those reasons, streams backpressure is disabled in WebRTC encoded transforms.
111
+
</p>
112
+
104
113
### Stream processing ### {#stream-processing}
105
114
106
115
The <dfn abstract-op>readEncodedData</dfn> algorithm is given a |rtcObject| as parameter. It is defined by running the following steps:
0 commit comments