Skip to content

Commit 441d96c

Browse files
committed
Resolve VideoFrame.copyTo with the list of layout
This fixes w3c#510.
1 parent 3c9e353 commit 441d96c

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
@@ -3744,7 +3744,8 @@
37443744
{{TypeError}}.
37453745
6. Let |p| be a new {{Promise}}.
37463746
7. Let |copyStepsQueue| be the result of starting a new [=parallel queue=].
3747-
8. Enqueue the following steps to |copyStepsQueue|:
3747+
8. Let |planeLayouts| be a new [=list=].
3748+
9. Enqueue the following steps to |copyStepsQueue|:
37483749
1. Let resource be the [=media resource=] referenced by
37493750
[[resource reference]].
37503751
2. Let |numPlanes| be the number of planes as defined by
@@ -3760,13 +3761,16 @@
37603761
|computedLayout|'s [=computed plane layout/sourceTop=] by
37613762
|sourceStride|
37623763
4. Add |computedLayout|'s [=computed plane layout/sourceLeftBytes=]
3763-
to sourceOffset.
3764+
to |sourceOffset|.
37643765
5. Let |destinationOffset| be |computedLayout|'s
37653766
[=computed plane layout/destinationOffset=].
37663767
6. Let |rowBytes| be |computedLayout|'s
37673768
[=computed plane layout/sourceWidthBytes=].
3768-
7. Let |row| be `0`.
3769-
8. While |row| is less than |computedLayout|'s
3769+
7. Let |layout| be a new {{PlaneLayout}}, with
3770+
{{PlaneLayout/offset}} set to |destinationOffset| and
3771+
{{PlaneLayout/stride}} set to |rowBytes|.
3772+
8. Let |row| be `0`.
3773+
9. While |row| is less than |computedLayout|'s
37703774
[=computed plane layout/sourceHeight=]:
37713775
1. Copy |rowBytes| bytes from |resource| starting at
37723776
|sourceOffset| to |destination| starting at
@@ -3775,9 +3779,10 @@
37753779
3. Increment |destinationOffset| by |computedLayout|'s
37763780
[=computed plane layout/destinationStride=].
37773781
4. Increment |row| by `1`.
3778-
9. Increment |planeIndex| by `1`.
3779-
5. [=Queue a task=] to resolve |p|.
3780-
9. Return |p|.
3782+
10. Increment |planeIndex| by `1`.
3783+
11. Append |layout| to |planeLayouts|.
3784+
5. [=Queue a task=] to resolve |p| with |planeLayouts|.
3785+
10. Return |p|.
37813786

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

0 commit comments

Comments
 (0)