-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Make HTMLVideoElement::bitmapImageForCurrentTime() asynchronous by having it return a NativePromise #56556
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
Conversation
|
EWS run on previous version of this PR (hash 09065c2) Details |
Safer C++ Build #74561 (09065c2)❌ Found 3 failing files with 6 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming. |
09065c2 to
dcb468e
Compare
|
EWS run on previous version of this PR (hash dcb468e) Details
|
dcb468e to
f3e9869
Compare
|
EWS run on previous version of this PR (hash f3e9869) Details
|
f3e9869 to
0695b13
Compare
|
EWS run on previous version of this PR (hash 0695b13) Details
|
0695b13 to
54d798c
Compare
|
EWS run on previous version of this PR (hash 54d798c) Details
|
54d798c to
b834263
Compare
|
EWS run on previous version of this PR (hash b834263) Details
|
b834263 to
87864fe
Compare
|
EWS run on current version of this PR (hash 87864fe) Details
|
…ving 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
87864fe to
ce294ca
Compare
|
Committed 306386@main (ce294ca): https://commits.webkit.org/306386@main Reviewed commits have been landed. Closing PR #56556 and removing active labels. |
🧪 vision-wk2
ce294ca
87864fe
🛠 win🧪 wpe-wk2🧪 win-tests🧪 api-mac🧪 ios-wk2-wpt🧪 api-mac-debug🧪 api-ios🧪 mac-wk1🛠 vision🧪 gtk-wk2🧪 mac-AS-debug-wk2🧪 api-gtk🧪 mac-wk2-stress🛠 playstation🛠 tv-sim🛠 mac-safer-cpp🛠 watch