|
3756 | 3756 | were returned. |
3757 | 3757 |
|
3758 | 3758 | When invoked, run these steps: |
3759 | | - 1. If {{platform object/[[Detached]]}} is `true`, throw an |
3760 | | - {{InvalidStateError}} {{DOMException}}. |
3761 | | - 2. If {{VideoFrame/[[format]]}} is `null`, throw a {{NotSupportedError}} |
3762 | | - {{DOMException}}. |
| 3759 | + 1. If {{platform object/[[Detached]]}} is `true`, return a promise rejected |
| 3760 | + with a {{InvalidStateError}} {{DOMException}}. |
| 3761 | + 2. If {{VideoFrame/[[format]]}} is `null`, return a promise rejected with a |
| 3762 | + {{NotSupportedError}} {{DOMException}}. |
3763 | 3763 | 3. Let |combinedLayout| be the result of running the [=Parse |
3764 | 3764 | VideoFrameCopyToOptions=] algorithm with |options|. |
3765 | 3765 | 4. If |combinedLayout| is an exception, return a promise rejected with |
|
3778 | 3778 | 4. Return the result of calling {{VideoFrame/copyTo()}} on |rgbFrame| with |
3779 | 3779 | |destination| and |newOptions|. |
3780 | 3780 | 7. Otherwise, if |options|.{{VideoFrameCopyToOptions/format}} is not `undefined` or `null` |
3781 | | - throw a {{NotSupportedError}} {{DOMException}}. |
| 3781 | + return a promise rejected with a {{NotSupportedError}} {{DOMException}}. |
3782 | 3782 | 8. Let |p| be a new {{Promise}}. |
3783 | 3783 | 9. Let |copyStepsQueue| be the result of starting a new [=parallel queue=]. |
3784 | 3784 | 10. Let |planeLayouts| be a new [=list=]. |
|
4206 | 4206 | 9. Return |combinedLayout|. |
4207 | 4207 |
|
4208 | 4208 | : <dfn for=VideoFrame>Convert to RGB frame</dfn> (with |frame|, |format| and |colorSpace|) |
4209 | | - :: 1. If |format| is not equal to one {{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}}, |
4210 | | - throw a {{NotSupportedError}} |
4211 | | - 1. Let |convertedFrame| be a new {{VideoFrame}}, constructed as follows: |
| 4209 | + :: 1. This algorithm <em class="rfc2119">MUST</em> be called only if |format| |
| 4210 | + is equal to one of {{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}}. |
| 4211 | + 2. Let |convertedFrame| be a new {{VideoFrame}}, constructed as follows: |
4212 | 4212 | 1. Assign `false` to {{platform object/[[Detached]]}}. |
4213 | 4213 | 2. Assign |format| to {{VideoFrame/[[format]]}}. |
4214 | 4214 | 3. Let |width| be |frame|'s {{VideoFrame/[[visible width]]}}. |
|
4227 | 4227 | {{VideoFrame/[[resource reference]]}} into a color space and pixel |
4228 | 4228 | format specified by |colorSpace| and |format| respectively. |
4229 | 4229 | 9. Assign the reference to |resource| to {{VideoFrame/[[resource reference]]}} |
4230 | | - 2. Return |convertedFrame|. |
| 4230 | + 3. Return |convertedFrame|. |
4231 | 4231 |
|
4232 | 4232 | : <dfn for=VideoFrame>Copy VideoFrame metadata</dfn> (with |metadata|) |
4233 | 4233 | :: 1. Let |metadataCopySerialized| be [$StructuredSerialize$](|metadata|). |
|
0 commit comments