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
On the sender side, as part of [$readEncodedData$], frames produced by the [=encoder=] MUST be [=ReadableStream/enqueued=] into |transformer|.{{[[readable]]}} in the [=encoder=]'s output order.
@@ -183,35 +174,28 @@ On the receiver side, as part of [$readEncodedData$], frames produced by the [=d
183
174
To ensure the order is respected, the [=depacketizer=] will typically use RTP packet sequence numbers to reorder RTP packets as needed before [=ReadableStream/enqueuing=] frames into |transformer|.{{[[readable]]}}.
184
175
As [$writeEncodedData$] ensures that the transform cannot reorder frames, this will be the order expected by the [=decoder=].
185
176
186
-
## Extension attribute ## {#attribute}
177
+
### RTCRtpTransform common processing ### {#transform-processing}
187
178
188
179
An RTCRtpTransform has a private slot:
189
180
* `[[owner]]` of type {{RTCRtpSender}} or {{RTCRtpReceiver}}, initialized to null.
190
181
191
-
Each RTCRtpTransform has an <dfn abstract-op for=RTCRtpTransform>association steps</dfn> set, which is empty by default.
182
+
Each RTCRtpTransform has an <dfn abstract-op for=RTCRtpTransform>association algorithm</dfn>
183
+
and a <dfn abstract-op for=RTCRtpTransform>disassociation algorithm</dfn>, both empty by default.
192
184
193
-
The <dfn attribute for="RTCRtpSender,RTCRtpReceiver">transform</dfn> getter steps are:
194
-
1. Return [=this=].`[[transform]]`.
185
+
## Extension attribute ## {#attribute}
195
186
196
-
The `transform` setter steps are:
187
+
The <dfn attribute for="RTCRtpSender,RTCRtpReceiver">transform</dfn> getter steps are to
188
+
return [=this=].`[[transform]]`. The setter steps are:
197
189
1. Let |transform| be the argument to the setter.
198
190
1. If |transform| is not null and |transform|.`[[owner]]` is not null, throw a {{InvalidStateError}} and abort these steps.
199
191
1. Set |transform|.`[[owner]]` to [=this=].
200
-
1. Initialize |newPipeToController| to a new {{AbortController}}.
201
-
1. If [=this=].`[[pipeToController]]` is not null, run the following steps:
202
-
1. [=AbortSignal/Add=] the [$apply transform$] to [=this=].`[[pipeToController]]`'s [=AbortController/signal=].
203
-
2. [=AbortController/signal abort=] on [=this=].`[[pipeToController]]`.
204
-
1. Else, run the [$apply transform$] steps.
205
-
1. Set [=this=].`[[pipeToController]]` to |newPipeToController|.
192
+
1. Let |oldTransform| be [=this=].`[[transform]]`.
193
+
1. If |oldTransform| is not null, run |oldTransform|'s [$disassociation algorithm$].
206
194
1. Set [=this=].`[[transform]]` to |transform|.
207
-
1. Run the steps in the set of [$association steps$] of |transform| with [=this=].
208
-
209
-
The <dfn abstract-op>apply transform</dfn> steps are defined as:
210
-
1. If |newPipeToController|'s [=AbortController/signal=] is [=AbortSignal/aborted=], abort these steps.
211
-
1. [=Assert=] that |newPipeToController| is the same object as |rtcObject|.`[[pipeToController]]`.
212
-
<!-- FIXME: Fix aborting. -->
213
-
<p class="note">TODO: Specify details of how
214
-
[=this=].`[[pipeToController]]` replaces the transform in the media pipeline.</p>
195
+
1. If |transform| is not null, run |transform|'s [$association algorithm$] with [=this=].
196
+
1. If |transform| is null, run the following steps:
197
+
1. Let |frameSource| be [=this=].`[[frameSource]]`.
198
+
1. [=In parallel=], set |frameSource|.[=[[transformFrameAlgorithm]]=] to the [=passthrough algorithm=].
215
199
216
200
This algorithm is defined so that transforms can be updated dynamically.
217
201
There is no guarantee on which frame will happen the switch from the previous transform to the new transform.
1. Initialize [=this=]'s internal slot as follows:
930
+
: {{RTCRtpScriptTransform/[[worker]]}}
931
+
:: |worker|
926
932
1. Let |serializedOptions| be the result of [$StructuredSerializeWithTransfer$](|options|, |transfer|).
927
-
1. [=Queue a task=] on the DOM manipulation [=task source=] |worker|'s global scope to run the following steps:
933
+
1. [=Queue a global task=] on the DOM manipulation [=task source=] with |worker|'s
934
+
{{WorkerGlobalScope}} to run the following steps:
928
935
1. Let |transformerOptions| be the result of [$StructuredDeserializeWithTransfer$](|serializedOptions|, the current Realm).
929
936
1. Let |transformer| be the result of [=RTCRtpScriptTransformer/creating=] a
930
937
{{RTCRtpScriptTransformer}} with |transformerOptions|.
931
-
1. [=Fire an event=] named <dfn event for="DedicatedWorkerGlobalScope">rtctransform</dfn> using {{RTCTransformEvent}} with {{RTCTransformEvent/transformer}} set to |transformer| on |worker|’s global scope.
938
+
1. [=Fire an event=] named <dfn event for="DedicatedWorkerGlobalScope">rtctransform</dfn> using {{RTCTransformEvent}} with {{RTCTransformEvent/transformer}} set to |transformer| on |transformer|’s [=relevant global object=].
932
939
933
940
// FIXME: Describe error handling (worker closing flag true at RTCRtpScriptTransform creation time. And worker being terminated while transform is processing data).
0 commit comments