Skip to content

Commit 8206d75

Browse files
committed
Add interface mixin KeyFrameRequest to simplify
1 parent cf0e77a commit 8206d75

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

index.bs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,10 @@ partial interface DedicatedWorkerGlobalScope {
885885
attribute EventHandler onrtctransform;
886886
};
887887

888+
interface mixin KeyFrameRequest {
889+
Promise<undefined> generateKeyFrame(optional sequence<DOMString> rids);
890+
};
891+
888892
[Exposed=DedicatedWorker]
889893
interface RTCRtpScriptTransformer : EventTarget {
890894
// Attributes and methods related to the transformer source
@@ -897,6 +901,7 @@ interface RTCRtpScriptTransformer : EventTarget {
897901
// Attributes for configuring the Javascript code
898902
readonly attribute any options;
899903
};
904+
RTCRtpScriptTransformer includes KeyFrameRequest;
900905

901906
[Exposed=Window]
902907
interface RTCRtpScriptTransform {
@@ -941,11 +946,6 @@ Each RTCRtpScriptTransform has the following set of [$association steps$], given
941946
1. Set |transformer|.`[[encoder]]` to |encoder|.
942947
1. Set |transformer|.`[[depacketizer]]` to |depacketizer|.
943948

944-
The <dfn method for="RTCRtpScriptTransform">generateKeyFrame(|rid|)</dfn> method steps are:
945-
1. Let |promise| be a new promise.
946-
1. Run the [$generate key frame algorithm$] with |promise|, |this|.`[[encoder]]` and |rid|.
947-
1. Return |promise|.
948-
949949
The <dfn method for="RTCRtpScriptTransform">sendKeyFrameRequest()</dfn> method steps are:
950950
1. Let |promise| be a new promise.
951951
1. Run the [$send request key frame algorithm$] with |promise| and |this|.`[[depacketizer]]`.
@@ -988,6 +988,13 @@ or Full Intra Refresh (FIR), queue a task to perform the following steps:
988988
1. If the event's [=Event/canceled flag=] is true, abort these steps.
989989
1. Run the [$generate key frame algorithm$] with a new promise, |transform|.`[[encoder]]` and |rid|.
990990

991+
## KeyFrameRequest Operations ## {#KeyFrameRequest-operations}
992+
993+
The <dfn method for="KeyFrameRequest">generateKeyFrame(|rid|)</dfn> method steps are:
994+
1. Let |promise| be a new promise.
995+
1. Run the [$generate key frame algorithm$] with |promise|, |this|.`[[encoder]]` and |rid|.
996+
1. Return |promise|.
997+
991998
## KeyFrame Algorithms ## {#KeyFrame-algorithms}
992999

9931000
The <dfn abstract-op>generate key frame algorithm</dfn>, given |promise|, |encoder| and |rid|, is defined by running these steps:
@@ -1038,19 +1045,9 @@ The <dfn abstract-op>send request key frame algorithm</dfn>, given |promise| and
10381045
An additional API on {{RTCRtpSender}} is added to complement the generation of key frame added to {{RTCRtpScriptTransformer}}.
10391046

10401047
<pre class="idl">
1041-
partial interface RTCRtpSender {
1042-
Promise&lt;undefined&gt; generateKeyFrame(optional sequence &lt;DOMString&gt; rids);
1043-
};
1048+
RTCRtpSender includes KeyFrameRequest;
10441049
</pre>
10451050

1046-
## Extension operation ## {#sender-operation}
1047-
1048-
The <dfn method for="RTCRtpSender">generateKeyFrame(|rids|)</dfn> method steps are:
1049-
1050-
1. Let |promise| be a new promise.
1051-
1. [=In parallel=], run the [$generate key frame algorithm$] with |promise|, |this|'s encoder and |rids|.
1052-
1. Return |promise|.
1053-
10541051
# Privacy and security considerations # {#privacy}
10551052

10561053
This API gives Javascript access to the content of media streams. This

0 commit comments

Comments
 (0)