Skip to content

Commit

Permalink
Add constructor for encoded frames
Browse files Browse the repository at this point in the history
  • Loading branch information
palak8669 committed Jan 16, 2024
1 parent 6701f98 commit 03df57b
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,32 @@ dictionary RTCEncodedVideoFrameMetadata {
// re-use or extend the equivalent defined in WebCodecs.
[Exposed=(Window,DedicatedWorker), Serializable]
interface RTCEncodedVideoFrame {
constructor(RTCEncodedVideoFrame originalFrame, RTCEncodedVideoFrameMetadata newMetadata);
readonly attribute RTCEncodedVideoFrameType type;
attribute ArrayBuffer data;
RTCEncodedVideoFrameMetadata getMetadata();
};
</pre>

### Constructor ### {#RTCEncodedVideoFrame-members}
<dl dfn-for="RTCEncodedVideoFrame" class="dictionary-members">
<dt>
<dfn for="RTCEncodedVideoFrame" method>constructor()</dfn>
</dt>
<dd>
<p>
Create a new RTCEncodedVideoFrame from the given |originalFrame| and sets its metadata to |newMetadata|.

When called, run the following steps:

1. Set this.`[[type]]` to |originalFrame|.`[[type]]`.
1. Set this.`[[data]]` to |originalFrame|.`[[data]]`.
1. Set the internal representation of metadata to |newMetadata| such that this.`[[getMetadata()]]` returns |newMetadata|.

</p>
</dd>
</dl>

### Members ### {#RTCEncodedVideoFrame-members}
<dl dfn-for="RTCEncodedVideoFrame" class="dictionary-members">
<dt>
Expand Down Expand Up @@ -626,11 +646,30 @@ dictionary RTCEncodedAudioFrameMetadata {
<pre class="idl">
[Exposed=(Window,DedicatedWorker), Serializable]
interface RTCEncodedAudioFrame {
constructor(RTCEncodedAudioFrame originalFrame, RTCEncodedAudioFrameMetadata newMetadata);
attribute ArrayBuffer data;
RTCEncodedAudioFrameMetadata getMetadata();
};
</pre>

### Constructor ### {#RTCEncodedAudioFrame-members}
<dl dfn-for="RTCEncodedAudioFrame" class="dictionary-members">
<dt>
<dfn for="RTCEncodedAudioFrame" method>constructor()</dfn>
</dt>
<dd>
<p>
Create a new RTCEncodedAudioFrame from the given |originalFrame| and sets its metadata to |newMetadata|.

When called, run the following steps:

1. Set this.`[[data]]` to |originalFrame|.`[[data]]`.
1. Set the internal representation of metadata to |newMetadata| such that this.`[[getMetadata()]]` returns |newMetadata|.

</p>
</dd>
</dl>

### Members ### {#RTCEncodedAudioFrame-members}
<dl dfn-for="RTCEncodedAudioFrame" class="dictionary-members">
<dt>
Expand Down

0 comments on commit 03df57b

Please sign in to comment.