Skip to content

Commit 03df57b

Browse files
committed
Add constructor for encoded frames
1 parent 6701f98 commit 03df57b

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

index.bs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,32 @@ dictionary RTCEncodedVideoFrameMetadata {
426426
// re-use or extend the equivalent defined in WebCodecs.
427427
[Exposed=(Window,DedicatedWorker), Serializable]
428428
interface RTCEncodedVideoFrame {
429+
constructor(RTCEncodedVideoFrame originalFrame, RTCEncodedVideoFrameMetadata newMetadata);
429430
readonly attribute RTCEncodedVideoFrameType type;
430431
attribute ArrayBuffer data;
431432
RTCEncodedVideoFrameMetadata getMetadata();
432433
};
433434
</pre>
434435

436+
### Constructor ### {#RTCEncodedVideoFrame-members}
437+
<dl dfn-for="RTCEncodedVideoFrame" class="dictionary-members">
438+
<dt>
439+
<dfn for="RTCEncodedVideoFrame" method>constructor()</dfn>
440+
</dt>
441+
<dd>
442+
<p>
443+
Create a new RTCEncodedVideoFrame from the given |originalFrame| and sets its metadata to |newMetadata|.
444+
445+
When called, run the following steps:
446+
447+
1. Set this.`[[type]]` to |originalFrame|.`[[type]]`.
448+
1. Set this.`[[data]]` to |originalFrame|.`[[data]]`.
449+
1. Set the internal representation of metadata to |newMetadata| such that this.`[[getMetadata()]]` returns |newMetadata|.
450+
451+
</p>
452+
</dd>
453+
</dl>
454+
435455
### Members ### {#RTCEncodedVideoFrame-members}
436456
<dl dfn-for="RTCEncodedVideoFrame" class="dictionary-members">
437457
<dt>
@@ -626,11 +646,30 @@ dictionary RTCEncodedAudioFrameMetadata {
626646
<pre class="idl">
627647
[Exposed=(Window,DedicatedWorker), Serializable]
628648
interface RTCEncodedAudioFrame {
649+
constructor(RTCEncodedAudioFrame originalFrame, RTCEncodedAudioFrameMetadata newMetadata);
629650
attribute ArrayBuffer data;
630651
RTCEncodedAudioFrameMetadata getMetadata();
631652
};
632653
</pre>
633654

655+
### Constructor ### {#RTCEncodedAudioFrame-members}
656+
<dl dfn-for="RTCEncodedAudioFrame" class="dictionary-members">
657+
<dt>
658+
<dfn for="RTCEncodedAudioFrame" method>constructor()</dfn>
659+
</dt>
660+
<dd>
661+
<p>
662+
Create a new RTCEncodedAudioFrame from the given |originalFrame| and sets its metadata to |newMetadata|.
663+
664+
When called, run the following steps:
665+
666+
1. Set this.`[[data]]` to |originalFrame|.`[[data]]`.
667+
1. Set the internal representation of metadata to |newMetadata| such that this.`[[getMetadata()]]` returns |newMetadata|.
668+
669+
</p>
670+
</dd>
671+
</dl>
672+
634673
### Members ### {#RTCEncodedAudioFrame-members}
635674
<dl dfn-for="RTCEncodedAudioFrame" class="dictionary-members">
636675
<dt>

0 commit comments

Comments
 (0)