Skip to content

Commit 146a751

Browse files
committed
Reverting createEncodedStreams changes
1 parent d0d557c commit 146a751

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

index.bs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,21 @@ an additional API on {{RTCRtpSender}} and {{RTCRtpReceiver}} to
6262
insert the processing into the pipeline.
6363

6464
<pre class="idl">
65+
// New fields in RTCConfiguration
66+
partial dictionary RTCConfiguration {
67+
boolean encodedInsertableStreams = false;
68+
};
69+
6570
typedef (SFrameTransform or RTCRtpScriptTransform) RTCRtpTransform;
6671

72+
// New methods for RTCRtpSender and RTCRtpReceiver
6773
partial interface RTCRtpSender {
74+
RTCInsertableStreams createEncodedStreams();
6875
attribute RTCRtpTransform? transform;
6976
};
7077

7178
partial interface RTCRtpReceiver {
79+
RTCInsertableStreams createEncodedStreams();
7280
attribute RTCRtpTransform? transform;
7381
};
7482
</pre>
@@ -83,19 +91,31 @@ argument, ensure that the codec is disabled and produces no output.
8391
### Stream creation ### {#stream-creation}
8492

8593
At construction of each {{RTCRtpSender}} or {{RTCRtpReceiver}}, run the following steps:
94+
1. Initialize [=this=].`[[Streams]]` to null.
8695
2. Initialize [=this=].`[[transform]]` to null.
8796
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.
8897
4. Set [=this=].`[[readable]]`.`[[owner]]` to |this|.
8998
5. Initialize [=this=].`[[writable]]` to the result of [=WritableStream/creating=] a {{WritableStream}}, its [=WritableStream/create/writeAlgorithm=] set to [=writeEncodedData=] given |this| as parameter.
9099
6. Set [=this=].`[[writable]]`.`[[owner]]` to |this|.
91100
7. Initialize [=this=].`[[pipeToController]]` to null.
92101
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:
94103
1. If [=this=].`[[pipeToController]]` is not null, abort these steps.
95104
2. Set [=this=].`[[pipeToController]]` to a new {{AbortController}}.
96105
<!-- FIXME: Use pipeTo algorithm when available. -->
97106
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.
98107

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]]`.
117+
8. Enable the encoded data source.
118+
10. Return [=this=].`[[Streams]]`.
99119

100120
### Stream processing ### {#stream-processing}
101121

0 commit comments

Comments
 (0)