Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Implement WebCodecs VideoFrame allocationSize
https://bugs.webkit.org/show_bug.cgi?id=246209 rdar://problem/100893685 Reviewed by Eric Carlson. Make CopyToOptions optionals so that they work with current algorithms. Implement allocationSize by calling existing parseVideoFrameCopyToOptions function. Update the allocation size to account for RGB formats which have 4 samples per pixel. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo.crossOriginIsolated.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo.crossOriginIsolated.https.any.worker-expected.txt: * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.cpp: (WebCore::WebCodecsVideoFrame::allocationSize): * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.h: * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.cpp: (WebCore::parseVisibleRect): (WebCore::sampleCountPerPixel): (WebCore::computeLayoutAndAllocationSize): (WebCore::parseVideoFrameCopyToOptions): * Source/WebCore/platform/graphics/cv/VideoFrameCV.mm: (WebCore::VideoFrame::copyTo): Canonical link: https://commits.webkit.org/255313@main
- Loading branch information
Showing
8 changed files
with
65 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
|
||
PASS Test closed frame. | ||
FAIL Test copying I420 frame to a non-shared ArrayBuffer assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test copying I420 frame to a non-shared ArrayBufferView assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test RGBA frame. assert_equals: allocationSize() expected 16 but got 0 | ||
FAIL Test copying I420 frame to a non-shared ArrayBuffer promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
FAIL Test copying I420 frame to a non-shared ArrayBufferView promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
FAIL Test RGBA frame. assert_object_equals: plane 0 layout property "stride" expected 8 got 0 | ||
PASS Test undersized buffer. | ||
FAIL Test incorrect plane count. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
FAIL Test stride and offset work. assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test stride and offset with padding. assert_equals: allocationSize() expected 19 but got 0 | ||
FAIL Test invalid stride. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
PASS Test incorrect plane count. | ||
FAIL Test stride and offset work. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
FAIL Test stride and offset with padding. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
PASS Test invalid stride. | ||
FAIL Test address overflow. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
FAIL Test codedRect. assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test empty rect. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
FAIL Test unaligned rect. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
FAIL Test left crop. assert_equals: allocationSize() expected 6 but got 0 | ||
FAIL Test invalid rect. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
FAIL Test codedRect. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
PASS Test empty rect. | ||
PASS Test unaligned rect. | ||
FAIL Test left crop. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
PASS Test invalid rect. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
|
||
PASS Test closed frame. | ||
FAIL Test copying I420 frame to a non-shared ArrayBuffer assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test copying I420 frame to a non-shared ArrayBufferView assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test RGBA frame. assert_equals: allocationSize() expected 16 but got 0 | ||
FAIL Test copying I420 frame to a non-shared ArrayBuffer promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
FAIL Test copying I420 frame to a non-shared ArrayBufferView promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
FAIL Test RGBA frame. assert_object_equals: plane 0 layout property "stride" expected 8 got 0 | ||
PASS Test undersized buffer. | ||
FAIL Test incorrect plane count. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
FAIL Test stride and offset work. assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test stride and offset with padding. assert_equals: allocationSize() expected 19 but got 0 | ||
FAIL Test invalid stride. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
PASS Test incorrect plane count. | ||
FAIL Test stride and offset work. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
FAIL Test stride and offset with padding. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
PASS Test invalid stride. | ||
FAIL Test address overflow. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
FAIL Test codedRect. assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test empty rect. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
FAIL Test unaligned rect. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
FAIL Test left crop. assert_equals: allocationSize() expected 6 but got 0 | ||
FAIL Test invalid rect. assert_throws_js: function "() => frame.allocationSize(options)" did not throw | ||
FAIL Test codedRect. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
PASS Test empty rect. | ||
PASS Test unaligned rect. | ||
FAIL Test left crop. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
PASS Test invalid rect. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
FAIL Test copying I420 frame to SharedArrayBuffer. assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test copying I420 frame to shared ArrayBufferView. assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test copying I420 frame to SharedArrayBuffer. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
FAIL Test copying I420 frame to shared ArrayBufferView. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
FAIL Test copying I420 frame to SharedArrayBuffer. assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test copying I420 frame to shared ArrayBufferView. assert_equals: allocationSize() expected 12 but got 0 | ||
FAIL Test copying I420 frame to SharedArrayBuffer. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
FAIL Test copying I420 frame to shared ArrayBufferView. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters