Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few editorial aspects #46

Merged
merged 2 commits into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 12 additions & 28 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,14 @@ Shortname: webrtc-media-streams
Level: None
Status: ED
Group: webrtc
Repository: w3c/webrtc-insertable-streams/
Repository: w3c/webrtc-insertable-streams
URL: https://w3c.github.io/webrtc-insertable-streams/
Editor: Harald Alvestrand, Google https://google.com, hta@google.com
Editor: Guido Urdaneta, Google https://google.com, guidou@google.com
Abstract: This API defines an API surface for manipulating the bits on
Abstract: MediaStreamTracks being sent via an RTCPeerConnection.
Abstract: {{MediaStreamTrack}}s being sent via an {{RTCPeerConnection}}.
Markup Shorthands: css no, markdown yes
</pre>
<pre class='anchors'>
spec: WEBRTC; urlPrefix: https://w3c.github.io/webrtc-pc/
type: interface
text: RTCPeerConnection; url: #dom-rtcpeerconnection
type: dictionary
text: RTCConfiguration; url: #dom-rtcconfiguration
spec: WEB-CODECS; urlPrefix: https://github.com/WICG/web-codecs/
type: interface
text: AudioEncoder; url: #dom-audioencoder
type: interface
text: AudioDecoder; url: #dom-audiodecoder
type: interface
text: VideoEncoder; url: #dom-videoencoder
type: interface
text: VideoDecoder; url: #dom-videodecoder
</pre>
<pre class=biblio>
{
"WEB-CODECS": {
Expand Down Expand Up @@ -151,27 +135,27 @@ argument, ensure that the codec is disabled and produces no output.
### Stream creation ### {#stream-creation}

Let the {{RTCRtpSender}} or {{RTCRtpReceiver}} have an internal slot,
[[\Streams]], initialized to null.
`[[Streams]]`, initialized to null.

When {{RTCRtpSender/createEncodedStreams}}() is
called, run the following steps:

* If the {{RTCPeerConnection}}'s configuration does not have {{RTCConfiguration/encodedInsertableStreams}} set to "true", throw an {{InvalidStateError}} and abort these steps.
* If the data source does not permit access, throw an {{InvalidAccessError}} and abort these steps.
* If [[\Streams]] is not null, throw an {{InvalidStateError}}.
* Create an {{RTCInsertableStreams}} object 's'.
* Set s.readable to a ReadableStream representing the encoded data source.
* Set s.writable to a WritableStream representing the encoded data sink.
* If `[[Streams]]` is not null, throw an {{InvalidStateError}}.
* Create an {{RTCInsertableStreams}} object |s|.
* Set |s|.{{RTCInsertableStreams/readable}} to a {{ReadableStream}} representing the encoded data source.
* Set |s|.{{RTCInsertableStreams/writable}} to a {{WritableStream}} representing the encoded data sink.
* Enable the encoded data source.
* Store 's' in the internal slot [[\Streams]].
* Return 's'
* Store |s| in the internal slot `[[Streams]]`.
* Return |s|

### Stream processing ### {#stream-processing}

When a frame is produced from the encoded data source, place it on the
[[\Streams]].readableStream'.
`[[Streams]]`.{{RTCInsertableStreams/readable}}.

When a frame appears on the [[\Streams]].writable, do the following:
When a frame appears on the `[[Streams]]`.{{RTCInsertableStreams/writable}}, do the following:
* 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.
* 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.
* Process the frame as if it came directly from the encoded data source.
Expand All @@ -191,6 +175,6 @@ otherwise unavailable, which allows some fingerprinting surface.

# Examples # {#examples}

See the explainer document.
See the [explainer document](https://github.com/w3c/webrtc-insertable-streams/blob/master/explainer.md#code-examples).


Loading