[webkit-changes] [WebKit/WebKit] 159e1c: [visionOS] Changing video.src while in video fulls...

Jer Noble noreply at github.com
Mon May 13 14:24:24 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 159e1c84eb69ac30abbb63563e59bb70e59dc189
      https://github.com/WebKit/WebKit/commit/159e1c84eb69ac30abbb63563e59bb70e59dc189
  Author: Jer Noble <jer.noble at apple.com>
  Date:   2024-05-13 (Mon, 13 May 2024)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/SourcesCocoa.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/html/HTMLMediaElement.h
    M Source/WebCore/html/HTMLMediaElementIdentifier.h
    M Source/WebCore/platform/VideoReceiverEndpoint.h
    M Source/WebCore/platform/graphics/MediaPlayer.h
    A Source/WebCore/platform/graphics/MediaPlayerClientIdentifier.h
    M Source/WebCore/platform/graphics/MediaPlayerPrivate.h
    A Source/WebCore/platform/graphics/VideoTarget.h
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.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/MediaPlayerCocoa.mm
    A Source/WebCore/platform/graphics/cocoa/VideoTargetFactory.h
    A Source/WebCore/platform/graphics/cocoa/VideoTargetFactory.mm
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.h
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
    A Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerManagerProxyCocoa.mm
    M Source/WebKit/Platform/ios/VideoReceiverEndpointMessage.h
    M Source/WebKit/Platform/ios/VideoReceiverEndpointMessage.mm
    M Source/WebKit/Scripts/webkit/messages.py
    M Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp
    M Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCEndpointMessages.mm
    M Source/WebKit/Shared/WTFArgumentCoders.serialization.in
    M Source/WebKit/SourcesCocoa.txt
    M Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h
    M Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp

  Log Message:
  -----------
  [visionOS] Changing video.src while in video fullscreen results in black video
https://bugs.webkit.org/show_bug.cgi?id=274002
rdar://125926759

Reviewed by Andy Estes.

A FigVideoTarget can only be used with one renderer at a time, and once a target has been created from an XPC
endpoint, it cannot be re-used to create another FigVideoTarget. The combination of these requirements means
that once a FigVideoTarget has been created for a given HTMLMediaElement, it must be cached and re-used for
subsequent MediaPlayers created by that HTMLMediaElement.

To allow the WebCore/platform layer to identify the owner of a MediaPlayer (typically a HTMLMediaElement, but
in WebKit this will be a RemoteMediaPlayerProxy), add a new MediaPlayerClientIdentifier and make the existing
HTMLMediaElementIdentifier an alias for that new identifier.

Add a utility class/namespace to convert XPC endpoints to a FigVideoTarget, and add a new PlatformVideoTarget
type to wrap FigVideoTarget.

Add methods to MediaPlayer to allow MediaPlayerPrivates to query for an existing PlatformVideoTarget. Rename
MediaPlayer setVideoEndpoint() methods to setVideoTarget().

Add a cache of PlatformVideoTargets (and endpoints, and MediaPlayerIdentifiers) in RemoteMediaPlayerManagerProxy.
Having the cache exist on this object means that it will automatically be cleared when the associated WebContent
process exits.

Add new messaging from the UIProcess to explicitly clear cached PlatformVideoTargets when the video interface
in the UIProcess is closed.

* Source/WebCore/Headers.cmake:
* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/html/HTMLMediaElement.h:
* Source/WebCore/html/HTMLMediaElementIdentifier.h:
* Source/WebCore/platform/VideoReceiverEndpoint.h:
* Source/WebCore/platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerVideoTarget const):
(WebCore::MediaPlayerClient::mediaPlayerClientIdentifier const):
* Source/WebCore/platform/graphics/MediaPlayerClientIdentifier.h: Copied from Source/WebCore/html/HTMLMediaElementIdentifier.h.
* Source/WebCore/platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setVideoTarget):
(WebCore::MediaPlayerPrivateInterface::setVideoReceiverEndpoint): Deleted.
* Source/WebCore/platform/graphics/VideoTarget.h: Copied from Source/WebCore/platform/VideoReceiverEndpoint.h.
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoTarget):
(WebCore::MediaPlayerPrivateAVFoundationObjC::isInFullscreenOrPictureInPictureChanged):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoReceiverEndpoint): Deleted.
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyVideoRenderer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoTarget):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoReceiverEndpoint): Deleted.
* Source/WebCore/platform/graphics/cocoa/MediaPlayerCocoa.mm:
(WebCore::MediaPlayer::setVideoTarget):
(WebCore::MediaPlayer::setVideoReceiverEndpoint): Deleted.
* Source/WebCore/platform/graphics/cocoa/VideoTargetFactory.h: Copied from Source/WebCore/platform/VideoReceiverEndpoint.h.
* Source/WebCore/platform/graphics/cocoa/VideoTargetFactory.mm: Copied from Source/WebCore/platform/VideoReceiverEndpoint.h.
(WebCore::VideoTargetFactory::createTargetFromEndpoint):
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
(WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::create):
(WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerVideoTarget const):
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h:
* Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerManagerProxyCocoa.mm: Added.
(WebKit::RemoteMediaPlayerManagerProxy::videoTargetForMediaElementIdentifier):
(WebKit::RemoteMediaPlayerManagerProxy::handleVideoReceiverEndpointMessage):
* Source/WebKit/Platform/ios/VideoReceiverEndpointMessage.h:
(WebKit::VideoReceiverEndpointMessage::mediaElementIdentifier const):
* Source/WebKit/Platform/ios/VideoReceiverEndpointMessage.mm:
(WebKit::VideoReceiverEndpointMessage::VideoReceiverEndpointMessage):
(WebKit::VideoReceiverEndpointMessage::decode):
(WebKit::VideoReceiverEndpointMessage::encode const):
* Source/WebKit/Scripts/webkit/messages.py:
(serialized_identifiers):
* Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCEndpointMessages.mm:
(WebKit::handleVideoReceiverEndpointMessage):
* Source/WebKit/Shared/WTFArgumentCoders.serialization.in:
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionModelContext::~PlaybackSessionModelContext):
(WebKit::PlaybackSessionModelContext::setVideoReceiverEndpoint):
(WebKit::PlaybackSessionManagerProxy::setVideoReceiverEndpoint):
(WebKit::PlaybackSessionManagerProxy::uncacheVideoReceiverEndpoint):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
(WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

Canonical link: https://commits.webkit.org/278712@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