forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use NativePromise for WebCodecs encode/decode/flush methods
https://bugs.webkit.org/show_bug.cgi?id=278909 rdar://135005637 Reviewed by Philippe Normand and Jean-Yves Avenard. We move all these methods to NativePromise as it is easier to read and is easier for maintenance. For instance, the NativePromises are wrapped via ScriptExecutionContext::enqueueTaskWhenSettled so that it is guaranteed for the callback to be executed and destroyed in the context thread. This will allow us to use ActiveDOMObject pending activities as part of these callbacks in a follow-up. Another step will be to migrate the create encoder/decoder methods to NativePromise as well. * Source/WebCore/Modules/webcodecs/WebCodecsAudioDecoder.cpp: (WebCore::WebCodecsAudioDecoder::decode): (WebCore::WebCodecsAudioDecoder::flush): (WebCore::WebCore::WebCodecsAudioDecoder::suspend): (WebCore::WebCodecsAudioDecoder::stop): * Source/WebCore/Modules/webcodecs/WebCodecsAudioEncoder.cpp: (WebCore::WebCodecsAudioEncoder::configure): (WebCore::WebCodecsAudioEncoder::encode): (WebCore::WebCodecsAudioEncoder::flush): (WebCore::WebCore::WebCodecsAudioEncoder::suspend): (WebCore::WebCodecsAudioEncoder::stop): * Source/WebCore/Modules/webcodecs/WebCodecsVideoDecoder.cpp: (WebCore::WebCodecsVideoDecoder::decode): (WebCore::WebCodecsVideoDecoder::flush): (WebCore::WebCore::WebCodecsVideoDecoder::suspend): (WebCore::WebCodecsVideoDecoder::stop): * Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.cpp: (WebCore::WebCodecsVideoEncoder::updateRates): (WebCore::WebCodecsVideoEncoder::configure): (WebCore::WebCodecsVideoEncoder::encode): (WebCore::WebCodecsVideoEncoder::flush): (WebCore::WebCore::WebCodecsVideoEncoder::suspend): (WebCore::WebCodecsVideoEncoder::stop): * Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.h: * Source/WebCore/platform/AudioDecoder.h: * Source/WebCore/platform/AudioEncoder.h: * Source/WebCore/platform/VideoDecoder.h: * Source/WebCore/platform/VideoEncoder.h: (WebCore::VideoEncoder::setRates): Deleted. * Source/WebCore/platform/audio/gstreamer/AudioDecoderGStreamer.cpp: (WebCore::GStreamerAudioDecoder::decode): (WebCore::GStreamerAudioDecoder::flush): (WebCore::GStreamerInternalAudioDecoder::GStreamerInternalAudioDecoder): (WebCore::GStreamerInternalAudioDecoder::decode): (WebCore::GStreamerInternalAudioDecoder::flush): * Source/WebCore/platform/audio/gstreamer/AudioDecoderGStreamer.h: * Source/WebCore/platform/audio/gstreamer/AudioEncoderGStreamer.cpp: (WebCore::GStreamerAudioEncoder::encode): (WebCore::GStreamerAudioEncoder::flush): (WebCore::GStreamerInternalAudioEncoder::GStreamerInternalAudioEncoder): (WebCore::GStreamerInternalAudioEncoder::flush): * Source/WebCore/platform/audio/gstreamer/AudioEncoderGStreamer.h: * Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::decodeSample): * Source/WebCore/platform/graphics/gstreamer/VideoDecoderGStreamer.cpp: (WebCore::GStreamerVideoDecoder::decode): (WebCore::GStreamerVideoDecoder::flush): (WebCore::GStreamerInternalVideoDecoder::decode): (WebCore::GStreamerInternalVideoDecoder::flush): * Source/WebCore/platform/graphics/gstreamer/VideoDecoderGStreamer.h: * Source/WebCore/platform/graphics/gstreamer/VideoEncoderGStreamer.cpp: (WebCore::GStreamerInternalVideoEncoder::create): (WebCore::GStreamerVideoEncoder::create): (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder): (WebCore::GStreamerVideoEncoder::encode): (WebCore::GStreamerVideoEncoder::flush): (WebCore::GStreamerVideoEncoder::setRates): (WebCore::GStreamerInternalVideoEncoder::GStreamerInternalVideoEncoder): (WebCore::GStreamerInternalVideoEncoder::initialize): (WebCore::GStreamerInternalVideoEncoder::setRates): (WebCore::GStreamerInternalVideoEncoder::applyRates): (WebCore::GStreamerInternalVideoEncoder::flush): * Source/WebCore/platform/graphics/gstreamer/VideoEncoderGStreamer.h: * Source/WebCore/platform/libwebrtc/LibWebRTCVPXVideoDecoder.cpp: (WebCore::LibWebRTCVPXVideoDecoder::decode): (WebCore::LibWebRTCVPXVideoDecoder::flush): (WebCore::LibWebRTCVPXInternalVideoDecoder::decode): * Source/WebCore/platform/libwebrtc/LibWebRTCVPXVideoDecoder.h: * Source/WebCore/platform/libwebrtc/LibWebRTCVPXVideoEncoder.cpp: (WebCore::LibWebRTCVPXVideoEncoder::encode): (WebCore::LibWebRTCVPXVideoEncoder::flush): (WebCore::LibWebRTCVPXVideoEncoder::setRates): (WebCore::LibWebRTCVPXInternalVideoEncoder::encode): * Source/WebCore/platform/libwebrtc/LibWebRTCVPXVideoEncoder.h: * Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in: * Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: (WebKit::LibWebRTCCodecsProxy::flushDecoder): (WebKit::LibWebRTCCodecsProxy::setEncodeRates): * Source/WebKit/WebProcess/GPU/media/RemoteVideoCodecFactory.cpp: (WebKit::RemoteVideoDecoder::decode): (WebKit::RemoteVideoDecoder::flush): (WebKit::RemoteVideoEncoder::encode): (WebKit::RemoteVideoEncoder::setRates): (WebKit::RemoteVideoEncoder::flush): * Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: (WebKit::decodeVideoFrame): (WebKit::LibWebRTCCodecs::flushDecoder): (WebKit::LibWebRTCCodecs::sendFrameToDecode): (WebKit::LibWebRTCCodecs::decodeWebRTCFrame): (WebKit::LibWebRTCCodecs::decodeFrame): (WebKit::LibWebRTCCodecs::decodeFrameInternal): (WebKit::LibWebRTCCodecs::encodeFrameInternal): (WebKit::LibWebRTCCodecs::encodeFrame): (WebKit::LibWebRTCCodecs::flushEncoder): (WebKit::LibWebRTCCodecs::setEncodeRates): (WebKit::LibWebRTCCodecs::gpuProcessConnectionDidClose): (WebKit::LibWebRTCCodecs::setDecoderConnection): (WebKit::LibWebRTCCodecs::flushDecoderCompleted): Deleted. * Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.h: * Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in: Canonical link: https://commits.webkit.org/283145@main
- Loading branch information
Showing
29 changed files
with
370 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.