|
3748 | 3748 |
|
3749 | 3749 | : <dfn method for=VideoFrame>copyTo(|destination|, |options|)</dfn> |
3750 | 3750 | :: Asynchronously copies the planes of this frame into |destination| according |
3751 | | - to |options|. The format of the data is specified by {{VideoFrameCopyToOptions/format}}, |
3752 | | - if present, otherwise {{VideoFrame/format}}. |
| 3751 | + to |options|. The format of the data is |options|.{{VideoFrameCopyToOptions/format}}, |
| 3752 | + if it [=map/exists=] or [=this=] {{VideoFrame}}'s {{VideoFrame/format}} otherwise. |
3753 | 3753 |
|
3754 | 3754 | NOTE: Promises that are returned by several calls to |
3755 | 3755 | {{VideoFrame/copyTo()}} are not guaranteed to resolve in the order they |
|
3777 | 3777 | and |options|.{{VideoFrameCopyToOptions/colorSpace}}. |
3778 | 3778 | 4. Return the result of calling {{VideoFrame/copyTo()}} on |rgbFrame| with |
3779 | 3779 | |destination| and |newOptions|. |
3780 | | - 7. Otherwise, if |options|.{{VideoFrameCopyToOptions/format}} is not `undefined` or `null` |
3781 | | - return a promise rejected with a {{NotSupportedError}} {{DOMException}}. |
3782 | | - 8. Let |p| be a new {{Promise}}. |
3783 | | - 9. Let |copyStepsQueue| be the result of starting a new [=parallel queue=]. |
3784 | | - 10. Let |planeLayouts| be a new [=list=]. |
3785 | | - 11. Enqueue the following steps to |copyStepsQueue|: |
| 3780 | + 7. Let |p| be a new {{Promise}}. |
| 3781 | + 8. Let |copyStepsQueue| be the result of starting a new [=parallel queue=]. |
| 3782 | + 9. Let |planeLayouts| be a new [=list=]. |
| 3783 | + 10. Enqueue the following steps to |copyStepsQueue|: |
3786 | 3784 | 1. Let resource be the [=media resource=] referenced by |
3787 | 3785 | [[resource reference]]. |
3788 | 3786 | 2. Let |numPlanes| be the number of planes as defined by |
|
3819 | 3817 | 10. Increment |planeIndex| by `1`. |
3820 | 3818 | 11. Append |layout| to |planeLayouts|. |
3821 | 3819 | 5. [=Queue a task=] to resolve |p| with |planeLayouts|. |
3822 | | - 12. Return |p|. |
| 3820 | + 11. Return |p|. |
3823 | 3821 |
|
3824 | 3822 | : <dfn method for=VideoFrame>clone()</dfn> |
3825 | 3823 | :: Creates a new {{VideoFrame}} with a reference to the same |
|
4064 | 4062 | 7. If |options|.{{VideoFrameCopyToOptions/layout}} [=map/exists=], assign |
4065 | 4063 | its value to |optLayout|. |
4066 | 4064 | 8. Let |format| be `undefined`. |
4067 | | - 9. If |options|.{{VideoFrameCopyToOptions/format}} is `undefined`, |
| 4065 | + 9. If |options|.{{VideoFrameCopyToOptions/format}} does not [=map/exist=], |
4068 | 4066 | assign {{VideoFrame/[[format]]}} to |format|. |
4069 | 4067 | 10. Otherwise, if |options|.{{VideoFrameCopyToOptions/format}} is equal to |
4070 | 4068 | one of {{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}}, then assign |
|
4324 | 4322 | : <dfn dict-member for=VideoFrameCopyToOptions>format</dfn> |
4325 | 4323 | :: A {{VideoPixelFormat}} for the pixel data in the destination |
4326 | 4324 | {{BufferSource}}. Potential values are: {{RGBA}}, {{RGBX}}, {{BGRA}}, |
4327 | | - {{BGRX}}. If unspecified or `null`, the the destination |
4328 | | - {{BufferSource}} will match {{VideoFrame/format}} . |
| 4325 | + {{BGRX}}. If it does not [=map/exist=], the the destination |
| 4326 | + {{BufferSource}} will be in the same format as {{VideoFrame/format}} . |
4329 | 4327 | : <dfn dict-member for=VideoFrameCopyToOptions>colorSpace</dfn> |
4330 | 4328 | :: A {{PredefinedColorSpace}} that <em class="rfc2119">MUST</em> be used as |
4331 | 4329 | a target color space for the pixel data in the destination |
4332 | 4330 | {{BufferSource}}, but only if {{VideoFrameCopyToOptions/format}} is one of |
4333 | 4331 | {{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}}, otherwise it is ignored. |
4334 | | - If unspecified or `null`, {{srgb}} is used. |
| 4332 | + If it does not [=map/exist=], {{srgb}} is used. |
4335 | 4333 |
|
4336 | 4334 |
|
4337 | 4335 | DOMRects in VideoFrame {#videoframe-domrect} |
|
0 commit comments