[webkit-changes] [WebKit/WebKit] e813fe: Add WebCodecsVideoFrame initial support for serial...

youennf noreply at github.com
Tue Oct 25 03:14:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e813fe5c61f40e29f9f9d28a465224f05ae088ae
      https://github.com/WebKit/WebKit/commit/e813fe5c61f40e29f9f9d28a465224f05ae088ae
  Author: Youenn Fablet <youennf at gmail.com>
  Date:   2022-10-25 (Tue, 25 Oct 2022)

  Changed paths:
    A LayoutTests/http/wpt/webcodecs/videoFrame-serialization-expected.txt
    A LayoutTests/http/wpt/webcodecs/videoFrame-serialization.html
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/video-frame-serialization.any-expected.txt
    M LayoutTests/platform/glib/TestExpectations
    M LayoutTests/platform/mac-wk1/TestExpectations
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Modules/webcodecs/VideoColorSpace.h
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.cpp
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.h
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.cpp
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.h
    A Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameData.h
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/bindings/js/SerializedScriptValue.cpp
    M Source/WebCore/bindings/js/SerializedScriptValue.h

  Log Message:
  -----------
  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




More information about the webkit-changes mailing list