From 54b82fdf77de5d10216763b2df3fdefdbe072480 Mon Sep 17 00:00:00 2001 From: Palak Agarwal Date: Thu, 3 Aug 2023 13:31:55 +0200 Subject: [PATCH 01/10] Update index.bs to include IDL changes for setMetadata --- index.bs | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/index.bs b/index.bs index 81fa054..ebd9b57 100644 --- a/index.bs +++ b/index.bs @@ -339,7 +339,8 @@ dictionary RTCEncodedVideoFrameMetadata { unsigned long synchronizationSource; octet payloadType; sequence<unsigned long> contributingSources; - long long timestamp; // microseconds + unsigned long rtpTimestamp; + long long presentationTimestamp; // microseconds }; @@ -373,8 +374,19 @@ dictionary RTCEncodedVideoFrameMetadata { The list of contribution sources (csrc list) as defined in [[RFC3550]].

+
- timestamp of type rtpTimestamp of type unsigned long +
+
+

+ The RTP timestamp identifier is an unsigned integer value per [[RFC3550]] + that reflects the sampling instant of the first octet in the RTP data packet. +

+
+ +
+ presentationTimestamp of type long long
@@ -393,9 +405,9 @@ dictionary RTCEncodedVideoFrameMetadata { [Exposed=(Window,DedicatedWorker)] interface RTCEncodedVideoFrame { readonly attribute RTCEncodedVideoFrameType type; - readonly attribute unsigned long timestamp; attribute ArrayBuffer data; RTCEncodedVideoFrameMetadata getMetadata(); + void setMetadata(RTCEncodedVideoFrameMetadata metadata); }; @@ -411,15 +423,6 @@ interface RTCEncodedVideoFrame {

-
- timestamp of type unsigned long -
-
-

- The RTP timestamp identifier is an unsigned integer value per [[RFC3550]] - that reflects the sampling instant of the first octet in the RTP data packet. -

-
data of type ArrayBuffer
@@ -440,6 +443,14 @@ interface RTCEncodedVideoFrame { Returns the metadata associated with the frame.

+
+ setMetadata() +
+
+

+ Sets a new metadata that would be associated with the frame. +

+
## RTCEncodedAudioFrameMetadata dictionary ## {#RTCEncodedAudioFrameMetadata} @@ -498,7 +509,7 @@ dictionary RTCEncodedAudioFrameMetadata {
 [Exposed=(Window,DedicatedWorker)]
 interface RTCEncodedAudioFrame {
-    readonly attribute unsigned long timestamp;
+    attribute unsigned long timestamp;
     attribute ArrayBuffer data;
     RTCEncodedAudioFrameMetadata getMetadata();
 };

From 05d28f7b6ff0778ed8dbcf3ce448a2e5416be3c8 Mon Sep 17 00:00:00 2001
From: Palak Agarwal 
Date: Thu, 3 Aug 2023 13:35:34 +0200
Subject: [PATCH 02/10] Change dfn tag

---
 index.bs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/index.bs b/index.bs
index ebd9b57..9735039 100644
--- a/index.bs
+++ b/index.bs
@@ -376,7 +376,7 @@ dictionary RTCEncodedVideoFrameMetadata {
     
 
     
- rtpTimestamp of type unsigned long + rtpTimestamp of type unsigned long

@@ -386,7 +386,7 @@ dictionary RTCEncodedVideoFrameMetadata {

- presentationTimestamp of type presentationTimestamp of type long long
From 6120dcee8d97bf3c1ff31cf13cb52a81d6b40f89 Mon Sep 17 00:00:00 2001 From: Palak Agarwal Date: Fri, 4 Aug 2023 14:31:44 +0200 Subject: [PATCH 03/10] Remove restriction on streams being limited to only one PC --- index.bs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 9735039..8587c0e 100644 --- a/index.bs +++ b/index.bs @@ -121,7 +121,7 @@ The readEncodedData algorithm is given a |rtcObject| as p 1. [=ReadableStream/Enqueue=] |frame| in |rtcObject|.`[[readable]]`. The writeEncodedData algorithm is given a |rtcObject| as parameter and a |frame| as input. It is defined by running the following steps: -1. If |frame|.`[[owner]]` is not equal to |rtcObject|, abort these steps and return [=a promise resolved with=] undefined. A processor cannot create frames, or move frames between streams. +1. If |frame|.`[[owner]]` is not equal to |rtcObject|, skip to step 4. In this case, either frames were created or moved between streams. 1. If |frame|.`[[counter]]` is equal or smaller than |rtcObject|.`[[lastReceivedFrameCounter]]`, abort these steps and return [=a promise resolved with=] undefined. A processor cannot reorder frames, although it may delay them or drop them. 1. Set |rtcObject|.`[[lastReceivedFrameCounter]]` to |frame|`[[counter]]`. 1. Let |data| be |frame|.`[[data]]`. @@ -448,7 +448,9 @@ interface RTCEncodedVideoFrame {

- Sets a new metadata that would be associated with the frame. + Sets a new metadata that would be associated with the frame. Only allowed to change the fields + frameId, dependencies and rtpTimetsamp in the RTCEncodedVideoFrameMetadata. All other changes + are not allowed and should return an error.

From 9eb6c9df4bba1a4a2e6642191c1faa2b2f1ce8e6 Mon Sep 17 00:00:00 2001 From: Palak Agarwal Date: Tue, 5 Sep 2023 14:16:06 +0200 Subject: [PATCH 04/10] Update index.bs to only include metadata changes necessary for 3.2.2 --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 8587c0e..a0139cc 100644 --- a/index.bs +++ b/index.bs @@ -121,7 +121,7 @@ The readEncodedData algorithm is given a |rtcObject| as p 1. [=ReadableStream/Enqueue=] |frame| in |rtcObject|.`[[readable]]`. The writeEncodedData algorithm is given a |rtcObject| as parameter and a |frame| as input. It is defined by running the following steps: -1. If |frame|.`[[owner]]` is not equal to |rtcObject|, skip to step 4. In this case, either frames were created or moved between streams. +1. If |frame|.`[[owner]]` is not equal to |rtcObject|, abort these steps and return [=a promise resolved with=] undefined. A processor cannot create frames, or move frames between streams. 1. If |frame|.`[[counter]]` is equal or smaller than |rtcObject|.`[[lastReceivedFrameCounter]]`, abort these steps and return [=a promise resolved with=] undefined. A processor cannot reorder frames, although it may delay them or drop them. 1. Set |rtcObject|.`[[lastReceivedFrameCounter]]` to |frame|`[[counter]]`. 1. Let |data| be |frame|.`[[data]]`. From c932a82b83a310197108c33c57131ead8917775f Mon Sep 17 00:00:00 2001 From: Palak Agarwal Date: Tue, 5 Sep 2023 14:25:49 +0200 Subject: [PATCH 05/10] Update index.bs to have consistent defintion for audio and video --- index.bs | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/index.bs b/index.bs index a0139cc..04e8fcf 100644 --- a/index.bs +++ b/index.bs @@ -462,6 +462,7 @@ dictionary RTCEncodedAudioFrameMetadata { octet payloadType; sequence<unsigned long> contributingSources; short sequenceNumber; + attribute unsigned long rtpTimestamp; };
### Members ### {#RTCEncodedAudioFrameMetadata-members} @@ -505,29 +506,29 @@ dictionary RTCEncodedAudioFrameMetadata { Comparing two sequence numbers requires serial number arithmetic described in [[RFC1982]].

+
+ rtpTimestamp of type unsigned long +
+
+

+ The RTP timestamp identifier is an unsigned integer value per [[RFC3550]] + that reflects the sampling instant of the first octet in the RTP data packet. +

+
## RTCEncodedAudioFrame interface ## {#RTCEncodedAudioFrame-interface}
 [Exposed=(Window,DedicatedWorker)]
 interface RTCEncodedAudioFrame {
-    attribute unsigned long timestamp;
     attribute ArrayBuffer data;
     RTCEncodedAudioFrameMetadata getMetadata();
+    void setMetadata(RTCEncodedAudioFrameMetadata metadata);
 };
 
### Members ### {#RTCEncodedAudioFrame-members}
-
- timestamp of type unsigned long -
-
-

- The RTP timestamp identifier is an unsigned integer value per [[RFC3550]] - that reflects the sampling instant of the first octet in the RTP data packet. -

-
data of type ArrayBuffer
@@ -550,6 +551,16 @@ interface RTCEncodedAudioFrame {
+
+ setMetadata() +
+
+

+ Sets a new metadata that would be associated with the frame. Only allowed to change + the rtpTimetsamp field in the RTCEncodedAudioFrameMetadata. All other changes are + not allowed and should return an error. +

+
// New interfaces to expose JavaScript-based transforms. ##Interfaces From 5727c4a1e7efbe64b3a985fb7042ee24da16f6ab Mon Sep 17 00:00:00 2001 From: Palak Agarwal Date: Tue, 5 Sep 2023 14:32:23 +0200 Subject: [PATCH 06/10] Update index.bs to include formatting changes --- index.bs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/index.bs b/index.bs index 04e8fcf..63dd0ac 100644 --- a/index.bs +++ b/index.bs @@ -374,7 +374,6 @@ dictionary RTCEncodedVideoFrameMetadata { The list of contribution sources (csrc list) as defined in [[RFC3550]].

-
rtpTimestamp of type unsigned long
@@ -384,7 +383,6 @@ dictionary RTCEncodedVideoFrameMetadata { that reflects the sampling instant of the first octet in the RTP data packet.

-
presentationTimestamp of type long long @@ -462,7 +460,7 @@ dictionary RTCEncodedAudioFrameMetadata { octet payloadType; sequence<unsigned long> contributingSources; short sequenceNumber; - attribute unsigned long rtpTimestamp; + unsigned long rtpTimestamp; }; ### Members ### {#RTCEncodedAudioFrameMetadata-members} @@ -507,7 +505,7 @@ dictionary RTCEncodedAudioFrameMetadata {

- rtpTimestamp of type unsigned long + rtpTimestamp of type unsigned long

@@ -549,8 +547,6 @@ interface RTCEncodedAudioFrame { Returns the metadata associated with the frame.

- -
setMetadata()
@@ -561,6 +557,8 @@ interface RTCEncodedAudioFrame { not allowed and should return an error.

+ + // New interfaces to expose JavaScript-based transforms. ##Interfaces From bafe76ccbb284ceb313a14404f2d077db443961c Mon Sep 17 00:00:00 2001 From: Palak Agarwal Date: Wed, 11 Oct 2023 14:44:12 +0200 Subject: [PATCH 07/10] Apply suggestions from code review Co-authored-by: Dominique Hazael-Massieux --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 0466461..783e830 100644 --- a/index.bs +++ b/index.bs @@ -406,7 +406,7 @@ interface RTCEncodedVideoFrame { readonly attribute RTCEncodedVideoFrameType type; attribute ArrayBuffer data; RTCEncodedVideoFrameMetadata getMetadata(); - void setMetadata(RTCEncodedVideoFrameMetadata metadata); + undefined setMetadata(RTCEncodedVideoFrameMetadata metadata); }; @@ -544,7 +544,7 @@ dictionary RTCEncodedAudioFrameMetadata { interface RTCEncodedAudioFrame { attribute ArrayBuffer data; RTCEncodedAudioFrameMetadata getMetadata(); - void setMetadata(RTCEncodedAudioFrameMetadata metadata); + undefined setMetadata(RTCEncodedAudioFrameMetadata metadata); }; From 88a559c9e7235b9ec73ed9c712684812c18d7f85 Mon Sep 17 00:00:00 2001 From: Palak Agarwal Date: Wed, 11 Oct 2023 16:25:22 +0200 Subject: [PATCH 08/10] Update index.bs --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 783e830..e0980e2 100644 --- a/index.bs +++ b/index.bs @@ -406,7 +406,7 @@ interface RTCEncodedVideoFrame { readonly attribute RTCEncodedVideoFrameType type; attribute ArrayBuffer data; RTCEncodedVideoFrameMetadata getMetadata(); - undefined setMetadata(RTCEncodedVideoFrameMetadata metadata); + undefined setMetadata(required RTCEncodedVideoFrameMetadata metadata); }; @@ -544,7 +544,7 @@ dictionary RTCEncodedAudioFrameMetadata { interface RTCEncodedAudioFrame { attribute ArrayBuffer data; RTCEncodedAudioFrameMetadata getMetadata(); - undefined setMetadata(RTCEncodedAudioFrameMetadata metadata); + undefined setMetadata(required RTCEncodedAudioFrameMetadata metadata); }; From 54bb9c2750f4d79490474343cb34ecfbf084e6f9 Mon Sep 17 00:00:00 2001 From: Palak Agarwal Date: Wed, 11 Oct 2023 16:56:17 +0200 Subject: [PATCH 09/10] Update index.bs --- index.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index e0980e2..450b245 100644 --- a/index.bs +++ b/index.bs @@ -330,8 +330,8 @@ enum RTCEncodedVideoFrameType { ## RTCEncodedVideoFrameMetadata dictionary ## {#RTCEncodedVideoFrameMetadata}
 dictionary RTCEncodedVideoFrameMetadata {
-    unsigned long long frameId;
-    sequence<unsigned long long> dependencies;
+    required unsigned long long frameId;
+    required sequence<unsigned long long> dependencies;
     unsigned short width;
     unsigned short height;
     unsigned long spatialIndex;
@@ -340,7 +340,7 @@ dictionary RTCEncodedVideoFrameMetadata {
     octet payloadType;
     sequence<unsigned long> contributingSources;
     long long timestamp;    // microseconds
-    unsigned long rtpTimestamp;
+    required unsigned long rtpTimestamp;
 };
 
@@ -483,7 +483,7 @@ dictionary RTCEncodedAudioFrameMetadata { octet payloadType; sequence<unsigned long> contributingSources; short sequenceNumber; - unsigned long rtpTimestamp; + required unsigned long rtpTimestamp; }; ### Members ### {#RTCEncodedAudioFrameMetadata-members} From 0a86a80e3a634d53cd88fd88e95e103bd0f6216b Mon Sep 17 00:00:00 2001 From: Palak Agarwal Date: Thu, 12 Oct 2023 10:09:47 +0200 Subject: [PATCH 10/10] Update index.bs --- index.bs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.bs b/index.bs index 450b245..88b272c 100644 --- a/index.bs +++ b/index.bs @@ -330,8 +330,8 @@ enum RTCEncodedVideoFrameType { ## RTCEncodedVideoFrameMetadata dictionary ## {#RTCEncodedVideoFrameMetadata}
 dictionary RTCEncodedVideoFrameMetadata {
-    required unsigned long long frameId;
-    required sequence<unsigned long long> dependencies;
+    unsigned long long frameId;
+    sequence<unsigned long long> dependencies;
     unsigned short width;
     unsigned short height;
     unsigned long spatialIndex;
@@ -340,7 +340,7 @@ dictionary RTCEncodedVideoFrameMetadata {
     octet payloadType;
     sequence<unsigned long> contributingSources;
     long long timestamp;    // microseconds
-    required unsigned long rtpTimestamp;
+    unsigned long rtpTimestamp;
 };
 
@@ -406,7 +406,7 @@ interface RTCEncodedVideoFrame { readonly attribute RTCEncodedVideoFrameType type; attribute ArrayBuffer data; RTCEncodedVideoFrameMetadata getMetadata(); - undefined setMetadata(required RTCEncodedVideoFrameMetadata metadata); + undefined setMetadata(optional RTCEncodedVideoFrameMetadata metadata = {}); }; @@ -483,7 +483,7 @@ dictionary RTCEncodedAudioFrameMetadata { octet payloadType; sequence<unsigned long> contributingSources; short sequenceNumber; - required unsigned long rtpTimestamp; + unsigned long rtpTimestamp; }; ### Members ### {#RTCEncodedAudioFrameMetadata-members} @@ -544,7 +544,7 @@ dictionary RTCEncodedAudioFrameMetadata { interface RTCEncodedAudioFrame { attribute ArrayBuffer data; RTCEncodedAudioFrameMetadata getMetadata(); - undefined setMetadata(required RTCEncodedAudioFrameMetadata metadata); + undefined setMetadata(optional RTCEncodedAudioFrameMetadata metadata = {}); };