Skip to content

Commit 072c8e5

Browse files
authored
Merge pull request w3c#738 from w3c/510-resolve-planes
Resolve VideoFrame.copyTo with the list of layout
2 parents 58270fa + 441d96c commit 072c8e5

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

index.src.html

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3749,7 +3749,8 @@
37493749
{{TypeError}}.
37503750
6. Let |p| be a new {{Promise}}.
37513751
7. Let |copyStepsQueue| be the result of starting a new [=parallel queue=].
3752-
8. Enqueue the following steps to |copyStepsQueue|:
3752+
8. Let |planeLayouts| be a new [=list=].
3753+
9. Enqueue the following steps to |copyStepsQueue|:
37533754
1. Let resource be the [=media resource=] referenced by
37543755
[[resource reference]].
37553756
2. Let |numPlanes| be the number of planes as defined by
@@ -3765,13 +3766,16 @@
37653766
|computedLayout|'s [=computed plane layout/sourceTop=] by
37663767
|sourceStride|
37673768
4. Add |computedLayout|'s [=computed plane layout/sourceLeftBytes=]
3768-
to sourceOffset.
3769+
to |sourceOffset|.
37693770
5. Let |destinationOffset| be |computedLayout|'s
37703771
[=computed plane layout/destinationOffset=].
37713772
6. Let |rowBytes| be |computedLayout|'s
37723773
[=computed plane layout/sourceWidthBytes=].
3773-
7. Let |row| be `0`.
3774-
8. While |row| is less than |computedLayout|'s
3774+
7. Let |layout| be a new {{PlaneLayout}}, with
3775+
{{PlaneLayout/offset}} set to |destinationOffset| and
3776+
{{PlaneLayout/stride}} set to |rowBytes|.
3777+
8. Let |row| be `0`.
3778+
9. While |row| is less than |computedLayout|'s
37753779
[=computed plane layout/sourceHeight=]:
37763780
1. Copy |rowBytes| bytes from |resource| starting at
37773781
|sourceOffset| to |destination| starting at
@@ -3780,9 +3784,10 @@
37803784
3. Increment |destinationOffset| by |computedLayout|'s
37813785
[=computed plane layout/destinationStride=].
37823786
4. Increment |row| by `1`.
3783-
9. Increment |planeIndex| by `1`.
3784-
5. [=Queue a task=] to resolve |p|.
3785-
9. Return |p|.
3787+
10. Increment |planeIndex| by `1`.
3788+
11. Append |layout| to |planeLayouts|.
3789+
5. [=Queue a task=] to resolve |p| with |planeLayouts|.
3790+
10. Return |p|.
37863791

37873792
: <dfn method for=VideoFrame>clone()</dfn>
37883793
:: Creates a new {{VideoFrame}} with a reference to the same

0 commit comments

Comments
 (0)