Skip to content

Commit 9739ea1

Browse files
committed
Changes to address the comments
1 parent dccb6f6 commit 9739ea1

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

index.bs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,15 @@ dictionary RTCEncodedVideoFrameMetadata {
422422

423423
## <dfn interface>RTCEncodedVideoFrame</dfn> interface ## {#RTCEncodedVideoFrame-interface}
424424
<pre class="idl">
425+
dictionary RTCEncodedVideoFrameMetadataOptions {
426+
RTCEncodedVideoFrameMetadata metadata;
427+
};
428+
425429
// New interfaces to define encoded video and audio frames. Will eventually
426430
// re-use or extend the equivalent defined in WebCodecs.
427431
[Exposed=(Window,DedicatedWorker), Serializable]
428432
interface RTCEncodedVideoFrame {
429-
constructor(RTCEncodedVideoFrame originalFrame, optional RTCEncodedVideoFrameMetadata newMetadata);
433+
constructor(RTCEncodedVideoFrame originalFrame, optional RTCEncodedVideoFrameMetadataOptions options = {});
430434
readonly attribute RTCEncodedVideoFrameType type;
431435
attribute ArrayBuffer data;
432436
RTCEncodedVideoFrameMetadata getMetadata();
@@ -440,15 +444,15 @@ interface RTCEncodedVideoFrame {
440444
</dt>
441445
<dd>
442446
<p>
443-
Creates a new {{RTCEncodedVideoFrame}} from the given |originalFrame| and sets the internal metadata to |newMetadata|.
447+
Creates a new {{RTCEncodedVideoFrame}} from the given |originalFrame| and sets the internal `[[metadata]]` slot to |options|`[metadata]`.
444448

445449
When called, run the following steps:
446450

447451
1. Set this.`[[type]]` to |originalFrame|.`[[type]]`.
448452
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]]`.
449-
1. Let `[[metadata]]` represent the metadata associated with this newly constructed frame.
453+
1. Let `[[metadata]]` be the internal slot that stores the metadata associated with this newly constructed frame.
450454
1. For each {`[[key]]`,`[[value]]`} pair of |originalFrame|.`[[getMetadata()]]`, set `[[metadata]]`.`[[key]]` to `[[value]]`.
451-
1. For each {`[[key]]`,`[[value]]`} pair of |newMetadata|, if the `[[value]]` exists, set `[[metadata]]`.`[[key]]` to `[[value]]`.
455+
1. For each {`[[key]]`,`[[value]]`} pair of |options|`[metadata]`, if the `[[value]]` exists, set `[[metadata]]`.`[[key]]` to `[[value]]`.
452456

453457
</p>
454458
</dd>
@@ -646,9 +650,13 @@ dictionary RTCEncodedAudioFrameMetadata {
646650

647651
## <dfn interface>RTCEncodedAudioFrame</dfn> interface ## {#RTCEncodedAudioFrame-interface}
648652
<pre class="idl">
653+
dictionary RTCEncodedAudioFrameMetadataOptions {
654+
RTCEncodedAudioFrameMetadata metadata;
655+
};
656+
649657
[Exposed=(Window,DedicatedWorker), Serializable]
650658
interface RTCEncodedAudioFrame {
651-
constructor(RTCEncodedAudioFrame originalFrame, optional RTCEncodedAudioFrameMetadata newMetadata);
659+
constructor(RTCEncodedAudioFrame originalFrame, optional RTCEncodedAudioFrameMetadataOptions options = {});
652660
attribute ArrayBuffer data;
653661
RTCEncodedAudioFrameMetadata getMetadata();
654662
};
@@ -661,14 +669,14 @@ interface RTCEncodedAudioFrame {
661669
</dt>
662670
<dd>
663671
<p>
664-
Creates a new {{RTCEncodedAudioFrame}} from the given |originalFrame| and sets the internal metadata to |newMetadata|.
672+
Creates a new {{RTCEncodedAudioFrame}} from the given |originalFrame| and sets the internal `[[metadata]]` slot to |options|`[metadata]`.
665673

666674
When called, run the following steps:
667675

668676
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]]`.
669-
1. Let `[[metadata]]` represent the metadata associated with this newly constructed frame.
677+
1. Let `[[metadata]]` be the internal slot that stores the metadata associated with this newly constructed frame.
670678
1. For each {`[[key]]`,`[[value]]`} pair of |originalFrame|.`[[getMetadata()]]`, set `[[metadata]]`.`[[key]]` to `[[value]]`.
671-
1. For each {`[[key]]`,`[[value]]`} pair of |newMetadata|, if the `[[value]]` exists, set `[[metadata]]`.`[[key]]` to `[[value]]`.
679+
1. For each {`[[key]]`,`[[value]]`} pair of |options|`[metadata]`, if the `[[value]]` exists, set `[[metadata]]`.`[[key]]` to `[[value]]`.
672680

673681
</p>
674682
</dd>

0 commit comments

Comments
 (0)