[webkit-changes] [WebKit/WebKit] 05fcfe: (REGRESSION:255635 at main) No video in Netflix hover...

Jer Noble noreply at github.com
Thu Oct 27 09:04:21 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 05fcfed179c815f55672b54da8620cb22f64a440
      https://github.com/WebKit/WebKit/commit/05fcfed179c815f55672b54da8620cb22f64a440
  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:
  -----------
  (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




More information about the webkit-changes mailing list