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 copyTo
https://bugs.webkit.org/show_bug.cgi?id=246210 rdar://problem/100893780 Reviewed by Eric Carlson. Add support for copyTo for RGB, NV12 and I420 formats for macOS/iOS ports. Make use of libyuv for I420 and direct copy for RGB and NV12. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo.any.js: (makeNV12_4x2): (promise_test.async t): * 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/ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp: * Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp: * Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp: * Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.mm: (webrtc::copyI420BufferToPixelBuffer): (webrtc::pixelBufferFromI420Buffer): (webrtc::copyPixelBufferInI420Buffer): (webrtc::copyBufferToPixelBuffer): Deleted. * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.cpp: (WebCore::sampleCountPerPixel): (WebCore::computeLayoutAndAllocationSize): * Source/WebCore/platform/graphics/cv/VideoFrameCV.mm: (WebCore::VideoFrame::createRGBA): (WebCore::VideoFrame::createI420): (WebCore::copyRGBData): (WebCore::copyNV12): (WebCore::VideoFrame::copyTo): Canonical link: https://commits.webkit.org/255429@main
- Loading branch information
Showing
12 changed files
with
239 additions
and
91 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,18 @@ | ||
|
||
PASS Test closed frame. | ||
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 copying I420 frame to a non-shared ArrayBuffer | ||
PASS Test copying I420 frame to a non-shared ArrayBufferView | ||
PASS Test RGBA frame. | ||
PASS Test NV12 frame. | ||
PASS Test undersized buffer. | ||
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 stride and offset work. | ||
PASS Test stride and offset with padding. | ||
PASS Test invalid stride. | ||
PASS Test address overflow. | ||
FAIL Test codedRect. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
PASS Test codedRect. | ||
PASS Test empty rect. | ||
PASS Test unaligned rect. | ||
FAIL Test left crop. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
FAIL Test left crop. assert_equals: buffer contents at index 0 expected 3 but got 1 | ||
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
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,18 @@ | ||
|
||
PASS Test closed frame. | ||
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 copying I420 frame to a non-shared ArrayBuffer | ||
PASS Test copying I420 frame to a non-shared ArrayBufferView | ||
PASS Test RGBA frame. | ||
PASS Test NV12 frame. | ||
PASS Test undersized buffer. | ||
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 stride and offset work. | ||
PASS Test stride and offset with padding. | ||
PASS Test invalid stride. | ||
PASS Test address overflow. | ||
FAIL Test codedRect. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
PASS Test codedRect. | ||
PASS Test empty rect. | ||
PASS Test unaligned rect. | ||
FAIL Test left crop. promise_test: Unhandled rejection with value: object "TypeError: Unable to copy data" | ||
FAIL Test left crop. assert_equals: buffer contents at index 0 expected 3 but got 1 | ||
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. 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" | ||
PASS Test copying I420 frame to SharedArrayBuffer. | ||
PASS Test copying I420 frame to shared ArrayBufferView. | ||
|
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. 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" | ||
PASS Test copying I420 frame to SharedArrayBuffer. | ||
PASS Test copying I420 frame to shared ArrayBufferView. | ||
|
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
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
Oops, something went wrong.