Skip to content

Commit 875bc88

Browse files
committed
Allow for color space conversion to p3 and sRGB for RGB frames as well
1 parent 51dbdad commit 875bc88

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

index.src.html

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3767,9 +3767,8 @@
37673767
5. If `destination.byteLength` is less than |combinedLayout|'s [=combined
37683768
buffer layout/allocationSize=], return a promise rejected with a
37693769
{{TypeError}}.
3770-
6. If |options|.{{VideoFrameCopyToOptions/format}} does not equal
3771-
{{VideoFrame/[[format]]}} and |options|.{{VideoFrameCopyToOptions/format}}
3772-
is equal to one of {{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}} then:
3770+
6. If |options|.{{VideoFrameCopyToOptions/format}} is equal to one of
3771+
{{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}} then:
37733772
1. Let |newOptions| be the result of running the <a>Clone Configuration</a>
37743773
algorithm with |options|.
37753774
2. Assign `undefined` to |newOptions|.{{VideoFrameCopyToOptions/format}}
@@ -3782,10 +3781,12 @@
37823781
algorithm with |options|.{{VideoFrameCopyToOptions/format}}, |rect|, and `options.colorSpace`.
37833782
7. Return the result of calling {{VideoFrame/copyTo()}} on |rgbFrame| with
37843783
|destination| and |newOptions|.
3785-
7. Let |p| be a new {{Promise}}.
3786-
8. Let |copyStepsQueue| be the result of starting a new [=parallel queue=].
3787-
9. Let |planeLayouts| be a new [=list=].
3788-
10. Enqueue the following steps to |copyStepsQueue|:
3784+
7. Otherwise, if |options|.{{VideoFrameCopyToOptions/format}} is not `undefined` or `null`
3785+
throw a {{NotSupportedError}} {{DOMException}}.
3786+
8. Let |p| be a new {{Promise}}.
3787+
9. Let |copyStepsQueue| be the result of starting a new [=parallel queue=].
3788+
10. Let |planeLayouts| be a new [=list=].
3789+
11. Enqueue the following steps to |copyStepsQueue|:
37893790
1. Let resource be the [=media resource=] referenced by
37903791
[[resource reference]].
37913792
2. Let |numPlanes| be the number of planes as defined by
@@ -3822,7 +3823,7 @@
38223823
10. Increment |planeIndex| by `1`.
38233824
11. Append |layout| to |planeLayouts|.
38243825
5. [=Queue a task=] to resolve |p| with |planeLayouts|.
3825-
11. Return |p|.
3826+
12. Return |p|.
38263827

38273828
: <dfn method for=VideoFrame>clone()</dfn>
38283829
:: Creates a new {{VideoFrame}} with a reference to the same
@@ -4328,9 +4329,9 @@
43284329
invalid to specify planes that overlap.
43294330
: <dfn dict-member for=VideoFrameCopyToOptions>format</dfn>
43304331
:: A {{VideoPixelFormat}} for the pixel data in the destination
4331-
{{BufferSource}}. Potential values are:
4332-
{{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}} and values of {{VideoFrame/format}}.
4333-
If unspecified or `null`, the {{VideoFrame/format}} is used.
4332+
{{BufferSource}}. Potential values are: {{RGBA}}, {{RGBX}}, {{BGRA}},
4333+
{{BGRX}}. If unspecified or `null`, the the destination
4334+
{{BufferSource}} will match {{VideoFrame/format}} .
43344335
: <dfn dict-member for=VideoFrameCopyToOptions>colorSpace</dfn>
43354336
:: A {{PredefinedColorSpace}} that <em class="rfc2119">SHALL</em> be used as
43364337
a target color space for the pixel data in the destination

0 commit comments

Comments
 (0)