Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add WebCodecsVideoFrame initial support for serialisation and transfer
https://bugs.webkit.org/show_bug.cgi?id=246854 rdar://problem/101425176 Reviewed by Eric Carlson. Introduce WebCodecsVideoFrameData which contains the necessary data to rebuild an equivalent WebCodecs video frame. Add support for serialization of video frames. This works for postMessaging to workers and for same-process MessageChannel but not cross process MessageChannel since encode/decode is not yet supported. Covered by Worker specific added test. Skipped new test in glib and wk1. * LayoutTests/http/wpt/webcodecs/videoFrame-serialization-expected.txt: Added. * LayoutTests/http/wpt/webcodecs/videoFrame-serialization.html: Added. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/video-frame-serialization.any-expected.txt: * LayoutTests/platform/glib/TestExpectations: * LayoutTests/platform/mac-wk1/TestExpectations: * Source/WebCore/Headers.cmake: * Source/WebCore/Modules/webcodecs/VideoColorSpace.h: (WebCore::VideoColorSpace::state const): * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.cpp: (WebCore::WebCodecsVideoFrame::WebCodecsVideoFrame): (WebCore::WebCodecsVideoFrame::create): (WebCore::WebCodecsVideoFrame::initializeFrameFromOtherFrame): (WebCore::WebCodecsVideoFrame::initializeFrameWithResourceAndSize): (WebCore::WebCodecsVideoFrame::allocationSize): (WebCore::WebCodecsVideoFrame::copyTo): (WebCore::WebCodecsVideoFrame::clone): (WebCore::WebCodecsVideoFrame::close): (WebCore::WebCodecsVideoFrame::codedRect const): (WebCore::WebCodecsVideoFrame::visibleRect const): (WebCore::WebCodecsVideoFrame::setDisplaySize): (WebCore::WebCodecsVideoFrame::setVisibleRect): (WebCore::WebCodecsVideoFrame::colorSpace const): * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.h: (WebCore::WebCodecsVideoFrame::create): (WebCore::WebCodecsVideoFrame::format const): (WebCore::WebCodecsVideoFrame::codedWidth const): (WebCore::WebCodecsVideoFrame::codedHeight const): (WebCore::WebCodecsVideoFrame::displayWidth const): (WebCore::WebCodecsVideoFrame::displayHeight const): (WebCore::WebCodecsVideoFrame::duration const): (WebCore::WebCodecsVideoFrame::timestamp const): (WebCore::WebCodecsVideoFrame::internalFrame const): (WebCore::WebCodecsVideoFrame::shoudlDiscardAlpha const): (WebCore::WebCodecsVideoFrame::data const): (WebCore::WebCodecsVideoFrame::colorSpace const): Deleted. * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.cpp: (WebCore::videoFramePickColorSpace): * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.h: * Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameData.h: Added. * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): (WebCore::CloneSerializer::CloneSerializer): (WebCore::CloneSerializer::dumpWebCodecsVideoFrame): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::readWebCodecsVideoFrame): (WebCore::CloneDeserializer::readTerminal): (WebCore::SerializedScriptValue::SerializedScriptValue): (WebCore::SerializedScriptValue::computeMemoryCost const): (WebCore::SerializedScriptValue::create): (WebCore::SerializedScriptValue::deserialize): * Source/WebCore/bindings/js/SerializedScriptValue.h: (WebCore::SerializedScriptValue::encode const): (WebCore::SerializedScriptValue::decode): Canonical link: https://commits.webkit.org/255949@main
- Loading branch information