Skip to content

Commit 915870d

Browse files
Merge pull request #176 from w3c/fix-bs-format
Fix bikeshed-isms
2 parents 442e4c2 + 1a53af2 commit 915870d

File tree

1 file changed

+50
-62
lines changed

1 file changed

+50
-62
lines changed

index.bs

Lines changed: 50 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ argument, ensure that the codec is disabled and produces no output.
8686
At construction of each {{RTCRtpSender}} or {{RTCRtpReceiver}}, run the following steps:
8787
2. Initialize [=this=].`[[transform]]` to null.
8888
3. Initialize [=this=].`[[readable]]` to a new {{ReadableStream}}.
89-
4. <a dfn for="ReadableStream">Set up</a> [=this=].`[[readable]]`. [=this=].`[[readable]]` is provided frames using the [=readEncodedData=] algorithm given |this| as parameter.
89+
4. <a dfn for="ReadableStream">Set up</a> [=this=].`[[readable]]`. [=this=].`[[readable]]` is provided frames using the [$readEncodedData$] algorithm given |this| as parameter.
9090
5. Set [=this=].`[[readable]]`.`[[owner]]` to |this|.
9191
6. Initialize [=this=].`[[writable]]` to a new {{WritableStream}}.
92-
7. <a dfn for="WritableStream">Set up</a> [=this=].`[[writable]]` with its [=WritableStream/set up/writeAlgorithm=] set to [=writeEncodedData=] given |this| as parameter and its [=WritableStream/set up/sizeAlgorithm=] to an algorithm that returns <code>0</code>.
92+
7. <a dfn for="WritableStream">Set up</a> [=this=].`[[writable]]` with its [=WritableStream/set up/writeAlgorithm=] set to [$writeEncodedData$] given |this| as parameter and its [=WritableStream/set up/sizeAlgorithm=] to an algorithm that returns <code>0</code>.
9393
<p class="note">Chunk size is set to 0 to explictly disable streams backpressure on the write side.</p>
9494
8. Set [=this=].`[[writable]]`.`[[owner]]` to |this|.
9595
9. Initialize [=this=].`[[pipeToController]]` to null.
@@ -103,15 +103,15 @@ At construction of each {{RTCRtpSender}} or {{RTCRtpReceiver}}, run the followin
103103

104104
### Stream processing ### {#stream-processing}
105105

106-
The <dfn>readEncodedData</dfn> algorithm is given a |rtcObject| as parameter. It is defined by running the following steps:
106+
The <dfn abstract-op>readEncodedData</dfn> algorithm is given a |rtcObject| as parameter. It is defined by running the following steps:
107107
1. Wait for a frame to be produced by |rtcObject|'s encoder if it is a {{RTCRtpSender}} or |rtcObject|'s packetizer if it is a {{RTCRtpReceiver}}.
108108
1. Increment |rtcObject|.`[[lastEnqueuedFrameCounter]]` by <code>1</code>.
109109
1. Let |frame| be the newly produced frame.
110110
1. Set |frame|.`[[owner]]` to |rtcObject|.
111111
1. Set |frame|.`[[counter]]` to |rtcObject|.`[[lastEnqueuedFrameCounter]]`.
112112
1. [=ReadableStream/Enqueue=] |frame| in |rtcObject|.`[[readable]]`.
113113

114-
The <dfn>writeEncodedData</dfn> algorithm is given a |rtcObject| as parameter and a |frame| as input. It is defined by running the following steps:
114+
The <dfn abstract-op>writeEncodedData</dfn> algorithm is given a |rtcObject| as parameter and a |frame| as input. It is defined by running the following steps:
115115
1. If |frame|.`[[owner]]` is not equal to |rtcObject|, abort these steps and return [=a promise resolved with=] undefined. A processor cannot create frames, or move frames between streams.
116116
1. If |frame|.`[[counter]]` is equal or smaller than |rtcObject|.`[[lastReceivedFrameCounter]]`, abort these steps and return [=a promise resolved with=] undefined. A processor cannot reorder frames, although it may delay them or drop them.
117117
1. Set |rtcObject|.`[[lastReceivedFrameCounter]]` to |frame|`[[counter]]`.
@@ -123,18 +123,18 @@ The <dfn>writeEncodedData</dfn> algorithm is given a |rtcObject| as parameter an
123123
* If |rtcObject| is a {{RTCRtpReceiver}}, enqueue |frameCopy| it to |rtcObject|'s decoder, to be processed [=in parallel=].
124124
1. Return [=a promise resolved with=] undefined.
125125

