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

Finish media streaming (session start, stats) #172

Merged
merged 71 commits into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
0369f26
Add streaming start/stop request/response, and clean up type keys.
pthatcherg May 22, 2019
480271c
Add CDDL for streaming stats
pthatcherg May 22, 2019
d79182c
Finish streaming stats
pthatcherg May 23, 2019
76ecd22
Add support for remoting.
pthatcherg May 23, 2019
c6fce71
Add Remote Playback API requirements
markafoltz May 10, 2019
d8d445c
Address comments by @mounrilamori
markafoltz May 14, 2019
a538efb
Add missing term, further edits
markafoltz May 14, 2019
d731931
Update language around media sources.
markafoltz May 22, 2019
b7fd6a4
Recommend zero-length connection IDs
pthatcherg May 22, 2019
94d17d8
Authentication via SPAKE2
May 29, 2019
dc4fabb
Fixed SPAKE2 link
May 29, 2019
62717ab
Clarified when PSK-consumer prompts the user for the PSK input
May 29, 2019
8dd9b7a
Added references to cipher suite components. Grammar.
May 31, 2019
49e91bd
Fix typo.
markafoltz May 31, 2019
7f8ae1f
Add agent-capbilitiy type and agent-info.capabilities field.
pthatcherg May 22, 2019
a1edeb4
Minor edits
markafoltz May 31, 2019
4798877
Add recommendation that agents display the complete (untruncated) dis…
pthatcherg Aug 2, 2019
aff86b1
Update discovery section
markafoltz Aug 6, 2019
08cfd43
Be even more clear about name handling.
markafoltz Aug 7, 2019
e5ee998
Update per chrisn@ feedback
markafoltz Aug 7, 2019
470ab06
Specify the mDNS token
markafoltz Aug 8, 2019
821da98
Fix CDDL
markafoltz Aug 8, 2019
5f8f485
Fix typo
markafoltz Aug 8, 2019
8ad8fa2
Add Protocol Extensions section.
markafoltz Aug 8, 2019
3f2d56e
Add message types table
markafoltz Aug 8, 2019
d9ae053
Add TODO
markafoltz Aug 8, 2019
76af02a
Add text for request and watch IDs
markafoltz Aug 8, 2019
f46ce60
Remove presentation-request-close-request and response
markafoltz Aug 12, 2019
bd70f65
Respond to pthatcherg@ comments
markafoltz Aug 13, 2019
ca23b5e
Respond to comments
markafoltz Aug 13, 2019
53de2f4
Add section on extension fields
markafoltz Aug 13, 2019
84660d4
Address jopbha@ comments
markafoltz Aug 14, 2019
3921190
Change auth-initiation-password to auth-initiation-token.
markafoltz Aug 19, 2019
928edf7
Add conflict resolution requirement
markafoltz Aug 19, 2019
11c78bf
Adds presentation-change-event
markafoltz Aug 19, 2019
8a51509
Add connection-count to close event
markafoltz Aug 20, 2019
8a3d4e5
Update Presentation API text"
markafoltz Aug 20, 2019
652ff2c
Replace pw with at
markafoltz Aug 20, 2019
c7a234a
Make auth-initiation-token mandatory.
markafoltz Aug 20, 2019
de54a76
Merge with gh-pages
markafoltz Aug 21, 2019
66324f4
Fix bad merge
markafoltz Aug 21, 2019
eb97189
Merge branch 'gh-pages' into remoting
markafoltz Aug 21, 2019
bc280aa
Fix some issues during merge
markafoltz Aug 22, 2019
ba1512e
Merge branch 'gh-pages' into streaming2
pthatcherg Sep 6, 2019
17c2c3a
Re-add data encodings/frames
pthatcherg Sep 6, 2019
5975060
Fix a bunch of minor things for streaming during PR review
pthatcherg Sep 6, 2019
1ad67e8
Specify which stats should be included
pthatcherg Sep 6, 2019
a7d0a4f
Specify codec name using RFC 6381.
pthatcherg Sep 6, 2019
4a12999
Merge branch 'streaming2' into remoting
pthatcherg Sep 6, 2019
208408f
Fix typos and undo spurious changes
pthatcherg Sep 6, 2019
eaed041
Fix type key colissions
pthatcherg Sep 6, 2019
f9d0034
Try to share structure between streaming and remoting
pthatcherg Sep 6, 2019
ca1dec7
Clean-up how we start a streaming session associated with a remote pl…
pthatcherg Sep 6, 2019
01fc8b6
Merge branch 'gh-pages' into remoting
pthatcherg Sep 6, 2019
c74434e
Merge branch 'streaming2' into remoting
pthatcherg Sep 6, 2019
f14171b
Say "RFC 6381 [=codecs parameter=]"
pthatcherg Sep 6, 2019
9754ca0
Merge pull request #213 from webscreens/streaming-codec-name
pthatcherg Sep 6, 2019
2d23f24
Merge branch 'streaming2' into remoting
markafoltz Sep 8, 2019
dd6119b
Merge branch 'remoting' into streaming2
markafoltz Sep 8, 2019
7cde467
Fix typos
markafoltz Sep 8, 2019
69966bd
Rebase
markafoltz Sep 8, 2019
ff91e85
Add supports-rotating to video capabilities
pthatcherg Sep 7, 2019
a78e7a9
Fix typo.
markafoltz Sep 8, 2019
511d298
Make other IDs follow the same state-token rules.
pthatcherg Sep 10, 2019
982e191
encoding-id as well should follow the rules.
pthatcherg Sep 10, 2019
3c42e9f
Make encoding default value references more explicit
pthatcherg Sep 10, 2019
78b9293
Make encoding default value references even more explicit.
pthatcherg Sep 10, 2019
408e2f3
Define what missing stats means.
pthatcherg Sep 10, 2019
95aff16
Make streaming-session-modify-response message more explicit.
pthatcherg Sep 10, 2019
cb099b9
Fix typos
markafoltz Sep 10, 2019
96dca50
Update HTML
markafoltz Sep 10, 2019
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
299 changes: 278 additions & 21 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ url: https://tools.ietf.org/html/rfc8122#section-5; type: dfn; spec: RFC8122; te
url: https://tools.ietf.org/html/rfc8122#section-5; type: dfn; spec: RFC8122; text: sha-512
url: https://tools.ietf.org/html/rfc8122#section-5; type: dfn; spec: RFC8122; text: md2
url: https://tools.ietf.org/html/rfc8122#section-5; type: dfn; spec: RFC8122; text: md5
url: https://tools.ietf.org/html/rfc6381#section-3; type: dfn; spec: RFC6381; text: codecs parameter
</pre>

