|
2485 | 2485 | [EnforceRange] required long long timestamp; // microseconds
|
2486 | 2486 | [EnforceRange] unsigned long long duration; // microseconds
|
2487 | 2487 | required BufferSource data;
|
| 2488 | + sequence<ArrayBuffer> transfer = []; |
2488 | 2489 | };
|
2489 | 2490 |
|
2490 | 2491 | enum EncodedAudioChunkType {
|
|
2509 | 2510 | <dfn constructor for=EncodedAudioChunk title="EncodedAudioChunk(init)">
|
2510 | 2511 | EncodedAudioChunk(init)
|
2511 | 2512 | </dfn>
|
2512 |
| -1. Let |chunk| be a new {{EncodedAudioChunk}} object, initialized as follows |
| 2513 | +1. If |init|.{{EncodedAudioChunkInit/transfer}} contains more than one reference |
| 2514 | + to the same {{ArrayBuffer}}, then throw a {{DataCloneError}} {{DOMException}}. |
| 2515 | +2. For each |transferable| in |init|.{{EncodedAudioChunkInit/transfer}}: |
| 2516 | + 1. If {{platform object/[[Detached]]}} internal slot is `true`, |
| 2517 | + then throw a {{DataCloneError}} {{DOMException}}. |
| 2518 | +3. Let |chunk| be a new {{EncodedAudioChunk}} object, initialized as follows |
2513 | 2519 | 1. Assign `init.type` to {{EncodedAudioChunk/[[type]]}}.
|
2514 | 2520 | 2. Assign `init.timestamp` to {{EncodedAudioChunk/[[timestamp]]}}.
|
2515 | 2521 | 3. If `init.duration` exists, assign it to
|
2516 | 2522 | {{EncodedAudioChunk/[[duration]]}}, or assign `null` otherwise.
|
2517 |
| - 4. Assign a copy of `init.data` to {{EncodedAudioChunk/[[internal data]]}}. |
2518 |
| - 5. Assign `init.data.byteLength` to {{EncodedAudioChunk/[[byte length]]}}; |
| 2523 | + 4. Assign `init.data.byteLength` to {{EncodedAudioChunk/[[byte length]]}}; |
| 2524 | + 5. If |init|.{{EncodedAudioChunkInit/transfer}} contains an {{ArrayBuffer}} |
| 2525 | + referenced by |init|.{{EncodedAudioChunkInit/data}} the User Agent |
| 2526 | + <em class="rfc2119">MAY</em> choose to: |
| 2527 | + 1. Let |resource| be a new [=media resource=] referencing sample data |
| 2528 | + in |init|.{{EncodedAudioChunkInit/data}}. |
| 2529 | + 6. Otherwise: |
| 2530 | + 1. Assign a copy of |init|.{{EncodedAudioChunkInit/data}} |
| 2531 | + to {{EncodedAudioChunk/[[internal data]]}}. |
| 2532 | +4. For each |transferable| in |init|.{{EncodedAudioChunkInit/transfer}}: |
| 2533 | + 1. Perform [DetachArrayBuffer](https://tc39.es/ecma262/#sec-detacharraybuffer) |
| 2534 | + on |transferable| |
2519 | 2535 | 5. Return |chunk|.
|
2520 | 2536 |
|
2521 | 2537 | ### Attributes ###{#encodedaudiochunk-attributes}
|
|
2575 | 2591 | [EnforceRange] required long long timestamp; // microseconds
|
2576 | 2592 | [EnforceRange] unsigned long long duration; // microseconds
|
2577 | 2593 | required AllowSharedBufferSource data;
|
| 2594 | + sequence<ArrayBuffer> transfer = []; |
2578 | 2595 | };
|
2579 | 2596 |
|
2580 | 2597 | enum EncodedVideoChunkType {
|
|
2599 | 2616 | <dfn constructor for=EncodedVideoChunk title="EncodedVideoChunk(init)">
|
2600 | 2617 | EncodedVideoChunk(init)
|
2601 | 2618 | </dfn>
|
2602 |
| -1. Let |chunk| be a new {{EncodedVideoChunk}} object, initialized as follows |
| 2619 | +1. If |init|.{{EncodedVideoChunkInit/transfer}} contains more than one reference |
| 2620 | + to the same {{ArrayBuffer}}, then throw a {{DataCloneError}} {{DOMException}}. |
| 2621 | +2. For each |transferable| in |init|.{{EncodedVideoChunkInit/transfer}}: |
| 2622 | + 1. If {{platform object/[[Detached]]}} internal slot is `true`, |
| 2623 | + then throw a {{DataCloneError}} {{DOMException}}. |
| 2624 | +3. Let |chunk| be a new {{EncodedVideoChunk}} object, initialized as follows |
2603 | 2625 | 1. Assign `init.type` to {{EncodedVideoChunk/[[type]]}}.
|
2604 | 2626 | 2. Assign `init.timestamp` to {{EncodedVideoChunk/[[timestamp]]}}.
|
2605 | 2627 | 3. If duration is present in init, assign `init.duration` to
|
2606 | 2628 | {{EncodedVideoChunk/[[duration]]}}. Otherwise, assign `null` to
|
2607 | 2629 | {{EncodedVideoChunk/[[duration]]}}.
|
2608 |
| - 4. Assign a copy of `init.data` to {{EncodedVideoChunk/[[internal data]]}}. |
2609 |
| - 5. Assign `init.data.byteLength` to {{EncodedVideoChunk/[[byte length]]}}; |
2610 |
| -3. Return |chunk|. |
| 2630 | + 4. Assign `init.data.byteLength` to {{EncodedVideoChunk/[[byte length]]}}; |
| 2631 | + 5. If |init|.{{EncodedVideoChunkInit/transfer}} contains an {{ArrayBuffer}} |
| 2632 | + referenced by |init|.{{EncodedVideoChunkInit/data}} the User Agent |
| 2633 | + <em class="rfc2119">MAY</em> choose to: |
| 2634 | + 1. Let |resource| be a new [=media resource=] referencing sample data |
| 2635 | + in |init|.{{EncodedVideoChunkInit/data}}. |
| 2636 | + 6. Otherwise: |
| 2637 | + 1. Assign a copy of |init|.{{EncodedVideoChunkInit/data}} |
| 2638 | + to {{EncodedVideoChunk/[[internal data]]}}. |
| 2639 | +4. For each |transferable| in |init|.{{EncodedVideoChunkInit/transfer}}: |
| 2640 | + 1. Perform [DetachArrayBuffer](https://tc39.es/ecma262/#sec-detacharraybuffer) |
| 2641 | + on |transferable| |
| 2642 | +5. Return |chunk|. |
2611 | 2643 |
|
2612 | 2644 | ### Attributes ###{#encodedvideochunk-attributes}
|
2613 | 2645 | : <dfn attribute for=EncodedVideoChunk>type</dfn>
|
|
5596 | 5628 |
|
5597 | 5629 | <div class=non-normative>
|
5598 | 5630 | This section is non-normative.
|
5599 |
| - |
| 5631 | + |
5600 | 5632 | The primary security impact is that features of this API make it easier for an
|
5601 | 5633 | attacker to exploit vulnerabilities in the underlying platform codecs.
|
5602 | 5634 | Additionally, new abilities to configure and control the codecs can allow for
|
|
0 commit comments