Skip to content

Commit

Permalink
Allow for color space conversion to p3 and sRGB for RGB frames as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Djuffin committed Feb 29, 2024
1 parent 13da493 commit b8ca480
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -3763,9 +3763,8 @@
5. If `destination.byteLength` is less than |combinedLayout|'s [=combined
buffer layout/allocationSize=], return a promise rejected with a
{{TypeError}}.
6. If |options|.{{VideoFrameCopyToOptions/format}} does not equal
{{VideoFrame/[[format]]}} and |options|.{{VideoFrameCopyToOptions/format}}
is equal to one of {{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}} then:
6. If |options|.{{VideoFrameCopyToOptions/format}} is equal to one of
{{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}} then:
1. Let |newOptions| be the result of running the <a>Clone Configuration</a>
algorithm with |options|.
2. Assign `undefined` to |newOptions|.{{VideoFrameCopyToOptions/format}}
Expand All @@ -3778,10 +3777,12 @@
algorithm with |options|.{{VideoFrameCopyToOptions/format}}, |rect|, and `options.colorSpace`.
7. Return the result of calling {{VideoFrame/copyTo()}} on |rgbFrame| with
|destination| and |newOptions|.
7. Let |p| be a new {{Promise}}.
8. Let |copyStepsQueue| be the result of starting a new [=parallel queue=].
9. Let |planeLayouts| be a new [=list=].
10. Enqueue the following steps to |copyStepsQueue|:
7. Otherwise, if |options|.{{VideoFrameCopyToOptions/format}} is not `undefined` or `null`
throw a {{NotSupportedError}} {{DOMException}}.
8. Let |p| be a new {{Promise}}.
9. Let |copyStepsQueue| be the result of starting a new [=parallel queue=].
10. Let |planeLayouts| be a new [=list=].
11. Enqueue the following steps to |copyStepsQueue|:
1. Let resource be the [=media resource=] referenced by
[[resource reference]].
2. Let |numPlanes| be the number of planes as defined by
Expand Down Expand Up @@ -3818,7 +3819,7 @@
10. Increment |planeIndex| by `1`.
11. Append |layout| to |planeLayouts|.
5. [=Queue a task=] to resolve |p| with |planeLayouts|.
11. Return |p|.
12. Return |p|.

: <dfn method for=VideoFrame>clone()</dfn>
:: Creates a new {{VideoFrame}} with a reference to the same
Expand Down Expand Up @@ -4324,9 +4325,9 @@
invalid to specify planes that overlap.
: <dfn dict-member for=VideoFrameCopyToOptions>format</dfn>
:: A {{VideoPixelFormat}} for the pixel data in the destination
{{BufferSource}}. Potential values are:
{{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}} and values of {{VideoFrame/format}}.
If unspecified or `null`, the {{VideoFrame/format}} is used.
{{BufferSource}}. Potential values are: {{RGBA}}, {{RGBX}}, {{BGRA}},
{{BGRX}}. If unspecified or `null`, the the destination
{{BufferSource}} will match {{VideoFrame/format}} .
: <dfn dict-member for=VideoFrameCopyToOptions>colorSpace</dfn>
:: A {{PredefinedColorSpace}} that <em class="rfc2119">SHALL</em> be used as
a target color space for the pixel data in the destination
Expand Down

0 comments on commit b8ca480

Please sign in to comment.