Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ce294ca6b4bfcbf97da306cb832bff473e18f432
https://github.com/WebKit/WebKit/commit/ce294ca6b4bfcbf97da306cb832bff473e18f432
Author: Jean-Yves Avenard <[email protected]>
Date: 2026-01-28 (Wed, 28 Jan 2026)
Changed paths:
M Source/WebCore/html/HTMLVideoElement.cpp
M Source/WebCore/html/HTMLVideoElement.h
M Source/WebCore/platform/graphics/AudioVideoRenderer.h
M Source/WebCore/platform/graphics/MediaPlayer.cpp
M Source/WebCore/platform/graphics/MediaPlayer.h
M Source/WebCore/platform/graphics/MediaPlayerPrivate.cpp
M Source/WebCore/platform/graphics/MediaPlayerPrivate.h
M Source/WebCore/platform/graphics/avfoundation/AudioVideoRendererAVFObjC.h
M Source/WebCore/platform/graphics/avfoundation/AudioVideoRendererAVFObjC.mm
M
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
M
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h
M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm
M Source/WebKit/GPUProcess/media/RemoteAudioVideoRendererProxyManager.cpp
M Source/WebKit/GPUProcess/media/RemoteAudioVideoRendererProxyManager.h
M
Source/WebKit/GPUProcess/media/RemoteAudioVideoRendererProxyManager.messages.in
M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
M Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemote.cpp
M Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemote.h
M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
M Source/WebKit/WebProcess/WebCoreSupport/ShareableBitmapUtilities.cpp
M Source/WebKit/WebProcess/WebCoreSupport/ShareableBitmapUtilities.h
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.h
Log Message:
-----------
Make HTMLVideoElement::bitmapImageForCurrentTime() asynchronous by having it
return a NativePromise
https://bugs.webkit.org/show_bug.cgi?id=305365
rdar://168044436
Reviewed by Jer Noble.
We make HTMLVideoElement::bitmapImageForCurrentTime asynchronous by having
it return a NativePromise.
The retrieval of the current MediaPlayer's videoframe required two sync calls.
one to retrieve the RemoteVideoFrameProxyProperties and then one to create
the NativeImage from it.
The ShareableBitmap was created from a NativeImage, itself built from a
VideoFrame.
Such constructions could only work on the main thread and required sync calls
to the GPU
process.
As such we add IPC APIs to directly return a ShareableBitmap::Handle from the
GPU process
where the ShareableBitmap will be created from the MediaPlayer's NativeImage
(or AudioVideoRenderer
if the MediaPlayer is running in the content process).
We add an async version of AudioVideoRenderer:currentNativeImage() :
currentNativeImageAsync()
which will return a NativePromise.
The MediaPlayerPrivateWebM and MediaPlayerPrivateMediaSourceAVFObjC are made to
use this
new API when running in the content process.
No change in observable behaviour.
* Source/WebCore/html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::bitmapImageForCurrentTimeSync const):
(WebCore::HTMLVideoElement::bitmapImageForCurrentTime const):
* Source/WebCore/html/HTMLVideoElement.h:
* Source/WebCore/platform/graphics/AudioVideoRenderer.h:
* Source/WebCore/platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::bitmapImageForCurrentTimeSync):
(WebCore::MediaPlayer::bitmapImageForCurrentTime):
* Source/WebCore/platform/graphics/MediaPlayer.h:
* Source/WebCore/platform/graphics/MediaPlayerPrivate.cpp:
(WebCore::MediaPlayerPrivateInterface::bitmapFromImage):
(WebCore::MediaPlayerPrivateInterface::bitmapImageForCurrentTimeSync):
(WebCore::MediaPlayerPrivateInterface::bitmapImageForCurrentTime):
* Source/WebCore/platform/graphics/MediaPlayerPrivate.h:
* Source/WebCore/platform/graphics/avfoundation/AudioVideoRendererAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/AudioVideoRendererAVFObjC.mm:
(WebCore::AudioVideoRendererAVFObjC::currentBitmapImage const):
*
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
*
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::bitmapImageForCurrentTime):
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h:
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm:
(WebCore::MediaPlayerPrivateWebM::bitmapImageForCurrentTime):
* Source/WebKit/GPUProcess/media/RemoteAudioVideoRendererProxyManager.cpp:
(WebKit::RemoteAudioVideoRendererProxyManager::currentBitmapImage const):
* Source/WebKit/GPUProcess/media/RemoteAudioVideoRendererProxyManager.h:
*
Source/WebKit/GPUProcess/media/RemoteAudioVideoRendererProxyManager.messages.in:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::bitmapImageForCurrentTime):
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
* Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemote.cpp:
(WebKit::AudioVideoRendererRemote::currentBitmapImage const):
* Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemote.h:
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::bitmapImageForCurrentTime):
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* Source/WebKit/WebProcess/WebCoreSupport/ShareableBitmapUtilities.cpp:
(WebKit::createShareableBitmap):
(WebKit::createShareableBitmapAsync):
* Source/WebKit/WebProcess/WebCoreSupport/ShareableBitmapUtilities.h:
(WebKit::createShareableBitmapAsync):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestTextRecognition):
(WebKit::WebPage::beginTextRecognitionForVideoInElementFullScreen):
(WebKit::WebPage::cancelTextRecognitionForVideoInElementFullScreen):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
Canonical link: https://commits.webkit.org/306386@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications