|
2028 | 2028 |
|
2029 | 2029 | <dt><dfn dict-member for=VideoDecoderConfig>optimizeForLatency</dfn></dt> |
2030 | 2030 | <dd> |
2031 | | - Hint that the selected decoder SHOULD be configured to minimize the number |
2032 | | - of {{EncodedVideoChunk}}s that have to be decoded before a {{VideoFrame}} |
2033 | | - is output. |
| 2031 | + Hint that the selected decoder <em class="rfc2119">SHOULD</em> be configured |
| 2032 | + to minimize the number of {{EncodedVideoChunk}}s that have to be decoded |
| 2033 | + before a {{VideoFrame}} is output. |
2034 | 2034 |
|
2035 | 2035 | NOTE: In addition to User Agent and hardware limitations, some codec |
2036 | 2036 | bitstreams require a minimum number of inputs before any output can be |
|
2236 | 2236 |
|
2237 | 2237 | When supported, hardware acceleration offloads encoding or decoding to |
2238 | 2238 | specialized hardware. {{HardwareAcceleration/prefer-hardware}} and |
2239 | | -{{HardwareAcceleration/prefer-software}} are hints. While User Agents SHOULD |
2240 | | -respect these values when possible, User Agents may ignore these values in some |
2241 | | -or all circumstances for any reason. |
| 2239 | +{{HardwareAcceleration/prefer-software}} are hints. While User Agents |
| 2240 | +<em class="rfc2119">SHOULD</em> respect these values when possible, User |
| 2241 | +Agents may ignore these values in some or all circumstances for any reason. |
2242 | 2242 |
|
2243 | 2243 | To prevent fingerprinting, if a User Agent implements [[media-capabilities]], |
2244 | | -the User Agent MUST ensure rejection or acceptance of a given |
2245 | | -{{HardwareAcceleration}} preference reveals no additional information on top of |
2246 | | -what is inherent to the User Agent and revealed by [[media-capabilities]]. If a |
2247 | | -User Agent does not implement [[media-capabilities]] for reasons of |
2248 | | -fingerprinting, they SHOULD ignore the {{HardwareAcceleration}} preference. |
| 2244 | +the User Agent <em class="rfc2119">MUST</em> ensure rejection or acceptance of |
| 2245 | +a given {{HardwareAcceleration}} preference reveals no additional information |
| 2246 | +on top of what is inherent to the User Agent and revealed by |
| 2247 | +[[media-capabilities]]. If a User Agent does not implement |
| 2248 | +[[media-capabilities]] for reasons of fingerprinting, they |
| 2249 | +<em class="rfc2119">SHOULD</em> ignore the {{HardwareAcceleration}} preference. |
2249 | 2250 |
|
2250 | 2251 | <div class='note'> |
2251 | 2252 | NOTE: Good examples of when a User Agent can ignore |
|
2395 | 2396 | <dl> |
2396 | 2397 | <dt><dfn dict-member for=VideoEncoderEncodeOptions>keyFrame</dfn></dt> |
2397 | 2398 | <dd> |
2398 | | - A value of `true` indicates that the given frame MUST be encoded as a key |
2399 | | - frame. A value of `false` indicates that the User Agent has flexibility to |
2400 | | - decide whether the frame will be encoded as a [=key frame=]. |
| 2399 | + A value of `true` indicates that the given frame |
| 2400 | + <em class="rfc2119">MUST</em> be encoded as a key frame. A value of `false` |
| 2401 | + indicates that the User Agent has flexibility to decide whether the frame |
| 2402 | + will be encoded as a [=key frame=]. |
2401 | 2403 | </dd> |
2402 | 2404 | </dl> |
2403 | 2405 |
|
|
3245 | 3247 | but audio content using 24-bit samples is common, so 32-bits integers are |
3246 | 3248 | commonly used to hold 24-bit content. |
3247 | 3249 |
|
3248 | | -{{AudioData}} containing 24-bit samples SHOULD store those samples in {{s32}} or |
3249 | | -{{f32}}. When samples are stored in {{s32}}, each sample MUST be left-shifted by |
3250 | | -`8` bits. By virtue of this process, samples outside of the valid 24-bit range |
3251 | | -([-8388608, +8388607]) will be clipped. To avoid clipping and ensure lossless |
3252 | | -transport, samples <em class="rfc2119">MAY</em> be converted to {{f32}}. |
| 3250 | +{{AudioData}} containing 24-bit samples <em class="rfc2119">SHOULD</em> store those |
| 3251 | +samples in {{s32}} or {{f32}}. When samples are stored in {{s32}}, each sample |
| 3252 | +<em class="rfc2119">MUST</em> be left-shifted by `8` bits. By virtue of this |
| 3253 | +process, samples outside of the valid 24-bit range ([-8388608, +8388607]) will |
| 3254 | +be clipped. To avoid clipping and ensure lossless transport, samples |
| 3255 | +<em class="rfc2119">MAY</em> be converted to {{f32}}. |
3253 | 3256 |
|
3254 | 3257 | NOTE: While clipping is unavoidable in {{u8}}, {{s16}}, and {{s32}} samples due |
3255 | | -to their storage types, implementations SHOULD take care not to clip internally |
3256 | | -when handling {{f32}} samples. |
| 3258 | +to their storage types, implementations <em class="rfc2119">SHOULD</em> take |
| 3259 | +care not to clip internally when handling {{f32}} samples. |
3257 | 3260 |
|
3258 | 3261 | ### Audio channel ordering ### {#audio-channel-ordering} |
3259 | 3262 |
|
3260 | 3263 | When decoding, the ordering of the audio channels in the resulting {{AudioData}} |
3261 | | -MUST be the same as what is present in the {{EncodedAudioChunk}}. |
| 3264 | +<em class="rfc2119">MUST</em> be the same as what is present in the |
| 3265 | +{{EncodedAudioChunk}}. |
3262 | 3266 |
|
3263 | 3267 | When encoding, the ordering of the audio channels in the resulting |
3264 | | -{{EncodedAudioChunk}} MUST be the same as what is preset in the given |
3265 | | -{{AudioData}}; |
| 3268 | +{{EncodedAudioChunk}} <em class="rfc2119">MUST</em> be the same as what is |
| 3269 | +preset in the given {{AudioData}}. |
3266 | 3270 |
|
3267 | 3271 | In other terms, no channel reordering is performed when encoding and decoding. |
3268 | 3272 |
|
|
3820 | 3824 | :: 1. If |overrideColorSpace| is provided, return a new {{VideoColorSpace}} |
3821 | 3825 | constructed with |overrideColorSpace|. |
3822 | 3826 |
|
3823 | | - User Agents MAY replace `null` members of the provided |
3824 | | - |overrideColorSpace| with guessed values as determined by implementer |
| 3827 | + User Agents <em class="rfc2119">MAY</em> replace `null` members of the |
| 3828 | + provided |overrideColorSpace| with guessed values as determined by implementer |
3825 | 3829 | defined heuristics. |
3826 | 3830 |
|
3827 | 3831 | 2. Otherwise, if {{VideoFrame/[[format]]}} is an [=RGB format=] return a new |
|
4333 | 4337 | integer. Samples are arranged starting at the top left of the image. |
4334 | 4338 |
|
4335 | 4339 | The visible rectangle offset ({{VideoFrame/visibleRect}}.{{DOMRectInit/x}} |
4336 | | - and {{VideoFrame/visibleRect}}.{{DOMRectInit/y}}) MUST be even. |
| 4340 | + and {{VideoFrame/visibleRect}}.{{DOMRectInit/y}}) |
| 4341 | + <em class="rfc2119">MUST</em> be even. |
4337 | 4342 | </dd> |
4338 | 4343 | <dt><dfn enum-value for=VideoPixelFormat>I420A</dfn></dt> |
4339 | 4344 | <dd> |
|
4360 | 4365 | integer. Samples are arranged starting at the top left of the image. |
4361 | 4366 |
|
4362 | 4367 | The visible rectangle offset ({{VideoFrame/visibleRect}}.{{DOMRectInit/x}} |
4363 | | - and {{VideoFrame/visibleRect}}.{{DOMRectInit/y}}) MUST be even. |
| 4368 | + and {{VideoFrame/visibleRect}}.{{DOMRectInit/y}}) |
| 4369 | + <em class="rfc2119">MUST</em> be even. |
4364 | 4370 |
|
4365 | 4371 | {{I420A}}'s [=equivalent opaque format=] is {{I420}}. |
4366 | 4372 | </dd> |
|
4387 | 4393 | are arranged starting at the top left of the image. |
4388 | 4394 |
|
4389 | 4395 | The visible rectangle offset ({{VideoFrame/visibleRect}}.{{DOMRectInit/x}}) |
4390 | | - MUST be even. |
| 4396 | + <em class="rfc2119">MUST</em> be even. |
4391 | 4397 | </dd> |
4392 | 4398 | <dt><dfn enum-value for=VideoPixelFormat>I444</dfn></dt> |
4393 | 4399 | <dd> |
|
4430 | 4436 | at the top left of the image. |
4431 | 4437 |
|
4432 | 4438 | The visible rectangle offset ({{VideoFrame/visibleRect}}.{{DOMRectInit/x}} |
4433 | | - and {{VideoFrame/visibleRect}}.{{DOMRectInit/y}}) MUST be even. |
| 4439 | + and {{VideoFrame/visibleRect}}.{{DOMRectInit/y}}) |
| 4440 | + <em class="rfc2119">MUST</em> be even. |
4434 | 4441 |
|
4435 | 4442 | <div class=example> |
4436 | 4443 | An image in the NV12 pixel format that is 16 pixels wide and 10 pixels tall |
|
5575 | 5582 | Resource Reclamation{#resource-reclamation} |
5576 | 5583 | ============================================== |
5577 | 5584 |
|
5578 | | -When resources are constrained, a User Agent MAY proactively reclaim codecs. |
5579 | | -This is particularly true in the case where hardware codecs are limited, and |
5580 | | -shared accross web pages or platform apps. |
| 5585 | +When resources are constrained, a User Agent <em class="rfc2119">MAY</em> |
| 5586 | +proactively reclaim codecs. This is particularly true in the case where hardware |
| 5587 | +codecs are limited, and shared accross web pages or platform apps. |
5581 | 5588 |
|
5582 | | -To <dfn>reclaim a codec</dfn>, a User Agent MUST run the appropriate |
5583 | | -close algorithm (amongst [=Close AudioDecoder=], [=Close AudioEncoder=], |
5584 | | -[=Close VideoDecoder=] and [=Close VideoEncoder=]) with a {{QuotaExceededError}} |
5585 | | -{{DOMException}}. |
| 5589 | +To <dfn>reclaim a codec</dfn>, a User Agent <em class="rfc2119">MUST</em> run |
| 5590 | +the appropriate close algorithm (amongst [=Close AudioDecoder=], |
| 5591 | +[=Close AudioEncoder=], [=Close VideoDecoder=] and [=Close VideoEncoder=]) with |
| 5592 | +a {{QuotaExceededError}} {{DOMException}}. |
5586 | 5593 |
|
5587 | 5594 | The rules governing when a codec may be reclaimed depend on whether the codec is |
5588 | 5595 | an [=active=] or [=inactive=] codec and/or a [=background=] codec. |
|
5604 | 5611 | {{ownerDocument}} (or [=owner set=]'s {{Document}}, for codecs in workers) has a |
5605 | 5612 | {{Document/hidden}} attribute equal to `true`. |
5606 | 5613 |
|
5607 | | -A User Agent MUST only [=reclaim a codec=] that is either an |
5608 | | -[=inactive codec=], a [=background codec=], or both. A User Agent MUST NOT |
5609 | | -reclaim a codec that is both [=active=] and in the foreground, i.e. not a |
5610 | | -[=background codec=]. |
| 5614 | +A User Agent <em class="rfc2119">MUST</em> only [=reclaim a codec=] that is |
| 5615 | +either an [=inactive codec=], a [=background codec=], or both. A User Agent |
| 5616 | +<em class="rfc2119">MUST NOT</em> reclaim a codec that is both [=active=] and in |
| 5617 | +the foreground, i.e. not a [=background codec=]. |
5611 | 5618 |
|
5612 | | -Additionally, User Agents MUST NOT reclaim an [=active=] [=background=] codec |
5613 | | -if it is: |
| 5619 | +Additionally, User Agents <em class="rfc2119">MUST NOT</em> reclaim an [=active=] |
| 5620 | +[=background=] codec if it is: |
5614 | 5621 | - An encoder, e.g. an {{AudioEncoder}} or {{VideoEncoder}}. |
5615 | 5622 |
|
5616 | 5623 | NOTE: This prevents long running encode tasks from being interrupted. |
|
0 commit comments