|
245 | 245 |
|
246 | 246 | Each [=codec=] instance has an internal slot named
|
247 | 247 | <dfn>[[codec implementation]]</dfn> that refers to the underlying platform
|
248 |
| -encoder or decoder. Except for assignment, any steps that reference |
| 248 | +encoder or decoder. Except for the initial assignment, any steps that reference |
249 | 249 | [=[[codec implementation]]=] will be enqueued to the [=[[codec work queue]]=].
|
250 | 250 |
|
251 | 251 | Each [=codec=] instance has a unique <dfn>codec task source</dfn>. Tasks
|
|
381 | 381 |
|
382 | 382 | [=Running a control message=] to configure the decoder means running
|
383 | 383 | these steps:
|
384 |
| - 1. Let |supported| be the result of running the <a>Check Configuration |
385 |
| - Support</a> algorithm with |config|. |
386 |
| - 2. If |supported| is `true`, assign |
387 |
| - {{AudioDecoder/[[codec implementation]]}} with an implementation |
388 |
| - supporting |config|. |
389 |
| - 3. Otherwise, run the <a>Close AudioDecoder</a> algorithm with |
390 |
| - {{NotSupportedError}} and return `"processed"`. |
391 |
| - 4. Assign `true` to {{AudioDecoder/[[message queue blocked]]}}. |
392 |
| - 5. Enqueue the following steps to {{AudioDecoder/[[codec work queue]]}}: |
393 |
| - 1. Configure {{AudioDecoder/[[codec implementation]]}} with |config|. |
394 |
| - 2. Assign `false` to {{AudioDecoder/[[message queue blocked]]}}. |
395 |
| - 3. [=Queue a task=] to [=Process the control message queue=]. |
396 |
| - 6. Return `"processed"`. |
| 384 | + 1. Assign `true` to {{AudioDecoder/[[message queue blocked]]}}. |
| 385 | + 1. Enqueue the following steps to {{AudioDecoder/[[codec work queue]]}}: |
| 386 | + 1. Let |supported| be the result of running the <a>Check Configuration |
| 387 | + Support</a> algorithm with |config|. |
| 388 | + 2. If |supported| is `false`, [=queue a task=] to run the <a>Close |
| 389 | + AudioDecoder</a> algorithm with {{NotSupportedError}} and abort |
| 390 | + these steps. |
| 391 | + 3. If needed, assign {{AudioDecoder/[[codec implementation]]}} with an |
| 392 | + implementation supporting |config|. |
| 393 | + 4. Configure {{AudioDecoder/[[codec implementation]]}} with |config|. |
| 394 | + 5. [=queue a task=] to run the following steps: |
| 395 | + 1. Assign `false` to {{AudioDecoder/[[message queue blocked]]}}. |
| 396 | + 2. [=Queue a task=] to [=Process the control message queue=]. |
| 397 | + 3. Return `"processed"`. |
397 | 398 | </dd>
|
398 | 399 |
|
399 | 400 | <dt><dfn method for=AudioDecoder>decode(chunk)</dfn></dt>
|
|
509 | 510 | 3. Let |checkSupportQueue| be the result of starting a new <a>parallel
|
510 | 511 | queue</a>.
|
511 | 512 | 4. Enqueue the following steps to |checkSupportQueue|:
|
512 |
| - 1. Let |decoderSupport| be a newly constructed |
513 |
| - {{AudioDecoderSupport}}, initialized as follows: |
514 |
| - 1. Set {{AudioDecoderSupport/config}} to the result of running the |
515 |
| - <a>Clone Configuration</a> algorithm with |config|. |
516 |
| - 2. Set {{AudioDecoderSupport/supported}} to the result of running |
517 |
| - the <a>Check Configuration Support</a> algorithm with |config|. |
518 |
| - 2. Resolve |p| with |decoderSupport|. |
519 |
| - 5. Return |p|. |
| 513 | + 1. Let |supported| be the result of running |
| 514 | + the <a>Check Configuration Support</a> algorithm with |config|. |
| 515 | + 2. [=Queue a task=] to run the following steps: |
| 516 | + 1. Let |decoderSupport| be a newly constructed |
| 517 | + {{AudioDecoderSupport}}, initialized as follows: |
| 518 | + 1. Set {{AudioDecoderSupport/config}} to the result of running the |
| 519 | + <a>Clone Configuration</a> algorithm with |config|. |
| 520 | + 2. Set {{AudioDecoderSupport/supported}} to |supported|. |
| 521 | + 2. Resolve |p| with |decoderSupport|. |
| 522 | + 5. Return |p|. |
520 | 523 | </dd>
|
521 | 524 | </dl>
|
522 | 525 |
|
|
576 | 579 | 3. Clear {{AudioDecoder/[[codec implementation]]}} and release associated
|
577 | 580 | [=system resources=].
|
578 | 581 | 4. If |exception| is not an {{AbortError}} {{DOMException}},
|
579 |
| - [=queue a task=] to invoke the {{AudioDecoder/[[error callback]]}} with |exception|. |
| 582 | + invoke the {{AudioDecoder/[[error callback]]}} with |exception|. |
580 | 583 | </dd>
|
581 | 584 | </dl>
|
582 | 585 |
|
|
712 | 715 |
|
713 | 716 | [=Running a control message=] to configure the decoder means running
|
714 | 717 | these steps:
|
715 |
| - 1. Let |supported| be the result of running the <a>Check Configuration |
716 |
| - Support</a> algorithm with |config|. |
717 |
| - 2. If |supported| is `true`, assign |
718 |
| - {{VideoDecoder/[[codec implementation]]}} with an implementation |
719 |
| - supporting |config|. |
720 |
| - 3. Otherwise, run the <a>Close VideoDecoder</a> algorithm with |
721 |
| - {{NotSupportedError}} and return `"processed"`. |
722 |
| - 4. Assign `true` to {{VideoDecoder/[[message queue blocked]]}}. |
723 |
| - 5. Enqueue the following steps to {{VideoDecoder/[[codec work queue]]}}: |
724 |
| - 1. Configure {{VideoDecoder/[[codec implementation]]}} with |config|. |
725 |
| - 2. Set {{VideoDecoder/[[active decoder config]]}} to `config`. |
726 |
| - 3. Assign `false` to {{VideoDecoder/[[message queue blocked]]}}. |
727 |
| - 4. [=Queue a task=] to [=Process the control message queue=]. |
728 |
| - 6. Return `"processed"`. |
| 718 | + 1. Assign `true` to {{VideoDecoder/[[message queue blocked]]}}. |
| 719 | + 1. Enqueue the following steps to {{VideoDecoder/[[codec work queue]]}}: |
| 720 | + 1. Let |supported| be the result of running the <a>Check Configuration |
| 721 | + Support</a> algorithm with |config|. |
| 722 | + 2. If |supported| is `false`, [=queue a task=] to run the <a>Close |
| 723 | + VideoDecoder</a> algorithm with {{NotSupportedError}} and abort |
| 724 | + these steps. |
| 725 | + 3. If needed, assign {{VideoDecoder/[[codec implementation]]}} with an |
| 726 | + implementation supporting |config|. |
| 727 | + 4. Configure {{VideoDecoder/[[codec implementation]]}} with |config|. |
| 728 | + 5. [=queue a task=] to run the following steps: |
| 729 | + 1. Assign `false` to {{VideoDecoder/[[message queue blocked]]}}. |
| 730 | + 2. [=Queue a task=] to [=Process the control message queue=]. |
| 731 | + 3. Return `"processed"`. |
729 | 732 | </dd>
|
730 | 733 |
|
731 | 734 | <dt><dfn method for=VideoDecoder>decode(chunk)</dfn></dt>
|
|
852 | 855 | 3. Let |checkSupportQueue| be the result of starting a new <a>parallel
|
853 | 856 | queue</a>.
|
854 | 857 | 4. Enqueue the following steps to |checkSupportQueue|:
|
855 |
| - 1. Let |decoderSupport| be a newly constructed |
856 |
| - {{VideoDecoderSupport}}, initialized as follows: |
857 |
| - 1. Set {{VideoDecoderSupport/config}} to the result of running the |
858 |
| - <a>Clone Configuration</a> algorithm with |config|. |
859 |
| - 2. Set {{VideoDecoderSupport/supported}} to the result of running |
860 |
| - the <a>Check Configuration Support</a> algorithm with |config|. |
861 |
| - 2. Resolve |p| with |decoderSupport|. |
862 |
| - 5. Return |p|. |
| 858 | + 1. Let |supported| be the result of running |
| 859 | + the <a>Check Configuration Support</a> algorithm with |config|. |
| 860 | + 2. [=Queue a task=] to run the following steps: |
| 861 | + 1. Let |decoderSupport| be a newly constructed |
| 862 | + {{VideoDecoderSupport}}, initialized as follows: |
| 863 | + 1. Set {{VideoDecoderSupport/config}} to the result of running the |
| 864 | + <a>Clone Configuration</a> algorithm with |config|. |
| 865 | + 2. Set {{VideoDecoderSupport/supported}} to |supported|. |
| 866 | + 2. Resolve |p| with |decoderSupport|. |
| 867 | + 5. Return |p|. |
863 | 868 | </dd>
|
864 | 869 | </dl>
|
865 | 870 |
|
|
929 | 934 | 3. Clear {{VideoDecoder/[[codec implementation]]}} and release associated
|
930 | 935 | [=system resources=].
|
931 | 936 | 4. If |exception| is not an {{AbortError}} {{DOMException}},
|
932 |
| - [=queue a task=] to invoke the {{VideoDecoder/[[error callback]]}} with |exception|. |
| 937 | + invoke the {{VideoDecoder/[[error callback]]}} with |exception|. |
933 | 938 | </dd>
|
934 | 939 | </dl>
|
935 | 940 |
|
|
1065 | 1070 |
|
1066 | 1071 | [=Running a control message=] to configure the encoder means performing
|
1067 | 1072 | these steps:
|
1068 |
| - 1. Let |supported| be the result of running the <a>Check Configuration |
1069 |
| - Support</a> algorithm with |config|. |
1070 |
| - 2. If |supported| is `true`, assign |
1071 |
| - {{AudioEncoder/[[codec implementation]]}} with an implementation |
1072 |
| - supporting |config|. |
1073 |
| - 3. Otherwise, run the <a>Close AudioEncoder</a> algorithm with |
1074 |
| - {{NotSupportedError}} and return `"processed"`. |
1075 |
| - 4. Assign `true` to {{AudioEncoder/[[message queue blocked]]}}. |
1076 |
| - 5. Enqueue the following steps to {{AudioEncoder/[[codec work queue]]}}: |
1077 |
| - 1. Configure {{AudioEncoder/[[codec implementation]]}} with |config|. |
1078 |
| - 2. Set {{AudioEncoder/[[active encoder config]]}} to `config`. |
1079 |
| - 3. Assign `false` to {{AudioEncoder/[[message queue blocked]]}}. |
1080 |
| - 4. [=Queue a task=] to [=Process the control message queue=]. |
1081 |
| - 6. Return `"processed"`. |
| 1073 | + 1. Assign `true` to {{AudioEncoder/[[message queue blocked]]}}. |
| 1074 | + 2. Enqueue the following steps to {{AudioEncoder/[[codec work queue]]}}: |
| 1075 | + 1. Let |supported| be the result of running the <a>Check Configuration |
| 1076 | + Support</a> algorithm with |config|. |
| 1077 | + 2. If |supported| is `false`, [=queue a task=] to run the <a>Close |
| 1078 | + AudioEncoder</a> algorithm with {{NotSupportedError}} and abort |
| 1079 | + these steps. |
| 1080 | + 3. If needed, assign {{AudioEncoder/[[codec implementation]]}} with an |
| 1081 | + implementation supporting |config|. |
| 1082 | + 4. Configure {{AudioEncoder/[[codec implementation]]}} with |config|. |
| 1083 | + 5. [=queue a task=] to run the following steps: |
| 1084 | + 1. Assign `false` to {{AudioEncoder/[[message queue blocked]]}}. |
| 1085 | + 2. [=Queue a task=] to [=Process the control message queue=]. |
| 1086 | + 3. Return `"processed"`. |
1082 | 1087 | </dd>
|
1083 | 1088 |
|
1084 | 1089 | <dt><dfn method for=AudioEncoder>encode(data)</dfn></dt>
|
|
1188 | 1193 | 3. Let |checkSupportQueue| be the result of starting a new <a>parallel
|
1189 | 1194 | queue</a>.
|
1190 | 1195 | 4. Enqueue the following steps to |checkSupportQueue|:
|
1191 |
| - 1. Let |encoderSupport| be a newly constructed |
1192 |
| - {{AudioEncoderSupport}}, initialized as follows: |
1193 |
| - 1. Set {{AudioEncoderSupport/config}} to the result of running the |
1194 |
| - <a>Clone Configuration</a> algorithm with |config|. |
1195 |
| - 2. Set {{AudioEncoderSupport/supported}} to the result of running |
1196 |
| - the <a>Check Configuration Support</a> algorithm with |config|. |
1197 |
| - 2. Resolve |p| with |encoderSupport|. |
1198 |
| - 5. Return |p|. |
| 1196 | + 1. Let |supported| be the result of running |
| 1197 | + the <a>Check Configuration Support</a> algorithm with |config|. |
| 1198 | + 2. [=Queue a task=] to run the following steps: |
| 1199 | + 1. Let |encoderSupport| be a newly constructed |
| 1200 | + {{AudioEncoderSupport}}, initialized as follows: |
| 1201 | + 1. Set {{AudioEncoderSupport/config}} to the result of running the |
| 1202 | + <a>Clone Configuration</a> algorithm with |config|. |
| 1203 | + 2. Set {{AudioEncoderSupport/supported}} to |supported|. |
| 1204 | + 2. Resolve |p| with |encoderSupport|. |
| 1205 | + 5. Return |p|. |
1199 | 1206 | </dd>
|
1200 | 1207 | </dl>
|
1201 | 1208 |
|
|
1285 | 1292 | 3. Clear {{AudioEncoder/[[codec implementation]]}} and release associated
|
1286 | 1293 | [=system resources=].
|
1287 | 1294 | 4. If |exception| is not an {{AbortError}} {{DOMException}},
|
1288 |
| - [=queue a task=] to invoke the |
1289 |
| - {{AudioEncoder/[[error callback]]}} with |exception|. |
| 1295 | + invoke the {{AudioEncoder/[[error callback]]}} with |exception|. |
1290 | 1296 | </dd>
|
1291 | 1297 | </dl>
|
1292 | 1298 |
|
|
1439 | 1445 |
|
1440 | 1446 | [=Running a control message=] to configure the encoder means performing
|
1441 | 1447 | these steps:
|
1442 |
| - 1. Let |supported| be the result of running the <a>Check Configuration |
1443 |
| - Support</a> algorithm with |config|. |
1444 |
| - 2. If |supported| is `true`, assign |
1445 |
| - {{VideoEncoder/[[codec implementation]]}} with an implementation |
1446 |
| - supporting |config|. |
1447 |
| - 3. Otherwise, run the <a>Close VideoEncoder</a> algorithm with |
1448 |
| - {{NotSupportedError}} and return `"processed"`. |
1449 |
| - 4. Assign `true` to {{VideoEncoder/[[message queue blocked]]}}. |
1450 |
| - 5. Enqueue the following steps to {{VideoEncoder/[[codec work queue]]}}: |
1451 |
| - 1. Configure {{VideoEncoder/[[codec implementation]]}} with |config|. |
1452 |
| - 2. Set {{VideoEncoder/[[active encoder config]]}} to `config`. |
1453 |
| - 3. Assign `false` to {{VideoEncoder/[[message queue blocked]]}}. |
1454 |
| - 4. [=Queue a task=] to [=Process the control message queue=]. |
1455 |
| - 6. Return `"processed"`. |
| 1448 | + 1. Assign `true` to {{VideoEncoder/[[message queue blocked]]}}. |
| 1449 | + 1. Enqueue the following steps to {{VideoEncoder/[[codec work queue]]}}: |
| 1450 | + 1. Let |supported| be the result of running the <a>Check Configuration |
| 1451 | + Support</a> algorithm with |config|. |
| 1452 | + 2. If |supported| is `false`, [=queue a task=] to run the <a>Close |
| 1453 | + VideoEncoder</a> algorithm with {{NotSupportedError}} and abort |
| 1454 | + these steps. |
| 1455 | + 3. If needed, assign {{VideoEncoder/[[codec implementation]]}} with an |
| 1456 | + implementation supporting |config|. |
| 1457 | + 4. Configure {{VideoEncoder/[[codec implementation]]}} with |config|. |
| 1458 | + 5. [=queue a task=] to run the following steps: |
| 1459 | + 1. Assign `false` to {{VideoEncoder/[[message queue blocked]]}}. |
| 1460 | + 2. [=Queue a task=] to [=Process the control message queue=]. |
| 1461 | + 3. Return `"processed"`. |
1456 | 1462 | </dd>
|
1457 | 1463 |
|
1458 | 1464 | <dt><dfn method for=VideoEncoder>encode(|frame|, |options|)</dfn></dt>
|
|
1562 | 1568 | 3. Let |checkSupportQueue| be the result of starting a new <a>parallel
|
1563 | 1569 | queue</a>.
|
1564 | 1570 | 4. Enqueue the following steps to |checkSupportQueue|:
|
1565 |
| - 1. Let |encoderSupport| be a newly constructed |
1566 |
| - {{VideoEncoderSupport}}, initialized as follows: |
1567 |
| - 1. Set {{VideoEncoderSupport/config}} to the result of running the |
1568 |
| - <a>Clone Configuration</a> algorithm with |config|. |
1569 |
| - 2. Set {{VideoEncoderSupport/supported}} to the result of running |
1570 |
| - the <a>Check Configuration Support</a> algorithm with |config|. |
1571 |
| - 2. Resolve |p| with |encoderSupport|. |
1572 |
| - 5. Return |p|. |
| 1571 | + 1. Let |supported| be the result of running |
| 1572 | + the <a>Check Configuration Support</a> algorithm with |config|. |
| 1573 | + 2. [=Queue a task=] to run the following steps: |
| 1574 | + 1. Let |encoderSupport| be a newly constructed |
| 1575 | + {{VideoEncoderSupport}}, initialized as follows: |
| 1576 | + 1. Set {{VideoEncoderSupport/config}} to the result of running the |
| 1577 | + <a>Clone Configuration</a> algorithm with |config|. |
| 1578 | + 2. Set {{VideoEncoderSupport/supported}} to |supported|. |
| 1579 | + 2. Resolve |p| with |encoderSupport|. |
| 1580 | + 5. Return |p|. |
1573 | 1581 | </dd>
|
1574 | 1582 | </dl>
|
1575 | 1583 |
|
|
1674 | 1682 | 3. Clear {{VideoEncoder/[[codec implementation]]}} and release associated
|
1675 | 1683 | [=system resources=].
|
1676 | 1684 | 4. If |exception| is not an {{AbortError}} {{DOMException}},
|
1677 |
| - [=queue a task=] to invoke the {{VideoEncoder/[[error callback]]}} with |
1678 |
| - |exception|. |
| 1685 | + invoke the {{VideoEncoder/[[error callback]]}} with |exception|. |
1679 | 1686 | </dd>
|
1680 | 1687 | </dl>
|
1681 | 1688 |
|
|
0 commit comments