Skip to content

Commit

Permalink
Changes to address the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
palak8669 committed Apr 2, 2024
1 parent dccb6f6 commit 9739ea1
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,15 @@ dictionary RTCEncodedVideoFrameMetadata {

## <dfn interface>RTCEncodedVideoFrame</dfn> interface ## {#RTCEncodedVideoFrame-interface}
<pre class="idl">
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();
Expand All @@ -440,15 +444,15 @@ interface RTCEncodedVideoFrame {
</dt>
<dd>
<p>
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]]`.

</p>
</dd>
Expand Down Expand Up @@ -646,9 +650,13 @@ dictionary RTCEncodedAudioFrameMetadata {

## <dfn interface>RTCEncodedAudioFrame</dfn> interface ## {#RTCEncodedAudioFrame-interface}
<pre class="idl">
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();
};
Expand All @@ -661,14 +669,14 @@ interface RTCEncodedAudioFrame {
</dt>
<dd>
<p>
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]]`.

</p>
</dd>
Expand Down

0 comments on commit 9739ea1

Please sign in to comment.