You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Promise<unsigned long long> generateKeyFrame(optional DOMString rid);
596
-
Promise<undefined> sendKeyFrameRequest();
597
594
};
598
595
599
596
interface mixin RTCRtpScriptSink {
600
-
readonly attribute WritableStream writable;
601
-
attribute EventHandler onkeyframerequest;
602
597
};
603
598
604
599
[Exposed=DedicatedWorker]
605
600
interface RTCRtpScriptTransformer {
601
+
// Attributes and methods related to the transformer source
602
+
readonly attribute ReadableStream readable;
603
+
Promise<unsigned long long> generateKeyFrame(optional DOMString rid);
604
+
Promise<undefined> sendKeyFrameRequest();
605
+
// Attributes and methods related to the transformer sink
606
+
readonly attribute WritableStream writable;
607
+
attribute EventHandler onkeyframerequest;
608
+
// Attributes for configuring the Javascript code
606
609
readonly attribute any options;
607
610
};
608
611
609
-
RTCRtpScriptTransformer includes RTCRtpScriptSource;
610
-
RTCRtpScriptTransformer includes RTCRtpScriptSink;
611
-
612
612
[Exposed=Window]
613
613
interface RTCRtpScriptTransform {
614
614
constructor(Worker worker, optional any options, optional sequence<object> transfer);
@@ -652,12 +652,12 @@ Each RTCRtpScriptTransform has the following set of [$association steps$], given
652
652
1. Set |transformer|.`[[encoder]]` to |encoder|.
653
653
1. Set |transformer|.`[[depacketizer]]` to |depacketizer|.
654
654
655
-
The <dfn method for="RTCRtpScriptSource">generateKeyFrame(|rid|)</dfn> method steps are:
655
+
The <dfn method for="RTCRtpScriptTransform">generateKeyFrame(|rid|)</dfn> method steps are:
656
656
1. Let |promise| be a new promise.
657
657
1. Run the [$generate key frame algorithm$] with |promise|, |this|.`[[encoder]]` and |rid|.
658
658
1. Return |promise|.
659
659
660
-
The <dfn method for="RTCRtpScriptSource">sendKeyFrameRequest()</dfn> method steps are:
660
+
The <dfn method for="RTCRtpScriptTransform">sendKeyFrameRequest()</dfn> method steps are:
661
661
1. Let |promise| be a new promise.
662
662
1. Run the [$send request key frame algorithm$] with |promise| and |this|.`[[depacketizer]]`.
663
663
1. Return |promise|.
@@ -671,21 +671,34 @@ This allows algorithms to go from an {{RTCRtpScriptTransformer}} object to its {
671
671
The <dfn attribute for="RTCRtpScriptTransformer">options</dfn> getter steps are:
672
672
1. Return [=this=].`[[options]]`.
673
673
674
-
The <dfn attribute for="RTCRtpScriptSource">readable</dfn> getter steps are:
674
+
The <dfn attribute for="RTCRtpScriptTransform">readable</dfn> getter steps are:
675
675
1. Return [=this=].`[[readable]]`.
676
676
677
-
The <dfn attribute for="RTCRtpScriptSink">writable</dfn> getter steps are:
677
+
The <dfn attribute for="RTCRtpScriptTransform">writable</dfn> getter steps are:
678
678
1. Return [=this=].`[[writable]]`.
679
679
680
-
The <dfn attribute for="RTCRtpScriptSink">onbandwidthestimate</dfn> EventHandler has type bandwidthestimate.
680
+
The <dfn attribute for="RTCRtpScriptTransform">onbandwidthestimate</dfn> EventHandler has type bandwidthestimate.
681
681
682
-
The <dfn attribute for="RTCRtpScriptSink">onkeyframerequest</dfn> EventHandler has type keyframerequest.
682
+
The <dfn attribute for="RTCRtpScriptTransform">onkeyframerequest</dfn> EventHandler has type keyframerequest.
683
683
684
684
## Events ## {#RTCRtpScriptTransformer-events}
685
685
686
686
The following events fire on an {{RTCRtpScriptTransformer}}:
687
687
688
-
* keyframerequest of type {{KeyFrameRequestEvent}} - fired when the sink determines that a key frame has been requested. In the context of {{RTCRtpScriptTransform}}, if the event is not cancelled, the information will be passed to the source as if the generateKeyFrame() function had been called. <!-- NOTE IN DRAFT: generateKeyFrame() and requestKeyFrame() should merge -->
688
+
* keyframerequest of type {{KeyFrameRequestEvent}} - fired when the sink determines that a key frame has been requested.
689
+
690
+
The steps that generate an event of type {{KeyFrameRequestEvent}} are as follows:
691
+
692
+
Given a {{RTCRtpScriptTransformer}} `transform`:
693
+
694
+
When `transform`'s `[[encoder]]` receives a keyframe request, for instance from an incoming RTCP Picture Loss Indication (PLI)
695
+
or Full Intra Refresh (FIR), queue
696
+
a task to perform the following steps:
697
+
698
+
1. Set `rid` to the RID of the appropriate layer, or undefined if the request is not for a specific layer.
699
+
1. Fire a cancelable event of type {{KeyFrameRequestEvent}} on `transform`, with {{KeyFrameRequestEvent/rid}} set to `rid`.
700
+
1. If the event is cancelled, abort these steps.
701
+
1. Run the [$generate key frame algorithm$] with a new promise, `transform`.`[[encoder]]` and `rid`.
0 commit comments