From 9ca64a029e08ce38b4dc34d77d07620c0668853e Mon Sep 17 00:00:00 2001 From: "mark a. foltz" Date: Mon, 19 Oct 2020 16:29:21 -0700 Subject: [PATCH 1/2] Adds a backpressure signal to the streaming protocol. --- index.bs | 27 ++++++++++++++++++++++++++- messages_appendix.cddl | 8 ++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/index.bs b/index.bs index e6c1a1a..b69fd4e 100644 --- a/index.bs +++ b/index.bs @@ -2121,7 +2121,26 @@ Video encoding sender stats include the following fields: During a streaming session, the receiver should send stats with the [=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 +receiving. + +If the receiver is using a buffer to hold frames before playing them out, it +should also sends the status of that buffer using the `remote-buffer-status` field. +It can have one of three values: + +- `enough-data`: The buffer has neither too much data nor insufficient data. +- `insufficient-data`: The buffer will underrun and not have sufficient frame + data at the time it is scheduled to be played out. +- `too-much-data`: At the current send rate, the buffer will overrun and future + frame data will be discarded before it can be played out. + +A sender that receives a status of `insufficient-data` should increase its send +rate, or switch to a more efficient encoding for future frames. A sender that +receives a status of `too-much-data` should decrease its send rate. + +If the receiver is playing frames immediately without buffering, it should always +report a buffering status of `enough-data`. + +The [=streaming-session-receiver-stats-event=] message contains the following fields: : streaming-session-id @@ -2162,6 +2181,9 @@ present, that indicates the value has not changed since the last value. : cumulative-decode-delay :: The sum of the time spent decoding frames received. +: remote-buffer-status : streaming-buffer-status +:: The status of the remote buffer for this encoding. + Video encoding receiver stats include the following fields. If not present, that indicates the value has not changed since the last value. @@ -2181,6 +2203,9 @@ value. : cumulative-decode-delay :: The sum of the time spent decoding frames received. +: remote-buffer-status : streaming-buffer-status +:: The status of the remote buffer for this encoding. + Requests, Responses, and Watches {#requests-responses-watches} =============================================================== diff --git a/messages_appendix.cddl b/messages_appendix.cddl index a9c2940..1ac66d2 100644 --- a/messages_appendix.cddl +++ b/messages_appendix.cddl @@ -706,6 +706,12 @@ streaming-session-sender-stats-event = { }] ; video } +streaming-buffer-status = &( + enough-data: 0 + insufficient-data: 1 + too-much-data: 2 +) + ; type key 132 streaming-session-receiver-stats-event = { 1: uint; streaming-session-id @@ -716,6 +722,7 @@ streaming-session-receiver-stats-event = { ? 3: microseconds ; cumulative-lost-duration ? 3: microseconds ; cumulative-buffer-delay ? 4: microseconds ; cumulative-decode-delay + ? 5: streaming-buffer-status ; remote-buffer-status }] ; audio ? 4: [1* { 1: uint ; encoding-id @@ -723,6 +730,7 @@ streaming-session-receiver-stats-event = { ? 3: uint ; cumulative-lost-frames ? 4: microseconds ; cumulative-buffer-delay ? 5: microseconds ; cumulative-decode-delay + ? 6: streaming-buffer-status ; remote-buffer-status }] ; video } From 0673f33f9b6ac5ba6de91a2334b1f0dd41b13a6e Mon Sep 17 00:00:00 2001 From: "mark a. foltz" Date: Tue, 16 Mar 2021 14:33:26 -0700 Subject: [PATCH 2/2] Fix typo --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 84cf8c3..f16c2af 100644 --- a/index.bs +++ b/index.bs @@ -2132,7 +2132,7 @@ It should send all of the following stats for all of the media streams it is receiving. If the receiver is using a buffer to hold frames before playing them out, it -should also sends the status of that buffer using the `remote-buffer-status` field. +should also send the status of that buffer using the `remote-buffer-status` field. It can have one of three values: - `enough-data`: The buffer has neither too much data nor insufficient data.