[webkit-changes] [WebKit/WebKit] 2aac5e: RemoteVideoDecoder::decode callback should be exec...
youennf
noreply at github.com
Tue Aug 27 01:59:48 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2aac5e612cb7258dd1064ffabec63d24eb319a48
https://github.com/WebKit/WebKit/commit/2aac5e612cb7258dd1064ffabec63d24eb319a48
Author: Youenn Fablet <youenn at apple.com>
Date: 2024-08-27 (Tue, 27 Aug 2024)
Changed paths:
M Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.h
M Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in
M Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.mm
M Source/WebKit/WebProcess/GPU/media/RemoteVideoCodecFactory.cpp
M Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp
M Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.h
Log Message:
-----------
RemoteVideoDecoder::decode callback should be executed once the decoding task is submitted to the remote decoder
rdar://131676522
https://bugs.webkit.org/show_bug.cgi?id=278653
Reviewed by Ryan Reno.
WebCodecsVideoDecoder is taking a pending activity everytime it calls RemoteVideoDecoder::decode.
The intent is to prevent the output callback to get collected.
This works fine if the output callback is called before the completion handler given to RemoteVideoDecoder::decode.
Before the patch, RemoteVideoDecoder::decode would call the callback synchronously, defeating the output callback GC protection.
On GPU process, we call the decode callback anytime we get a new video frame, or if a decoding error happens.
The one case that is not well handled currently is if the reorder size is above 0.
In that case, we may end up with frames in the reorder queue, thus decode callbacks not being called.
This might trigger a leak if the JS is not either flushing or providing a key frame.
We will work on this in a further patch, as it requires some additional refactoring (to move reordering from libwebrtc to WebKit code in particular).
Covered by imported/w3c/web-platform-tests/webcodecs/videoDecoder-codec-specific.https.any.html not crashing.
* Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.h:
* Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in:
* Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.mm:
(WebKit::LibWebRTCCodecsProxy::stopListeningForIPC):
(WebKit::LibWebRTCCodecsProxy::createDecoderCallback):
(WebKit::LibWebRTCCodecsProxy::createDecoder):
(WebKit::LibWebRTCCodecsProxy::releaseDecoder):
(WebKit::LibWebRTCCodecsProxy::notifyDecoderResult):
* Source/WebKit/WebProcess/GPU/media/RemoteVideoCodecFactory.cpp:
(WebKit::RemoteVideoDecoder::decode):
* Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:
(WebKit::decodeVideoFrame):
(WebKit::LibWebRTCCodecs::sendFrameToDecode):
(WebKit::LibWebRTCCodecs::decodeFrame):
(WebKit::LibWebRTCCodecs::setDecoderConnection):
(WebKit::sendFrameToDecode): Deleted.
* Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.h:
Canonical link: https://commits.webkit.org/282781@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list