Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alvestrand committed Dec 12, 2023
1 parent d5f6808 commit a87eeb2
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,8 @@ partial interface DedicatedWorkerGlobalScope {
attribute EventHandler onrtctransform;
};

interface mixin RTCRtpScriptSource {
};

interface mixin RTCRtpScriptSink {
};

[Exposed=DedicatedWorker]
interface RTCRtpScriptTransformer {
interface RTCRtpScriptTransformer : EventTarget {
// Attributes and methods related to the transformer source
readonly attribute ReadableStream readable;
Promise<unsigned long long> generateKeyFrame(optional DOMString rid);
Expand Down Expand Up @@ -683,22 +677,21 @@ The <dfn attribute for="RTCRtpScriptTransform">onkeyframerequest</dfn> EventHand

## Events ## {#RTCRtpScriptTransformer-events}

The following events fire on an {{RTCRtpScriptTransformer}}:
The following event fires on an {{RTCRtpScriptTransformer}}:

* keyframerequest of type {{KeyFrameRequestEvent}} - fired when the sink determines that a key frame has been requested.

The steps that generate an event of type {{KeyFrameRequestEvent}} are as follows:

Given a {{RTCRtpScriptTransformer}} `transform`:
Given a {{RTCRtpScriptTransformer}} |transform|:

When `transform`'s `[[encoder]]` receives a keyframe request, for instance from an incoming RTCP Picture Loss Indication (PLI)
or Full Intra Refresh (FIR), queue
a task to perform the following steps:
When |transform|'s `[[encoder]]` receives a keyframe request, for instance from an incoming RTCP Picture Loss Indication (PLI)
or Full Intra Refresh (FIR), queue a task to perform the following steps:

1. Set `rid` to the RID of the appropriate layer, or undefined if the request is not for a specific layer.
1. Fire a cancelable event of type {{KeyFrameRequestEvent}} on `transform`, with {{KeyFrameRequestEvent/rid}} set to `rid`.
1. If the event is cancelled, abort these steps.
1. Run the [$generate key frame algorithm$] with a new promise, `transform`.`[[encoder]]` and `rid`.
1. Set |rid| to the RID of the appropriate layer, or undefined if the request is not for a specific layer.
1. [=Fire an event=] named `keyframerequest` at |transform| using {{KeyFrameRequestEvent}} with its {{Event/cancelable}} attribute initialized to "true", and with {{KeyFrameRequestEvent/rid}} set to |rid|.
1. If the event's `canceled flag` is true, abort these steps.
1. Run the [$generate key frame algorithm$] with a new promise, |transform|.`[[encoder]]` and |rid|.

## KeyFrame Algorithms ## {#KeyFrame-algorithms}

Expand Down

0 comments on commit a87eeb2

Please sign in to comment.