-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cocoa] Remote video codecs should surface any error happening during encoding to web pages #20876
Conversation
EWS run on previous version of this PR (hash 88a81df) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me once the bots are hapoy
...ce/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm
Outdated
Show resolved
Hide resolved
88a81df
to
9759b7c
Compare
EWS run on previous version of this PR (hash 9759b7c) |
9759b7c
to
bb427b8
Compare
EWS run on previous version of this PR (hash bb427b8) |
bb427b8
to
c21b3f1
Compare
EWS run on previous version of this PR (hash c21b3f1) |
c21b3f1
to
eb64486
Compare
EWS run on current version of this PR (hash eb64486) |
β¦ encoding to web pages https://bugs.webkit.org/show_bug.cgi?id=265307 rdar://118770776 Reviewed by Eric Carlson. We were not exposing the encoder errors to JavaScript, while the spec asks us to do so. We add to H264 and HEVC encoders a way to be notified of any error, and update the code so that, either the success or error callback is called for every encoding task. We update LibWebRTCCodecs to make encoding and flush IPC messages with a response handler. This allows to call the WebCodecs encoding task completion handler with the result of the encoding task. We use NativePromise for both as a convenience and we make sure that the order of messages is guaranteed. Covered by a new test which triggers an encoding error by using a low H264 encoding level with large video frames. This should in theory be handled at configure step but we are not yet checking precisely enough this. When we do this, we will need to change the test and it will probably be pass for all platforms as the checking code might be in WebKit and not below. This test is only passing in Sonoma since below, the underlying encoder is not triggering an encoding error. * LayoutTests/TestExpectations: * LayoutTests/http/wpt/webcodecs/encoder-task-failing-expected.txt: Added. * LayoutTests/http/wpt/webcodecs/encoder-task-failing.html: Added. * LayoutTests/platform/mac-wk2/TestExpectations: * Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp: * Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitEncoder.h: * Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (-[WK_RTCLocalVideoH264H265Encoder setErrorCallback:]): (webrtc::createLocalEncoder): * Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/base/RTCVideoEncoder.h: * Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.h: * Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm: (-[RTCVideoEncoderH264 setErrorCallback:]): (-[RTCVideoEncoderH264 encode:codecSpecificInfo:frameTypes:]): (-[RTCVideoEncoderH264 frameWasEncoded:flags:sampleBuffer:codecSpecificInfo:width:height:renderTimeMs:timestamp:duration:rotation:isKeyFrameRequired:]): * Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH265.h: * Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH265.mm: (-[RTCVideoEncoderH265 setErrorCallback:]): (-[RTCVideoEncoderH265 encode:codecSpecificInfo:frameTypes:]): (-[RTCVideoEncoderH265 frameWasEncoded:flags:sampleBuffer:width:height:renderTimeMs:timestamp:rotation:]): * Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in: * Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: (WebKit::LibWebRTCCodecsProxy::createEncoder): (WebKit::LibWebRTCCodecsProxy::encodeFrame): (WebKit::LibWebRTCCodecsProxy::notifyEncoderResult): (WebKit::LibWebRTCCodecsProxy::flushEncoder): * Source/WebKit/WebProcess/GPU/media/RemoteVideoCodecFactory.cpp: (WebKit::RemoteVideoEncoderCallbacks::close): (WebKit::RemoteVideoEncoder::encode): (WebKit::RemoteVideoEncoderCallbacks::notifyEncodedChunk): (WebKit::RemoteVideoEncoderCallbacks::addDuration): Deleted. * Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: (WebKit::LibWebRTCCodecs::encodeFrameInternal): (WebKit::LibWebRTCCodecs::encodeFrame): (WebKit::LibWebRTCCodecs::flushEncoder): (WebKit::LibWebRTCCodecs::flushEncoderCompleted): Deleted. * Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.h: * Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in: Canonical link: https://commits.webkit.org/271377@main
eb64486
to
279e75f
Compare
Committed 271377@main (279e75f): https://commits.webkit.org/271377@main Reviewed commits have been landed. Closing PR #20876 and removing active labels. |
β¦odecs are a constant failure https://bugs.webkit.org/show_bug.cgi?id=265483 rdar://118901410 Reviewed by Jean-Yves Avenard. x86_64 VTB encoder does not like some low resolutions, increase to 200x200 to handle this correctly.. In the future, WebKit#20876 will surface such errors instead of silently failing. * LayoutTests/http/wpt/webcodecs/h264-encoder-default-config.https.any.js: (async encoderTest): Canonical link: https://commits.webkit.org/271464@main
279e75f
eb64486
π§ͺ wpe-wk2π§ͺ ios-wk2-wpt