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
Implement RTC VTB decoders in GPUProcess
https://bugs.webkit.org/show_bug.cgi?id=205607 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Expose remote decoder abilities with C like functions. This allows WebProcess to implement IPC-based decoders. Expose VTB H264 decoder as C like functions. This allows GPU process to instantiate wasily H2664 decoders. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: (webrtc::videoDecoderCallbacks): (webrtc::setVideoDecoderCallbacks): (webrtc::RemoteVideoDecoder::RemoteVideoDecoder): (webrtc::RemoteVideoDecoder::decodeComplete): (webrtc::RemoteVideoDecoder::InitDecode): (webrtc::RemoteVideoDecoder::Decode): (webrtc::RemoteVideoDecoder::RegisterDecodeCompleteCallback): (webrtc::RemoteVideoDecoder::Release): (webrtc::RemoteVideoDecoderFactory::RemoteVideoDecoderFactory): (webrtc::RemoteVideoDecoderFactory::GetSupportedFormats const): (webrtc::RemoteVideoDecoderFactory::CreateVideoDecoder): (webrtc::createWebKitDecoderFactory): (webrtc::createLocalDecoder): (webrtc::releaseLocalDecoder): (webrtc::decodeFrame): * Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH264.h: * Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm: (-[RTCVideoDecoderH264 decode:missingFrames:codecSpecificInfo:renderTimeMs:]): (-[RTCVideoDecoderH264 decodeData:size:timeStamp:]): Source/WebCore: Add routine to create a RemoveVideoSample from a pixel buffer. Update LibWebRTCProvider to enable/disable decoding in GPU Process and add internals API. Test: webrtc/video-gpuProcess.html * platform/graphics/RemoteVideoSample.cpp: (WebCore::RemoteVideoSample::create): * platform/graphics/RemoteVideoSample.h: * platform/graphics/cv/ImageTransferSessionVT.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::setUseGPUProcess): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setUseGPUProcessForWebRTC): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: Implement decoder factory callbacks. Implement WebProcess codecs by sending IPC for creating/releasing/decoding a frame. WebProcess receives IPC messages from GPU Process whenever a frame is decoded. * Configurations/WebKit.xcconfig: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::libWebRTCCodecsProxy): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: Added. (WebKit::LibWebRTCCodecsProxy::didReceiveMessageFromWebProcess): * GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in: Added. * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: Added. (WebKit::LibWebRTCCodecsProxy::LibWebRTCCodecsProxy): (WebKit::LibWebRTCCodecsProxy::~LibWebRTCCodecsProxy): (WebKit::LibWebRTCCodecsProxy::createDecoder): (WebKit::LibWebRTCCodecsProxy::releaseDecoder): (WebKit::LibWebRTCCodecsProxy::decodeFrame): * Scripts/webkit/messages.py: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/GPUProcessConnection.cpp: (WebKit::GPUProcessConnection::didReceiveMessage): * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: Added. (WebKit::createVideoDecoder): (WebKit::releaseVideoDecoder): (WebKit::decodeVideoFrame): (WebKit::registerDecodeCompleteCallback): (WebKit::LibWebRTCCodecs::setVideoDecoderCallbacks): (WebKit::LibWebRTCCodecs::createDecoder): (WebKit::LibWebRTCCodecs::releaseDecoder): (WebKit::LibWebRTCCodecs::decodeFrame): (WebKit::LibWebRTCCodecs::registerDecodeFrameCallback): (WebKit::LibWebRTCCodecs::failedDecoding): (WebKit::LibWebRTCCodecs::completedDecoding): * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: Added. * WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in: Added. * WebProcess/GPU/webrtc/RTCDecoderIdentifier.h: Added. * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::LibWebRTCProvider::createDecoderFactory): * WebProcess/Network/webrtc/LibWebRTCProvider.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::libWebRTCCodecs): * WebProcess/WebProcess.h: LayoutTests: * webrtc/video-gpuProcess-expected.txt: Added. * webrtc/video-gpuProcess.html: Added. Canonical link: https://commits.webkit.org/218833@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information