From 9739ea1f8670264c2493aa5f2274eae46269c43a Mon Sep 17 00:00:00 2001 From: Palak Agarwal Date: Tue, 2 Apr 2024 16:01:56 +0200 Subject: [PATCH] Changes to address the comments --- index.bs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/index.bs b/index.bs index ad1f80a..a97ba15 100644 --- a/index.bs +++ b/index.bs @@ -422,11 +422,15 @@ dictionary RTCEncodedVideoFrameMetadata { ## RTCEncodedVideoFrame interface ## {#RTCEncodedVideoFrame-interface}
+dictionary RTCEncodedVideoFrameMetadataOptions {
+    RTCEncodedVideoFrameMetadata metadata;
+};
+
 // New interfaces to define encoded video and audio frames. Will eventually
 // re-use or extend the equivalent defined in WebCodecs.
 [Exposed=(Window,DedicatedWorker), Serializable]
 interface RTCEncodedVideoFrame {
-    constructor(RTCEncodedVideoFrame originalFrame, optional RTCEncodedVideoFrameMetadata newMetadata);
+    constructor(RTCEncodedVideoFrame originalFrame, optional RTCEncodedVideoFrameMetadataOptions options = {});
     readonly attribute RTCEncodedVideoFrameType type;
     attribute ArrayBuffer data;
     RTCEncodedVideoFrameMetadata getMetadata();
@@ -440,15 +444,15 @@ interface RTCEncodedVideoFrame {
     
     

- Creates a new {{RTCEncodedVideoFrame}} from the given |originalFrame| and sets the internal metadata to |newMetadata|. + Creates a new {{RTCEncodedVideoFrame}} from the given |originalFrame| and sets the internal `[[metadata]]` slot to |options|`[metadata]`. When called, run the following steps: 1. Set this.`[[type]]` to |originalFrame|.`[[type]]`. 1. Let this.`[[data]]` be a new ArrayBuffer object whose `[[ArrayBufferData]]` internal slot value is |originalFrame|.`[[data]]`.`[[ArrayBufferData]]`, and whose `[[ArrayBufferByteLength]]` internal slot value is |originalFrame|.`[[data]]`.`[[ArrayBufferByteLength]]`. - 1. Let `[[metadata]]` represent the metadata associated with this newly constructed frame. + 1. Let `[[metadata]]` be the internal slot that stores the metadata associated with this newly constructed frame. 1. For each {`[[key]]`,`[[value]]`} pair of |originalFrame|.`[[getMetadata()]]`, set `[[metadata]]`.`[[key]]` to `[[value]]`. - 1. For each {`[[key]]`,`[[value]]`} pair of |newMetadata|, if the `[[value]]` exists, set `[[metadata]]`.`[[key]]` to `[[value]]`. + 1. For each {`[[key]]`,`[[value]]`} pair of |options|`[metadata]`, if the `[[value]]` exists, set `[[metadata]]`.`[[key]]` to `[[value]]`.

@@ -646,9 +650,13 @@ dictionary RTCEncodedAudioFrameMetadata { ## RTCEncodedAudioFrame interface ## {#RTCEncodedAudioFrame-interface}
+dictionary RTCEncodedAudioFrameMetadataOptions {
+    RTCEncodedAudioFrameMetadata metadata;
+};
+
 [Exposed=(Window,DedicatedWorker), Serializable]
 interface RTCEncodedAudioFrame {
-    constructor(RTCEncodedAudioFrame originalFrame, optional RTCEncodedAudioFrameMetadata newMetadata);
+    constructor(RTCEncodedAudioFrame originalFrame, optional RTCEncodedAudioFrameMetadataOptions options = {});
     attribute ArrayBuffer data;
     RTCEncodedAudioFrameMetadata getMetadata();
 };
@@ -661,14 +669,14 @@ interface RTCEncodedAudioFrame {
     
     

- Creates a new {{RTCEncodedAudioFrame}} from the given |originalFrame| and sets the internal metadata to |newMetadata|. + Creates a new {{RTCEncodedAudioFrame}} from the given |originalFrame| and sets the internal `[[metadata]]` slot to |options|`[metadata]`. When called, run the following steps: 1. Let this.`[[data]]` be a new ArrayBuffer object whose `[[ArrayBufferData]]` internal slot value is |originalFrame|.`[[data]]`.`[[ArrayBufferData]]`, and whose `[[ArrayBufferByteLength]]` internal slot value is |originalFrame|.`[[data]]`.`[[ArrayBufferByteLength]]`. - 1. Let `[[metadata]]` represent the metadata associated with this newly constructed frame. + 1. Let `[[metadata]]` be the internal slot that stores the metadata associated with this newly constructed frame. 1. For each {`[[key]]`,`[[value]]`} pair of |originalFrame|.`[[getMetadata()]]`, set `[[metadata]]`.`[[key]]` to `[[value]]`. - 1. For each {`[[key]]`,`[[value]]`} pair of |newMetadata|, if the `[[value]]` exists, set `[[metadata]]`.`[[key]]` to `[[value]]`. + 1. For each {`[[key]]`,`[[value]]`} pair of |options|`[metadata]`, if the `[[value]]` exists, set `[[metadata]]`.`[[key]]` to `[[value]]`.