Skip to content

Commit 402e6bb

Browse files
committed
Refined IDL, names to match implementation
1 parent 9e56e54 commit 402e6bb

File tree

2 files changed

+88
-45
lines changed

2 files changed

+88
-45
lines changed

index.bs

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ insert the processing into the pipeline.
8585
<pre class="idl">
8686
// New dictionary.
8787
dictionary RTCInsertableStreams {
88-
ReadableStream readable;
89-
WritableStream writable;
88+
ReadableStream readableStream;
89+
WritableStream writableStream;
9090
};
9191

9292
// New enum for video frame types. Will eventually re-use the equivalent defined
@@ -97,26 +97,29 @@ enum RTCEncodedVideoFrameType {
9797
"delta",
9898
};
9999

100-
dictionary RTCFrameMetadata {
100+
dictionary RTCVideoFrameMetadata {
101101
long synchronizationSource;
102102
sequence&lt;long&gt; contributingSources;
103103
};
104104

105105
// New interfaces to define encoded video and audio frames. Will eventually
106106
// re-use or extend the equivalent defined in WebCodecs.
107-
// The additionalData fields contain metadata about the frame and will
108-
// eventually be exposed differently.
109107
interface RTCEncodedVideoFrame {
110108
readonly attribute RTCEncodedVideoFrameType type;
111109
readonly attribute unsigned long long timestamp;
112110
attribute ArrayBuffer data;
113-
RTCFrameMetadata getMetadata();
111+
RTCVideoFrameMetadata getMetadata();
112+
};
113+
114+
dictionary RTCAudioFrameMetadata {
115+
long synchronizationSource;
116+
sequence&lt;long&gt; contributingSources;
114117
};
115118

116119
interface RTCEncodedAudioFrame {
117120
readonly attribute unsigned long long timestamp;
118121
attribute ArrayBuffer data;
119-
RTCFrameMetadata getMetadata();
122+
RTCAudioFrameMetadata getMetadata();
120123
};
121124

122125

@@ -144,22 +147,26 @@ At the time when a codec is initialized as part of the encoder, and the
144147
corresponding flag is set in the {{RTCPeerConnection}}'s {{RTCConfiguration}}
145148
argument, ensure that the codec is disabled and produces no output.
146149

150+
Let the {{RTCRtpSender}} or {{RTCRtpReceiver}} have an internal slot,
151+
[[\Streams]], initialized to null.
152+
147153
When {{RTCRtpSender/createEncodedVideoStreams}}() or {{RTCRtpSender/createEncodedAudioStreams}}() is
148154
called, run the following steps:
149155

150156
* If the kind of the sender does not match, throw a {{TypeError}} and abort these steps.
151157
* If the data source does not permit access, throw an {{InvalidAccessError}} and abort these steps.
158+
* If [[\Streams]] is not null, throw an {{InvalidStateError}}.
152159
* Create an {{RTCInsertableStreams}} object 's'.
153-
* Set s.readable to a ReadableStream representing the encoded data source.
154-
* Set s.writable to a WritableStream representing the encoded data sink.
160+
* Set s.readableStream to a ReadableStream representing the encoded data source.
161+
* Set s.writableStream to a WritableStream representing the encoded data sink.
155162
* Enable the encoded data source.
156-
* Store 's' in an internal slot [[\streams]].
163+
* Store 's' in the internal slot [[\Streams]].
157164
* Return 's'
158165

159166
When a frame is produced from the encoded data source, place it on the
160-
[[\streams]].readable' stream.
167+
[[\Streams]].readableStream'.
161168

162-
When a frame appears on the [[\streams]].writable stream, process it as if it came
169+
When a frame appears on the [[\Streams]].writableStream, process it as if it came
163170
directly from the encoded data source.
164171

165172
# Privacy and security considerations # {#privacy}

0 commit comments

Comments
 (0)