126-
On sender side, as part of [=readEncodedData=], frames produced by |rtcObject|'s encoder MUST be enqueued in |rtcObject|.`[[readable]]` in the encoder's output order.
127-
As [=writeEncodedData=] ensures that the transform cannot reorder frames, the encoder's output order is also the order followed by packetizers to generate RTP packets and assign RTP packet sequence numbers.
126+
On sender side, as part of [$readEncodedData$], frames produced by |rtcObject|'s encoder MUST be enqueued in |rtcObject|.`[[readable]]` in the encoder's output order.
127+
As [$writeEncodedData$] ensures that the transform cannot reorder frames, the encoder's output order is also the order followed by packetizers to generate RTP packets and assign RTP packet sequence numbers.
128128

129-
On receiver side, as part of [=readEncodedData=], frames produced by |rtcObject|'s packetizer MUST be enqueued in |rtcObject|.`[[readable]]` in the same encoder's output order.
129+
On receiver side, as part of [$readEncodedData$], frames produced by |rtcObject|'s packetizer MUST be enqueued in |rtcObject|.`[[readable]]` in the same encoder's output order.
130130
To ensure the order is respected, the depacketizer will typically use RTP packet sequence numbers to reorder RTP packets as needed before enqueuing frames in |rtcObject|.`[[readable]]`.
131-
As [=writeEncodedData=] ensures that the transform cannot reorder frames, this will be the order expected by |rtcObject|'s decoder.
131+
As [$writeEncodedData$] ensures that the transform cannot reorder frames, this will be the order expected by |rtcObject|'s decoder.
132132

133133
## Extension attribute ## {#attribute}
134134

135135
A RTCRtpTransform has two private slots called `[[readable]]` and `[[writable]]`.
136136

137-
Each RTCRtpTransform has an <dfn>association steps</dfn> set, which is empty by default.
137+
Each RTCRtpTransform has an <dfn abstract-op for=RTCRtpTransform>association steps</dfn> set, which is empty by default.
138138

139139
The <dfn attribute for="RTCRtpSender,RTCRtpReceiver">transform</dfn> getter steps are:
140140
1. Return [=this=].`[[transform]]`.
@@ -146,14 +146,14 @@ The `transform` setter steps are:
146146
4. Let |writer| be the result of [=WritableStream/getting a writer=] for |checkedTransform|.`[[writable]]`.
147147
5. Initialize |newPipeToController| to a new {{AbortController}}.
148148
6. If [=this=].`[[pipeToController]]` is not null, run the following steps:
149-
1. [=AbortSignal/Add=] the [=chain transform algorithm=] to [=this=].`[[pipeToController]]`.signal.
149+
1. [=AbortSignal/Add=] the [$chain transform algorithm$] to [=this=].`[[pipeToController]]`.signal.
150150
2. [=AbortSignal/signal abort=] [=this=].`[[pipeToController]]`.signal.
151-
7. Else, run the [=chain transform algorithm=] steps.
151+
7. Else, run the [$chain transform algorithm$] steps.
152152
8. Set [=this=].`[[pipeToController]]` to |newPipeToController|.
153153
9. Set [=this=].`[[transform]]` to |transform|.
154-
10. Run the steps in the set of [=association steps=] of |transform| with [=this=].
154+
10. Run the steps in the set of [$association steps$] of |transform| with [=this=].
155155

156-
The <dfn>chain transform algorithm</dfn> steps are defined as:
156+
The <dfn abstract-op>chain transform algorithm</dfn> steps are defined as:
157157
1. If |newPipeToController| is [=AbortSignal/aborted=], abort these steps.
158158
2. [=ReadableStreamDefaultReader/Release=] |reader|.
159159
3. [=WritableStreamDefaultWriter/Release=] |writer|.
@@ -267,7 +267,7 @@ The <dfn method for="SFrameTransform">setEncryptionKey(|key|, |keyID|)</dfn> met
267267

