Skip to content

Commit ff612a0

Browse files
committed
Much more text
1 parent 63c4356 commit ff612a0

File tree

2 files changed

+136
-15
lines changed

2 files changed

+136
-15
lines changed

index.bs

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ spec: WEBRTC; urlPrefix: https://w3c.github.io/webrtc-pc/
2020
type: attribute
2121
for: RTCRtpEncodingParameters; text: priority; url: #dom-rtcrtpencodingparameters-priority
2222
</pre>
23+
<pre class=biblio>
24+
{
25+
"WEB-CODECS": {
26+
"href":
27+
"https://github.com/WICG/web-codecs/blob/master/explainer.md",
28+
"title": "Web Codecs explainer"
29+
}
30+
}
31+
</pre>
2332

2433
# Introduction
2534

@@ -29,6 +38,7 @@ including, but not limited to:
2938
* Funny Hats
3039
* Machine Learning
3140
* Virtual Reality Gaming
41+
3242
These use cases further require that processing can be done in worker
3343
threads (requirement N23-N24).
3444

@@ -47,6 +57,9 @@ The Streams definition doesn't use WebIDL much, but the WebRTC spec does.
4757
This specification shows the IDL extensions for WebRTC.
4858

4959
<pre class='idl'>
60+
typedef (AudioEncoder or VideoEncoder) Encoder;
61+
typedef (AudioDecoder or VideoDecoder) Decoder;
62+
5063
callback EncoderDecorator = Encoder(Encoder encoder, Config config);
5164
callback DecoderDecorator = Decoder(Decoder encoder, Config config);
5265

@@ -56,21 +69,30 @@ partial dictionary RTCConfiguration {
5669
};
5770
</pre>
5871

59-
## Additional operation
72+
## Extension operation
6073
At creation of an RTCPeerConnection, the following steps are added to
6174
the creation algorithm:
6275

63-
* Let the RTCPeerConnection object have two internal slots
64-
[[\EncoderFactory]] and [[\DecoderFactory]], initialized to null.
65-
* If the RTCConfiguration parameter contains a value for
66-
"encoderFactory", store that in [[\EncoderFactory]].
67-
* If the RTCConfiguration parameter contains a value for
68-
"decoderFactory", store that in [[\DecoderFactory]].
76+
* Let the RTCPeerConnection object have two internal slots named [[\EncoderFactory]] and [[\DecoderFactory]], initialized to null.
77+
* If the RTCConfiguration parameter contains a value for "encoderFactory", store that in [[\EncoderFactory]].
78+
* If the RTCConfiguration parameter contains a value for "decoderFactory", store that in [[\DecoderFactory]].
6979

7080
At the time when a codec is initialized as part of the encoder, run
7181
the following steps:
7282

73-
* If [[\EncoderFactory]] is null,
83+
* If the unencoded data source does not permit access, abort these steps. (OPEN ISSUE: How is this error surfaced?)
84+
* Let the unencoded data source be represented by a ReadableStream called "source".
85+
* Let the encoded data sink be represented by a WriteableStream called
86+
* "sink".
87+
* Let the internal encoder object be called "internalEncoder". "internalEncoder" will have a WritableStream property called "writable" (by virtue of being an instance of WebCodec).
88+
* "internalEncoder" will have a ReadableStream property called "readable".
89+
* If the PeerConnection's [[\EncoderFactory]] is null, pipe "source" to "writable", and pipe "readable" to "sink", and skip the rest of these steps.
90+
* Call the function stored in [[\EncoderFactory]], using the newly initialized encoder and its parameters as arguments.
91+
* Let the return value from the function be "encoder".
92+
* If "encoder" has an attribute "readable", pipe it to "sink". Otherwise, pipe the "internalEncoder"'s "readable" to "sink".
93+
* If "encoder" has an attribute "writable", pipe "source" to it. Otherwise, pipe "source" to the "internalEncoder"'s "writable".
94+
95+
The media will then be processed according to the rules of [[WEB-CODECS]].
7496

7597
# Privacy and security considerations
7698

0 commit comments

Comments
 (0)