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
+21-1Lines changed: 21 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -62,13 +62,21 @@ an additional API on {{RTCRtpSender}} and {{RTCRtpReceiver}} to
62
62
insert the processing into the pipeline.
63
63
64
64
<pre class="idl">
65
+
// New fields in RTCConfiguration
66
+
partial dictionary RTCConfiguration {
67
+
boolean encodedInsertableStreams = false;
68
+
};
69
+
65
70
typedef (SFrameTransform or RTCRtpScriptTransform) RTCRtpTransform;
66
71
72
+
// New methods for RTCRtpSender and RTCRtpReceiver
67
73
partial interface RTCRtpSender {
74
+
RTCInsertableStreams createEncodedStreams();
68
75
attribute RTCRtpTransform? transform;
69
76
};
70
77
71
78
partial interface RTCRtpReceiver {
79
+
RTCInsertableStreams createEncodedStreams();
72
80
attribute RTCRtpTransform? transform;
73
81
};
74
82
</pre>
@@ -83,19 +91,31 @@ argument, ensure that the codec is disabled and produces no output.
83
91
### Stream creation ### {#stream-creation}
84
92
85
93
At construction of each {{RTCRtpSender}} or {{RTCRtpReceiver}}, run the following steps:
94
+
1. Initialize [=this=].`[[Streams]]` to null.
86
95
2. Initialize [=this=].`[[transform]]` to null.
87
96
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.
88
97
4. Set [=this=].`[[readable]]`.`[[owner]]` to |this|.
89
98
5. Initialize [=this=].`[[writable]]` to the result of [=WritableStream/creating=] a {{WritableStream}}, its [=WritableStream/create/writeAlgorithm=] set to [=writeEncodedData=] given |this| as parameter.
90
99
6. Set [=this=].`[[writable]]`.`[[owner]]` to |this|.
91
100
7. Initialize [=this=].`[[pipeToController]]` to null.
92
101
8. Initialize [=this=].`[[lastReceivedFrameTimestamp]]` to zero.
93
-
9. [=Queue a task=] to run the following steps:
102
+
9. If the {{RTCPeerConnection}}'s configuration does not have {{RTCConfiguration/encodedInsertableStreams}} set to "true", [=queue a task=] to run the following steps:
94
103
1. If [=this=].`[[pipeToController]]` is not null, abort these steps.
95
104
2. Set [=this=].`[[pipeToController]]` to a new {{AbortController}}.
96
105
<!-- FIXME: Use pipeTo algorithm when available. -->
97
106
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.
98
107
108
+
The <dfn method for="RTCRtpSender">createEncodedStreams()</dfn> method steps are:
109
+
110
+
1. If the {{RTCPeerConnection}}'s configuration does not have {{RTCConfiguration/encodedInsertableStreams}} set to "true", throw an "{{InvalidAccessError}}" {{DOMException}} and abort these steps.
111
+
2. If the data source does not permit access, throw an "{{InvalidAccessError}}" {{DOMException}} and abort these steps.
112
+
3. If [=this=].`[[Streams]]` is not null, throw an "{{InvalidAccessError}}" {{DOMException}}.
113
+
4. If [=this=].`[[pipeToController]]` is not null, throw an "{{InvalidAccessError}}" {{DOMException}}.
114
+
5. Set [=this=].`[[Streams]]` to an {{RTCInsertableStreams}} object.
115
+
6. Set [=this=].`[[Streams]]`.{{RTCInsertableStreams/readable}} to [=this=].`[[readable]]`.
116
+
7. Set [=this=].`[[Streams]]`.{{RTCInsertableStreams/writable}} to [=this=].`[[writable]]`.
0 commit comments