[webkit-changes] [WebKit/WebKit] a4b9a7: Cherry-pick 05fcfed179c8. rdar://problem/101520126
Jer Noble
noreply at github.com
Thu Oct 27 12:23:59 PDT 2022
Branch: refs/heads/safari-7615.1.11-branch
Home: https://github.com/WebKit/WebKit
Commit: a4b9a73a924d2146ee38692c5c7e063d3e20d9a4
https://github.com/WebKit/WebKit/commit/a4b9a73a924d2146ee38692c5c7e063d3e20d9a4
Author: Jer Noble <jer.noble at apple.com>
Date: 2022-10-27 (Thu, 27 Oct 2022)
Changed paths:
M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
M Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm
M Source/WebKit/GPUProcess/media/win/RemoteMediaPlayerProxyWin.cpp
M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in
M Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm
M Source/WebKit/WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm
Log Message:
-----------
Cherry-pick 05fcfed179c8. rdar://problem/101520126
(REGRESSION:255635 at main) No video in Netflix hover previews
https://bugs.webkit.org/show_bug.cgi?id=247021
rdar://101520126
Reviewed by Eric Carlson.
In 255635 at main, we changed MediaPlayer::setPresentationSize() to only notify the MediaPlayerPrivate
if the size had actually changed. Unfortunately, this caused MediaPlayerPrivateMediaSourceAVFObjC to
fail to create its platform layer, as it depended on setPresentationSize() being called often to trigger
re-querying whether said layer should be created.
Rather than depend upon timing- and order-specific messages from the MediaPlayer, explicitly re-query
by implementing playerContentBoxRectChanged(); as playerContentBoxRect() is used inside that query.
However, this still leaves some potential resizing glitches when media data is loaded sufficiently
quickly. Depending on timing, there may be multiple VideoInlineSizeChanged() messages sent from the
GPU process in the midst of an attepmted resize operation. So rather than relying on asynchronous
VideoInlineSizeChanged() messages to set the initial videoLayerFrame value, rely on the
PrepareForPlayback() message to set the initial presentationSize correctly, as the hosting layer
won't be created until the completion handler for that method.
Finally, during some extreme resize operations (such as occurs when loading a media document, where
the initial layout of the media element could be only a few pixels tall, and hundreds wide), a naive
scale from the initial video frame to the desired video frame will cause a graphical glitch. Instead,
take the aspect ratio of the underlying media into account when deriving the transform.
Canonical link: https://commits.webkit.org/256069@main
Canonical link: https://commits.webkit.org/255891.2@safari-7615.1.11-branch
More information about the webkit-changes
mailing list