Skip to content

Commit 0eb724e

Browse files
authored
Merge pull request #29 from alvestrand/processing-rules
Describe operational restrictions on transforms
2 parents 6ff25f0 + 86f5c28 commit 0eb724e

File tree

2 files changed

+118
-68
lines changed

2 files changed

+118
-68
lines changed

index.bs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Title: WebRTC Insertable Media using Streams
33
Shortname: webrtc-media-streams
44
Level: 1
5-
Status: DREAM
5+
Status: UD
66
Group: webrtc
77
Repository: alvestrand/webrtc-media-streams/
88
URL: https://alvestrand.github.io/webrtc-media-streams/
@@ -57,7 +57,7 @@ Furthermore, the "trusted JavaScript cloud conferencing" use case
5757
requires such processing to be done on encoded media, not just the raw
5858
media.
5959

60-
This specification gives an interface that builds on [[WEB-CODECS]] to
60+
This specification gives an interface inspired by [[WEB-CODECS]] to
6161
provide access to such functionality while retaining the setup flow of
6262
RTCPeerConnection.
6363

@@ -67,11 +67,6 @@ decoder part of a codec.
6767

6868
# Terminology # {#terminology}
6969

70-
<p noexport>
71-
The IDL terms <dfn type="idl-name">AudioEncoder</dfn>, <dfn>VideoEncoder</dfn>,
72-
<dfn>AudioDecoder</dfn>, <dfn>VideoDecoder</dfn> are defined in [[WEB-CODECS]].
73-
</p>
74-
7570
# Specification # {#specification}
7671

7772
The Streams definition doesn't use WebIDL much, but the WebRTC spec does.
@@ -114,7 +109,7 @@ interface RTCEncodedVideoFrame {
114109
readonly attribute RTCEncodedVideoFrameType type;
115110
readonly attribute unsigned long long timestamp;
116111
attribute ArrayBuffer data;
117-
RTCVideoFrameMetadata getMetadata();
112+
RTCEncodedVideoFrameMetadata getMetadata();
118113
};
119114

120115
dictionary RTCEncodedAudioFrameMetadata {
@@ -125,7 +120,7 @@ dictionary RTCEncodedAudioFrameMetadata {
125120
interface RTCEncodedAudioFrame {
126121
readonly attribute unsigned long long timestamp;
127122
attribute ArrayBuffer data;
128-
RTCAudioFrameMetadata getMetadata();
123+
RTCEncodedAudioFrameMetadata getMetadata();
129124
};
130125

131126

@@ -150,6 +145,9 @@ At the time when a codec is initialized as part of the encoder, and the
150145
corresponding flag is set in the {{RTCPeerConnection}}'s {{RTCConfiguration}}
151146
argument, ensure that the codec is disabled and produces no output.
152147

148+
149+
### Stream creation ### {#stream-creation}
150+
153151
Let the {{RTCRtpSender}} or {{RTCRtpReceiver}} have an internal slot,
154152
[[\Streams]], initialized to null.
155153

@@ -166,11 +164,15 @@ called, run the following steps:
166164
* Store 's' in the internal slot [[\Streams]].
167165
* Return 's'
168166

167+
### Stream processing ### {#stream-processing}
168+
169169
When a frame is produced from the encoded data source, place it on the
170170
[[\Streams]].readableStream'.
171171

172-
When a frame appears on the [[\Streams]].writableStream, process it as if it came
173-
directly from the encoded data source.
172+
When a frame appears on the [[\Streams]].writableStream, do the following:
173+
* Check that the frame is a a valid frame that has been created by the encoded data source; if it is not, discard it. A processor cannot create frames, or move frames between streams.
174+
* Check that the frame's {{RTCEncodedVideoFrame/timestamp}} is equal to or larger than any previously received frame. A processor cannot reorder frames, although it may delay them or drop them.
175+
* Process the frame as if it came directly from the encoded data source.
174176

175177
# Privacy and security considerations # {#privacy}
176178

0 commit comments

Comments
 (0)