268268
# RTCRtpScriptTransform # {#scriptTransform}
269269

270-
## <dfn>RTCEncodedVideoFrameType</dfn> dictionary ## {#RTCEncodedVideoFrameType}
270+
## <dfn enum>RTCEncodedVideoFrameType</dfn> dictionary ## {#RTCEncodedVideoFrameType}
271271
<pre class="idl">
272272
// New enum for video frame types. Will eventually re-use the equivalent defined
273273
// by WebCodecs.
@@ -277,8 +277,7 @@ enum RTCEncodedVideoFrameType {
277277
"delta",
278278
};
279279
</pre>
280-
<table data-link-for="RTCEncodedVideoFrameType" data-dfn-for=
281-
"RTCEncodedVideoFrameType" class="simple">
280+
<table dfn-for="RTCEncodedVideoFrameType" class="simple">
282281
<caption>Enumeration description</caption>
283282
<thead>
284283
<tr>
@@ -288,7 +287,7 @@ enum RTCEncodedVideoFrameType {
288287
<tbody>
289288
<tr>
290289
<td>
291-
<dfn data-idl="">empty</dfn>
290+
<dfn enum-value>empty</dfn>
292291
</td>
293292
<td>
294293
<p>
@@ -298,7 +297,7 @@ enum RTCEncodedVideoFrameType {
298297
</tr>
299298
<tr>
300299
<td>
301-
<dfn data-idl="">key</dfn>
300+
<dfn enum-value>key</dfn>
302301
</td>
303302
<td>
304303
<p>
@@ -308,7 +307,7 @@ enum RTCEncodedVideoFrameType {
308307
</tr>
309308
<tr>
310309
<td>
311-
<dfn data-idl="">delta</dfn>
310+
<dfn enum-value>delta</dfn>
312311
</td>
313312
<td>
314313
<p>
@@ -319,7 +318,7 @@ enum RTCEncodedVideoFrameType {
319318
</tbody>
320319
</table>
321320

322-
## <dfn>RTCEncodedVideoFrameMetadata</dfn> dictionary ## {#RTCEncodedVideoFrameMetadata}
321+
## <dfn dictionary>RTCEncodedVideoFrameMetadata</dfn> dictionary ## {#RTCEncodedVideoFrameMetadata}
323322
<pre class="idl">
324323
dictionary RTCEncodedVideoFrameMetadata {
325324
unsigned long long frameId;
@@ -336,11 +335,10 @@ dictionary RTCEncodedVideoFrameMetadata {
336335
</pre>
337336

338337
### Members ### {#RTCEncodedVideoFrameMetadata-members}
339-
<dl data-link-for="RTCEncodedVideoFrameMetadata"
340-
data-dfn-for="RTCEncodedVideoFrameMetadata"
341-
class="dictionary-members">
338+
339+
<dl dfn-for="RTCEncodedVideoFrameMetadata" class="dictionary-members">
342340
<dt>
343-
<dfn>synchronizationSource</dfn> of type <span class="idlMemberType">unsigned long</span>
341+
<dfn dict-member>synchronizationSource</dfn> of type <span class="idlMemberType">unsigned long</span>
344342
</dt>
345343
<dd>
346344
<p>
@@ -349,7 +347,7 @@ dictionary RTCEncodedVideoFrameMetadata {
349347
</p>
350348
</dd>
351349
<dt>
352-
<dfn>payloadType</dfn> of type <span class="idlMemberType">octet</span>
350+
<dfn dict-member>payloadType</dfn> of type <span class="idlMemberType">octet</span>
353351
</dt>
354352
<dd>
355353
<p>
@@ -358,7 +356,7 @@ dictionary RTCEncodedVideoFrameMetadata {
358356
</p>
359357
</dd>
360358
<dt>
361-
<dfn>contributingSources</dfn> of type <span class=
359+
<dfn dict-member>contributingSources</dfn> of type <span class=
362360
"idlMemberType">sequence&lt;unsigned long&gt;</span>
363361
</dt>
364362
<dd>
@@ -379,7 +377,7 @@ dictionary RTCEncodedVideoFrameMetadata {
379377
</dl>
380378

381379

382-
## <dfn>RTCEncodedVideoFrame</dfn> interface ## {#RTCEncodedVideoFrame-interface}
380+
## <dfn interface>RTCEncodedVideoFrame</dfn> interface ## {#RTCEncodedVideoFrame-interface}
383381
<pre class="idl">
384382
// New interfaces to define encoded video and audio frames. Will eventually
385383
// re-use or extend the equivalent defined in WebCodecs.
@@ -393,11 +391,9 @@ interface RTCEncodedVideoFrame {
393391
</pre>
394392

395393
### Members ### {#RTCEncodedVideoFrame-members}
396-
<dl data-link-for="RTCEncodedVideoFrame"
397-
data-dfn-for="RTCEncodedVideoFrame"
398-
class="dictionary-members">
394+
<dl dfn-for="RTCEncodedVideoFrame" class="dictionary-members">
399395
<dt>
400-
<dfn>type</dfn> of type <span class="idlMemberType">RTCEncodedVideoFrameType</span>
396+
<dfn attribute>type</dfn> of type <span class="idlMemberType">RTCEncodedVideoFrameType</span>
401397
</dt>
402398
<dd>
403399
<p>
@@ -407,7 +403,7 @@ interface RTCEncodedVideoFrame {
407403
</dd>
408404

409405
<dt>
410-
<dfn>timestamp</dfn> of type <span class="idlMemberType">unsigned long</span>
406+
<dfn attribute>timestamp</dfn> of type <span class="idlMemberType">unsigned long</span>
411407
</dt>
412408
<dd>
413409
<p>
@@ -416,7 +412,7 @@ interface RTCEncodedVideoFrame {
416412
</p>
417413
</dd>
418414
<dt>
419-
<dfn>data</dfn> of type <span class="idlMemberType">ArrayBuffer</span>
415+
<dfn attribute>data</dfn> of type <span class="idlMemberType">ArrayBuffer</span>
420416
</dt>
421417
<dd>
422418
<p>
@@ -426,11 +422,9 @@ interface RTCEncodedVideoFrame {
426422
</dl>
427423

428424
### Methods ### {#RTCEncodedVideoFrame-methods}
429-
<dl data-link-for="RTCEncodedVideoFrame"
430-
data-dfn-for="RTCEncodedVideoFrame"
431-
class="dictionary-members">
425+
<dl dfn-for="RTCEncodedVideoFrame" class="dictionary-members">
432426
<dt>
433-
<dfn data-dfn-for="RTCEncodedVideoFrame" data-dfn-type="method">getMetadata()</dfn>
427+
<dfn for="RTCEncodedVideoFrame" method>getMetadata()</dfn>
434428
</dt>
435429
<dd>
436430
<p>
@@ -439,7 +433,7 @@ interface RTCEncodedVideoFrame {
439433
</dd>
440434
</dl>
441435

442-
## <dfn>RTCEncodedAudioFrameMetadata</dfn> dictionary ## {#RTCEncodedAudioFrameMetadata}
436+
## <dfn dictionary>RTCEncodedAudioFrameMetadata</dfn> dictionary ## {#RTCEncodedAudioFrameMetadata}
443437
<pre class="idl">
444438
dictionary RTCEncodedAudioFrameMetadata {
445439
unsigned long synchronizationSource;
@@ -449,11 +443,9 @@ dictionary RTCEncodedAudioFrameMetadata {
449443
};
450444
</pre>
451445
### Members ### {#RTCEncodedAudioFrameMetadata-members}
452-
<dl data-link-for="RTCEncodedAudioFrameMetadata"
453-
data-dfn-for="RTCEncodedAudioFrameMetadata"
454-
class="dictionary-members">
446+
<dl dfn-for="RTCEncodedAudioFrameMetadata" class="dictionary-members">
455447
<dt>
456-
<dfn>synchronizationSource</dfn> of type <span class="idlMemberType">unsigned long</span>
448+
<dfn dict-member>synchronizationSource</dfn> of type <span class="idlMemberType">unsigned long</span>
457449
</dt>
458450
<dd>
459451
<p>
@@ -462,7 +454,7 @@ dictionary RTCEncodedAudioFrameMetadata {
462454
</p>
463455
</dd>
464456
<dt>
465-
<dfn>payloadType</dfn> of type <span class="idlMemberType">octet</span>
457+
<dfn dict-member>payloadType</dfn> of type <span class="idlMemberType">octet</span>
466458
</dt>
467459
<dd>
468460
<p>
@@ -471,7 +463,7 @@ dictionary RTCEncodedAudioFrameMetadata {
471463
</p>
472464
</dd>
473465
<dt>
474-
<dfn>contributingSources</dfn> of type <span class=
466+
<dfn dict-member>contributingSources</dfn> of type <span class=
475467
"idlMemberType">sequence&lt;unsigned long&gt;</span>
476468
</dt>
477469
<dd>
@@ -480,7 +472,7 @@ dictionary RTCEncodedAudioFrameMetadata {
480472
</p>
481473
</dd>
482474
<dt>
483-
<dfn>sequenceNumber</dfn> of type <span class=
475+
<dfn dict-member>sequenceNumber</dfn> of type <span class=
484476
"idlMemberType">short</span>
485477
</dt>
486478
<dd>
@@ -493,7 +485,7 @@ dictionary RTCEncodedAudioFrameMetadata {
493485
</dd>
494486
</dl>
495487

496-
## <dfn>RTCEncodedAudioFrame</dfn> interface ## {#RTCEncodedAudioFrame-interface}
488+
## <dfn interface>RTCEncodedAudioFrame</dfn> interface ## {#RTCEncodedAudioFrame-interface}
497489
<pre class="idl">
498490
[Exposed=(Window,DedicatedWorker)]
499491
interface RTCEncodedAudioFrame {
@@ -504,11 +496,9 @@ interface RTCEncodedAudioFrame {
504496
</pre>
505497

506498
### Members ### {#RTCEncodedAudioFrame-members}
507-
<dl data-link-for="RTCEncodedAudioFrame"
508-
data-dfn-for="RTCEncodedAudioFrame"
509-
class="dictionary-members">
499+
<dl dfn-for="RTCEncodedAudioFrame" class="dictionary-members">
510500
<dt>
511-
<dfn>timestamp</dfn> of type <span class="idlMemberType">unsigned long</span>
501+
<dfn attribute>timestamp</dfn> of type <span class="idlMemberType">unsigned long</span>
512502
</dt>
513503
<dd>
514504
<p>
@@ -517,7 +507,7 @@ interface RTCEncodedAudioFrame {
517507
</p>
518508
</dd>
519509
<dt>
520-
<dfn>data</dfn> of type <span class="idlMemberType">ArrayBuffer</span>
510+
<dfn attribute>data</dfn> of type <span class="idlMemberType">ArrayBuffer</span>
521511
</dt>
522512
<dd>
523513
<p>
@@ -527,11 +517,9 @@ interface RTCEncodedAudioFrame {
527517
</dl>
528518

529519
### Methods ### {#RTCEncodedAudioFrame-methods}
530-
<dl data-link-for="RTCEncodedAudioFrame"
531-
data-dfn-for="RTCEncodedAudioFrame"
532-
class="dictionary-members">
520+
<dl dfn-for="RTCEncodedAudioFrame" class="dictionary-members">
533521
<dt>
534-
<dfn data-dfn-for="RTCEncodedAudioFrame" data-dfn-type="method">getMetadata()</dfn>
522+
<dfn for="RTCEncodedAudioFrame" method>getMetadata()</dfn>
535523
</dt>
536524
<dd>
537525
<p>
@@ -590,8 +578,8 @@ The <dfn constructor for="RTCRtpScriptTransform" lt="RTCRtpScriptTransform(worke
590578

591579
// FIXME: Describe error handling (worker closing flag true at RTCRtpScriptTransform creation time. And worker being terminated while transform is processing data).
592580

593-
Each RTCRtpScriptTransform has the following set of [=association steps=], given |rtcObject|:
594-
1. Let |transform| be the {{RTCRtpScriptTransform}} object that owns the [=association steps=].
581+
Each RTCRtpScriptTransform has the following set of [$association steps$], given |rtcObject|:
582+
1. Let |transform| be the {{RTCRtpScriptTransform}} object that owns the [$association steps$].
595583
1. Let |encoder| be |rtcObject|'s encoder if |rtcObject| is a {{RTCRtpSender}} or undefined otherwise.
596584
1. Let |depacketizer| be |rtcObject|'s depacketizer if |rtcObject| is a {{RTCRtpReceiver}} or undefined otherwise.
597585
1. [=Queue a task=] on the DOM manipulation [=task source=] |worker|'s global scope to run the following steps:
@@ -601,12 +589,12 @@ Each RTCRtpScriptTransform has the following set of [=association steps=], given
601589

602590
The <dfn method for="RTCRtpScriptTransformer">generateKeyFrame(|rid|)</dfn> method steps are:
603591
1. Let |promise| be a new promise.
604-
1. Run the [=generate key frame algorithm=] with |promise|, |this|.`[[encoder]]` and |rid|.
592+
1. Run the [$generate key frame algorithm$] with |promise|, |this|.`[[encoder]]` and |rid|.
605593
1. Return |promise|.
606594

607595
The <dfn method for="RTCRtpScriptTransformer">sendKeyFrameRequest()</dfn> method steps are:
608596
1. Let |promise| be a new promise.
609-
1. Run the [=send request key frame algorithm=] with |promise| and |this|.`[[depacketizer]]`.
597+
1. Run the [$send request key frame algorithm$] with |promise| and |this|.`[[depacketizer]]`.
610598
1. Return |promise|.
611599

612600
## Attributes ## {#RTCRtpScriptTransformer-attributes}
@@ -626,7 +614,7 @@ The <dfn attribute for="RTCRtpScriptTransformer">writable</dfn> getter steps are
626614

627615
## KeyFrame Algorithms ## {#KeyFrame-algorithms}
628616

629-
The <dfn>generate key frame algorithm</dfn>, given |promise|, |encoder| and |rid|, is defined by running these steps:
617+
The <dfn abstract-op>generate key frame algorithm</dfn>, given |promise|, |encoder| and |rid|, is defined by running these steps:
630618
1. If |encoder| is undefined, reject |promise| with {{InvalidStateError}}, abort these steps.
631619
1. If |encoder| is not processing video frames, reject |promise| with {{InvalidStateError}}, abort these steps.
632620
1. If |rid| is defined, validate its value. If invalid, reject |promise| with {{NotAllowedError}} and abort these steps.
@@ -658,7 +646,7 @@ By resolving the promises just before enqueuing the corresponding key frame in a
658646
the resolution callbacks of the promises are always executed just before the corresponding key frame is exposed.
659647
If the promise is associated to several rid values, it will be resolved when the first key frame corresponding to one the rid value is enqueued.
660648

661-
The <dfn>send request key frame algorithm</dfn>, given |promise| and |depacketizer|, is defined by running these steps:
649+
The <dfn abstract-op>send request key frame algorithm</dfn>, given |promise| and |depacketizer|, is defined by running these steps:
662650
1. If |depacketizer| is undefined, reject |promise| with {{InvalidStateError}}, abort these steps.
663651
1. If |depacketizer| is not processing video packets, reject |promise| with {{InvalidStateError}}, abort these steps.
664652
1. [=In parallel=], run the following steps:
@@ -682,7 +670,7 @@ partial interface RTCRtpSender {
682670
The <dfn method for="RTCRtpSender">generateKeyFrame(|rids|)</dfn> method steps are:
683671

684672
1. Let |promise| be a new promise.
685-
1. [=In parallel=], run the [=generate key frame algorithm=] with |promise|, |this|'s encoder and |rids|.
673+
1. [=In parallel=], run the [$generate key frame algorithm$] with |promise|, |this|'s encoder and |rids|.
686674
1. Return |promise|.
687675

688676
# Privacy and security considerations # {#privacy}

0 commit comments

Comments
 (0)