<h2 class='no-num no-toc no-ref' id='document-status'>Status of this document</h2>
Expand Down Expand Up @@ -1409,17 +1410,12 @@ following properties:
: receive-video (required)
:: A list of capabilities for receiving video. For an explanation of fields, see below.

: receive-data (required)
:: A list of arbitrary data formats the device supports
for receiving data.

The format type is used as the basis for audio, video, and data capabilities.
The format type is used as the basis for audio and video capabilities.
Formats are composed of the following properties:

<!-- TODO, specify where names are defined. -->

: name (required)
:: The name of the format. Expected values include "vp8", "h264", "opus."
:: The name of the codec. This must be a single-codec RFC 6381 [=codecs parameter=].

<!-- TODO, specify where codec-specific parameters are defined. -->

Expand Down Expand Up @@ -1484,8 +1480,163 @@ following additional fields:
Sessions {#streaming-sessions}
------------------------------------

TODO
To start a streaming session, a sender may send a
pthatcherg marked this conversation as resolved.
Show resolved Hide resolved
streaming-session-start-request message with the following properties:

: streaming-session-id
:: Identifies the streaming session. Must be unique for the (sender,
markafoltz marked this conversation as resolved.
Show resolved Hide resolved
receiver) pair. Can be used later to modify or terminate a
streaming session.

: desired-stats-interval
:: Indicates the frequency the receiver should send stats messages to
the sender.

: stream-offers
:: Indicates the streams that the receiver can request from the sender.

Each stream offer contains the following properties:

: media-stream-id
:: Identifies the media stream being offered. Must be unique within
the streaming session. Can be used by the receiver to request the
pthatcherg marked this conversation as resolved.
Show resolved Hide resolved
media session.

: display-name
:: An optional name intended to be shown to a user, such that the
receiver may allow the user to choose which media streams to
receive, or if they are received automatically by the receiver,
give the user some information about what th e media stream is.
markafoltz marked this conversation as resolved.
Show resolved Hide resolved

: audio
:: A list of audio encodings offered. An audio encoding is a series
of encoded audio frames. Encodings define properties needed by
the receiver to know how to decode the encoding, such as codec and
sample rate. They can differ by codec and related properties,
but should be different encodings of the same audio.

: video
:: A list of video encodings offered. A video encoding is a series of
encoded video frames. Encodings define properties needed by the
receiver to know how to decode the encoding, such as codec and
default duration. They can differ by codec and potentially other
properties, but should be different encodings of the same video.

pthatcherg marked this conversation as resolved.
Show resolved Hide resolved
: data
:: A list of data encodings offered. A data encoding is a series of
data frames. Encodings define properties needed by the
receiver to know how to interpret the encoding, such as data type and
default duration. They can differ by data type and potentially other
properties, but should be different encodings of the same data.
(For encodings of different data, use distinct media streams,
not distinct encodints with the same media stream).


Each audio encoding offered defines the following properties:

: encoding-id
:: Identifies the audio encoding being offered. Must be unique within
the media stream.

: codec-name
:: The name of the codec used by the encoding. This must be a single-codec
RFC 6381 [=codecs parameter=].

: time-scale
:: The time scale used by all audio frames. This allows senders to
make audio-frame messages smaller by not including the time scale
in each one.

: default-duration:
:: The duration of an audio frame . This allows senders to make
markafoltz marked this conversation as resolved.
Show resolved Hide resolved
audio-frame messages smaller by not including the duration for
audio-frame messages that have the default duration.

Each video encoding offered defines the following properties:

: encoding-id
:: Identifies the video encoding being offered. Must be unique within
the media stream.

: codec-name
:: The name of the codec used by the encoding.

: time-scale
:: The time scale used by all video frames. This allows senders to
make video-frame messages smaller by not including the time scale
in each one.

: default-duration:
:: The default duration of a video frame . This allows senders to make
markafoltz marked this conversation as resolved.
Show resolved Hide resolved
video-frame messages smaller by not including the duration for
video-frame messages that have the default duration.

: default-rotation:
:: The default rotation of a video frame . This allows senders to make
markafoltz marked this conversation as resolved.
Show resolved Hide resolved
video-frame messages smaller by not including the rotation for
video-frame messages that have the default rotation.

Each data encoding offered defines the following properties:

: encoding-id
:: Identifies the data encoding being offered. Must be unique within
the media stream.

: data-type-name
:: The name of the data type used by the encoding.

: time-scale
:: The time scale used by all data frames. This allows senders to
make data-frame messages smaller by not including the time scale
in each one.

: default-duration:
:: The duration of an data frame . This allows senders to make
data-frame messages smaller by not including the duration for
data-frame messages that have the default duration.

After receiving a streaming-session-start-request message, a receiver
should send back a streaming-session-start-response message with the
following properties:

: desired-stats-interval
:: Indicates the frequency the sender should send stats messages to
pthatcherg marked this conversation as resolved.
Show resolved Hide resolved
the receiver.

: stream-requests
pthatcherg marked this conversation as resolved.
Show resolved Hide resolved
:: Indicates which media streams the receiver would like to receiver
markafoltz marked this conversation as resolved.
Show resolved Hide resolved
from the sender.

Each stream request contains the following properties:

: media-stream-id
:: The ID of the stream reqeusted.

: audio (optional)
:: The requested audio encoding, by encoding ID
pthatcherg marked this conversation as resolved.
Show resolved Hide resolved

: video (optional)
:: The requested video encoding, by encoding ID. It may
include a target resolution and maximum frame rate. The sender
should not exceed the maximum frame rate and should attempt to
send at the target bitrate, possibly exceeding it by a small amount.

: data (optional)
:: The requested data encoding, by encoding ID


During a streaming session, the receiver can modify the requests it
pthatcherg marked this conversation as resolved.
Show resolved Hide resolved
made for encodings by sending a streaming-session-modify-request
containing a modify list of stream-requests. When the sender receives
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Fix typo before merging

a streaming-session-modify-request, it should send back a
streaming-session-modify-response.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How should the sender populate the values in the response?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's basically just an OK/error response.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some text to clarify?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure


Finally, the sender may terminate the streaming session by sending
a streaming-session-terminate-request command. When the receiver
receives the streaming-session-terminate-request, it should send back
a streaming-session-terminate-response. The receiver can terminate at
any point and notify the sender by sending a
streaming-session-terminate-event message.

Audio {#streaming-audio}
------------------------------
Expand Down Expand Up @@ -1518,13 +1669,13 @@ separate QUIC streams.
helps to avoid sending duplicate information in every frame.

: start-time
:: Identifies the beginning of the time range of the audio frame. The time
:: Identifies the beginning of the time range of the audio frame. The time
scale is inferred from the properties of the encoding (from the
audio-encoding-offer). The end time can be inferred from the
start time and duration.

: duration
:: If present, the duration of the audio frame. The time
:: If present, the duration of the audio frame. The time
scale is inferred from the properties of the encoding. Likewise, if not
present, the duration is inferred from the properties of the encoding.

Expand Down Expand Up @@ -1573,14 +1724,14 @@ ending at the last dependent frame.
If not present, the default value is [-1].

: start-time
:: Identifies the beginning of the time range of the video frame. The time
:: Identifies the beginning of the time range of the video frame. The time
scale is inferred from the properties of the encoding (from the
video-encoding-offer). The end time can be inferred from the
start time and duration.

: duration
:: If present, the duration of the video frame. The time
scale is inferred from the properties of the encoding. If not
:: If present, the duration of the video frame. The time
scale is inferred from the properties of the encoding. If not
present, that means duration is unknown.

: sync-time
Expand All @@ -1598,24 +1749,21 @@ ending at the last dependent frame.
inferred from the properties of the encoding.


Data {#media-streaming-data}
pthatcherg marked this conversation as resolved.
Show resolved Hide resolved
Data {#streaming-data}
------------------------------------

Media senders may send timed data to media receivers by sending [=data-frame=] messages (see
[[#appendix-a]]) with the following keys and values. A data frame message
contains an arbitrary payload that can be synchronized with and video, such as
text track data. A series of data frames that share a data type and timeline
contains an arbitrary payload that can be synchronized with audio and video.
A series of data frames that share a data type and timeline
form a data encoding.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Fix line wrapping


To allow for data frames to be sent out of order, they may be sent in separate
QUIC streams, but more than one data frame may be sent in one QUIC stream if
that makes sense for a specific type of data.

Text track data uses a payload type of text, a default duration of unknown, and
a timescale of 1000000 (microseconds).

: encoding-id
:: Identifies the media encoding to which this data frame belongs. This can be
:: Identifies the data encoding to which this data frame belongs. This can be
used to reference properties of the encoding such as the type of data and
time scale. Referencing properties of the encoding through the encoding id
helps to avoid sending duplicate information in every frame.
Expand Down Expand Up @@ -1672,7 +1820,116 @@ QUIC streams.
Stats {#streaming-stats}
------------------------------

TODO
During a streaming session, the sender should send stats with the
streaming-session-sender-stats-event at the interval the receiver requested. It
should send all of the following stats for all of the media streams it is
sending. The streaming-session-sender-stats-event message contains the following
properties:

: streaming-session-id
:: The ID of the streaming session these stats apply to.

: system-time
markafoltz marked this conversation as resolved.
Show resolved Hide resolved
:: The time when the stats were calculated, using a monotonic system
clock.

: audio
:: Stats specific to audio. Stats for multiple encodings can be sent
at once, but encodings need not be included if the stats haven't
changed. See below.

: video
:: Stats specific to video. Stats for multiple encodings can be sent
at once, but encodings need not be included if the stats haven't
changed. See below.

Audio encoding sender stats include the following properties:

: encoding-id
:: The ID of the encoding for which the stats apply.

: cumulative-sent-frames
markafoltz marked this conversation as resolved.
Show resolved Hide resolved
:: The total number of frames sent.

: cumulative-encode-delay
:: The sum of the time spent encoding frames sent.

Video encoding sender stats include the following properties:

: encoding-id
:: The ID of the encoding for which the stats apply.

: cumulative-sent-duration
:: The sum of all of the durations of all of the audio frames sent.

: cumulative-encode-delay
:: The sum of the time spent encoding frames sent.

: cumulative-dropped frames
:: The total number of frames that were not sent due to network, CPU,
or other contraints.


Durings a streaming session, the receiver should send stats with the
markafoltz marked this conversation as resolved.
Show resolved Hide resolved
streaming-session-receiver-stats-event at the interval the sender requested.
It should send all of the following stats for all of the media streams it is
receiving. The streaming-session-receiver-stats-event message contains the
following properties:

: streaming-session-id
:: The ID of the streaming session these stats apply to.

: system-time
pthatcherg marked this conversation as resolved.
Show resolved Hide resolved
:: The time when the stats were calculated, using a monotonic system
clock.

: audio
:: Stats specific to audio. Stats for multiple encodings can be sent
at once, but encodings need not be included if the stats haven't
changed. See below.

: video
:: Stats specific to video. Stats for multiple encodings can be sent
at once, but encodings need not be included if the stats haven't
changed. See below.

Audio encoding receiver stats include the following properties:

: encoding-id
:: The ID of the encoding for which the stats apply.

: cumulative-decoded-frames
:: The total number of audio frames received and decoded.

: cumulative-received-duration
:: The sum of all of the durations of all of the audio frames received.

: cumulative-lost-duration
:: The sum of all of the durations of all of the audio frames detected as lost.

: cumulative-buffer-delay
:: The sum of the time frames spent buffered between receipt and playout.

: cumulative-decode-delay
:: The sum of the time spent decoding frames received.

Video encoding receiver stats include the following properties:

: encoding-id
:: The ID of the encoding for which the stats apply.

: cumulative-decoded-frames
:: The total number of video frames received and decoded.

: cumulative-lost-frames
:: The total number of video frames detected as lost.

: cumulative-buffer-delay
:: The sum of the time frames spent buffered between receipt and render.

: cumulative-decode-delay
:: The sum of the time spent decoding frames received.


Requests, Responses, and Watches {#requests-responses--watches}
===============================================================
Expand Down
Loading