diff --git a/index.bs b/index.bs index 80eaae5..d6ce59c 100644 --- a/index.bs +++ b/index.bs @@ -891,11 +891,14 @@ partial interface DedicatedWorkerGlobalScope { attribute EventHandler onrtctransform; }; +interface mixin KeyFrameRequest { + Promise<undefined> generateKeyFrame(optional DOMString rid); +}; + [Exposed=DedicatedWorker] interface RTCRtpScriptTransformer : EventTarget { // Attributes and methods related to the transformer source readonly attribute ReadableStream readable; - Promise<unsigned long long> generateKeyFrame(optional DOMString rid); Promise<undefined> sendKeyFrameRequest(); // Attributes and methods related to the transformer sink readonly attribute WritableStream writable; @@ -903,6 +906,7 @@ interface RTCRtpScriptTransformer : EventTarget { // Attributes for configuring the Javascript code readonly attribute any options; }; +RTCRtpScriptTransformer includes KeyFrameRequest; [Exposed=Window] interface RTCRtpScriptTransform { @@ -947,11 +951,6 @@ Each RTCRtpScriptTransform has the following set of [$association steps$], given 1. Set |transformer|.`[[encoder]]` to |encoder|. 1. Set |transformer|.`[[depacketizer]]` to |depacketizer|. -The generateKeyFrame(|rid|) method steps are: -1. Let |promise| be a new promise. -1. Run the [$generate key frame algorithm$] with |promise|, |this|.`[[encoder]]` and |rid|. -1. Return |promise|. - The sendKeyFrameRequest() method steps are: 1. Let |promise| be a new promise. 1. Run the [$send request key frame algorithm$] with |promise| and |this|.`[[depacketizer]]`. @@ -994,6 +993,13 @@ or Full Intra Refresh (FIR), queue a task to perform the following steps: 1. If the event's [=Event/canceled flag=] is true, abort these steps. 1. Run the [$generate key frame algorithm$] with a new promise, |transform|.`[[encoder]]` and |rid|. +## KeyFrameRequest Operations ## {#KeyFrameRequest-operations} + +The generateKeyFrame(|rid|) method steps are: +1. Let |promise| be a new promise. +1. Run the [$generate key frame algorithm$] with |promise|, |this|.`[[encoder]]` and |rid|. +1. Return |promise|. + ## KeyFrame Algorithms ## {#KeyFrame-algorithms} The generate key frame algorithm, given |promise|, |encoder| and |rid|, is defined by running these steps: @@ -1044,19 +1050,9 @@ The send request key frame algorithm, given |promise| and An additional API on {{RTCRtpSender}} is added to complement the generation of key frame added to {{RTCRtpScriptTransformer}}.
-partial interface RTCRtpSender {
-    Promise<undefined> generateKeyFrame(optional sequence <DOMString> rids);
-};
+RTCRtpSender includes KeyFrameRequest;
 
-## Extension operation ## {#sender-operation} - -The generateKeyFrame(|rids|) method steps are: - -1. Let |promise| be a new promise. -1. [=In parallel=], run the [$generate key frame algorithm$] with |promise|, |this|'s encoder and |rids|. -1. Return |promise|. - # Privacy and security considerations # {#privacy} This API gives Javascript access to the content of media streams. This