[webkit-changes] [WebKit/WebKit] 5d0f36: Add initial implementation to VideoFrame

youennf noreply at github.com
Fri Oct 7 02:07:12 PDT 2022


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

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoDecoder-codec-specific.https.any.worker_vp8-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoDecoder-codec-specific.https.any.worker_vp9-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoDecoder-codec-specific.https.any_vp8-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoDecoder-codec-specific.https.any_vp9-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.any-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.any.worker-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.crossOriginIsolated.https.any-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.crossOriginIsolated.https.any.worker-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.window-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo.any-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo.any.worker-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo.crossOriginIsolated.https.any-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo.crossOriginIsolated.https.any.worker-expected.txt
    M Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp
    M Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp
    M Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp
    M Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.h
    M Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.mm
    M Source/WebCore/Headers.cmake
    R Source/WebCore/Modules/webcodecs/PlaneLayout.h
    R Source/WebCore/Modules/webcodecs/VideoPixelFormat.h
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoDecoder.cpp
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.cpp
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.h
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.idl
    A Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.cpp
    A Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.h
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    A Source/WebCore/platform/PlaneLayout.h
    M Source/WebCore/platform/VideoFrame.cpp
    M Source/WebCore/platform/VideoFrame.h
    A Source/WebCore/platform/VideoPixelFormat.cpp
    A Source/WebCore/platform/VideoPixelFormat.h
    M Source/WebCore/platform/graphics/cv/VideoFrameCV.mm
    M Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCDTMFSenderBackend.h

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




More information about the webkit-changes mailing list