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
Add initial implementation to VideoFrame
https://bugs.webkit.org/show_bug.cgi?id=245824 rdar://problem/100557159 Reviewed by Eric Carlson. Add initial implementation of VideoFrame. In particular we add constructors and start supporting NV12, RGBA, BGRA. We also support I420 (using NV12 as the backend on iOS/macOS). Covered by rebased tests. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoDecoder-codec-specific.https.any.worker_vp8-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoDecoder-codec-specific.https.any.worker_vp9-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoDecoder-codec-specific.https.any_vp8-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoDecoder-codec-specific.https.any_vp9-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.crossOriginIsolated.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.crossOriginIsolated.https.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.window-expected.txt: * 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/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: * Source/WebCore/Headers.cmake: * Source/WebCore/Modules/webcodecs/WebCodecsVideoDecoder.cpp: (WebCore::WebCodecsVideoDecoder::configure): * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.cpp: (WebCore::checkImageUsability): (WebCore::WebCodecsVideoFrame::create): (WebCore::WebCodecsVideoFrame::initializeFrameFromOtherFrame): (WebCore::WebCodecsVideoFrame::initializeFrameWithResourceAndSize): (WebCore::WebCodecsVideoFrame::allocationSize): (WebCore::WebCodecsVideoFrame::copyTo): (WebCore::WebCodecsVideoFrame::setDisplaySize): (WebCore::WebCodecsVideoFrame::setVisibleRect): * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.h: * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.idl: * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.cpp: Added. (WebCore::isValidVideoFrameBufferInit): (WebCore::verifyRectOffsetAlignment): (WebCore::verifyRectSizeAlignment): (WebCore::parseVisibleRect): (WebCore::videoPixelFormatToPlaneCount): (WebCore::videoPixelFormatToSampleByteSizePerPlane): (WebCore::videoPixelFormatToSubSampling): (WebCore::computeLayoutAndAllocationSize): (WebCore::parseVideoFrameCopyToOptions): (WebCore::initializeVisibleRectAndDisplaySize): (WebCore::videoFramePickColorSpace): * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.h: Added. * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/platform/PlaneLayout.h: Added. * Source/WebCore/platform/VideoFrame.cpp: (WebCore::VideoFrame::fromNativeImage): (WebCore::VideoFrame::createNV12): (WebCore::VideoFrame::createRGBA): (WebCore::VideoFrame::createBGRA): (WebCore::VideoFrame::createI420): (WebCore::VideoFrame::copyTo): * Source/WebCore/platform/VideoFrame.h: * Source/WebCore/platform/VideoPixelFormat.cpp: Added. (WebCore::convertVideoFramePixelFormat): * Source/WebCore/platform/VideoPixelFormat.h: Added. (WebCore::isRGBVideoPixelFormat): * Source/WebCore/platform/graphics/cv/VideoFrameCV.mm: * Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCDTMFSenderBackend.h: * Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: Canonical link: https://commits.webkit.org/255259@main
- Loading branch information
Showing
34 changed files
with
1,125 additions
and
100 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
FAIL Test SharedArrayBuffer constructed I420 VideoFrame assert_equals: plane format expected (string) "I420" but got (object) null | ||
FAIL Test Uint8Array(SharedArrayBuffer) constructed I420 VideoFrame assert_equals: plane format expected (string) "I420" but got (object) null | ||
PASS Test SharedArrayBuffer constructed I420 VideoFrame | ||
PASS Test Uint8Array(SharedArrayBuffer) constructed I420 VideoFrame | ||
|
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 SharedArrayBuffer constructed I420 VideoFrame assert_equals: plane format expected (string) "I420" but got (object) null | ||
FAIL Test Uint8Array(SharedArrayBuffer) constructed I420 VideoFrame assert_equals: plane format expected (string) "I420" but got (object) null | ||
PASS Test SharedArrayBuffer constructed I420 VideoFrame | ||
PASS Test Uint8Array(SharedArrayBuffer) constructed I420 VideoFrame | ||
|
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,7 +1,7 @@ | ||
|
||
Harness Error (TIMEOUT), message = null | ||
|
||
FAIL Test that timestamp is required when constructing VideoFrame from HTMLImageElement assert_throws_js: timestamp required to construct VideoFrame from this source function "() => new VideoFrame(imageSource)" did not throw | ||
PASS Test that timestamp is required when constructing VideoFrame from HTMLImageElement | ||
TIMEOUT Test that timestamp is required when constructing VideoFrame from SVGImageElement Test timed out | ||
NOTRUN Test that timeamp is required when constructing VideoFrame from HTMLCanvasElement | ||
|
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.