[webkit-changes] [WebKit/WebKit] ededdc: [WebGPU] Support VideoFrame as the source of GPUEx...

mwyrzykowski noreply at github.com
Fri Jun 2 19:53:26 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ededdcafd115f57ac989263d6247eb55ef7cd614
      https://github.com/WebKit/WebKit/commit/ededdcafd115f57ac989263d6247eb55ef7cd614
  Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
  Date:   2023-06-02 (Fri, 02 Jun 2023)

  Changed paths:
    M Source/WebCore/Modules/WebGPU/GPUExternalTextureDescriptor.h
    M Source/WebCore/Modules/WebGPU/GPUExternalTextureDescriptor.idl
    M Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.cpp
    M Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUExternalTextureDescriptor.h
    M Source/WebCore/platform/VideoFrame.h
    M Source/WebCore/platform/VideoPixelFormat.cpp
    M Source/WebGPU/WebGPU/BindGroup.mm
    M Source/WebGPU/WebGPU/Device.mm
    M Source/WebGPU/WebGPU/ExternalTexture.h
    M Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp
    M Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.cpp
    M Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.h
    M Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.messages.in
    M Source/WebKit/GPUProcess/graphics/WebGPU/RemoteGPU.h
    M Source/WebKit/Scripts/webkit/messages.py
    M Source/WebKit/Shared/WebGPU/WebGPUExternalTextureDescriptor.cpp
    M Source/WebKit/Shared/WebGPU/WebGPUExternalTextureDescriptor.h
    M Source/WebKit/Shared/WebGPU/WebGPUExternalTextureDescriptor.serialization.in
    M Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.cpp
    M Source/WebKit/WebProcess/GPU/media/RemoteVideoFrameProxy.cpp
    M Source/WebKit/WebProcess/GPU/media/RemoteVideoFrameProxy.h

  Log Message:
  -----------
  [WebGPU] Support VideoFrame as the source of GPUExternalTexture
https://bugs.webkit.org/show_bug.cgi?id=256875
<radar://109442655>

Reviewed by Myles C. Maxfield.

Support VideoFrame as the source of a GPUExternalTexture.

* Source/WebCore/Modules/WebGPU/GPUExternalTextureDescriptor.h:
(WebCore::GPUExternalTextureDescriptor::mediaIdentifierForSource):
(WebCore::GPUExternalTextureDescriptor::convertToBacking const):
* Source/WebCore/Modules/WebGPU/GPUExternalTextureDescriptor.idl:
* Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUExternalTextureDescriptor.h:
(PAL::WebGPU::HTMLVideoElementIdentifier::HTMLVideoElementIdentifier):
(PAL::WebGPU::WebCodecsVideoFrameIdentifier::WebCodecsVideoFrameIdentifier):
Support either HTMLVideoElement or WebCodecsVideoFrame as the source of a GPUExternalTexture.

* Source/WebCore/platform/VideoFrame.h:
(WebCore::VideoFrame::resourceIdentifierVector const):
Default implementation returns and empty byte vector.

* Source/WebCore/platform/VideoPixelFormat.cpp:
(WebCore::convertVideoFramePixelFormat):
Allow kCVPixelFormatType_Lossless_420YpCbCr8BiPlanarVideoRange formats.

* Source/WebGPU/WebGPU/ExternalTexture.h:
(WebGPU::ExternalTexture::pixelBuffer const):
Retain the CVPixelBuffer which wasn't previously occurring.

* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::createRemoteGPU):
Update the lambda to work with HTMLVideoElements and VideoFrames as inputs.

* Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.cpp:
(WebKit::populateConvertedDescriptor):
(WebKit::RemoteDevice::importExternalTexture):
Support HTMLVideoElements and VideoFrames as inputs.

* Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.h:
* Source/WebKit/GPUProcess/graphics/WebGPU/RemoteGPU.h:

* Source/WebKit/Scripts/webkit/messages.py:
(headers_for_type):
* Source/WebKit/Shared/WebGPU/WebGPUExternalTextureDescriptor.cpp:
(WebKit::WebGPU::ConvertToBackingContext::convertToBacking):
(WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking):
PAL and WebCore representations are nearly identical.

* Source/WebKit/Shared/WebGPU/WebGPUExternalTextureDescriptor.h:
* Source/WebKit/Shared/WebGPU/WebGPUExternalTextureDescriptor.serialization.in:
* Source/WebKit/WebProcess/GPU/media/RemoteVideoFrameProxy.cpp:
(WebKit::RemoteVideoFrameProxy::resourceIdentifierVector const):
Encode the readRefrence into a byte-vector.

* Source/WebKit/WebProcess/GPU/media/RemoteVideoFrameProxy.h:

Canonical link: https://commits.webkit.org/264847@main




More information about the webkit-changes mailing list