[webkit-changes] [WebKit/WebKit] d6a54a: [visionOS] add support for MV-HEVC spatial video p...

Jean-Yves Avenard noreply at github.com
Thu Aug 29 03:06:25 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d6a54a7d8abb19778f8e29b7ea22535eb0b38ec4
      https://github.com/WebKit/WebKit/commit/d6a54a7d8abb19778f8e29b7ea22535eb0b38ec4
  Author: Jean-Yves Avenard <jya at apple.com>
  Date:   2024-08-29 (Thu, 29 Aug 2024)

  Changed paths:
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/html/HTMLMediaElement.h
    M Source/WebCore/platform/cocoa/PlaybackSessionModel.h
    M Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h
    M Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm
    M Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.h
    M Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.mm
    M Source/WebKit/Platform/ios/PlaybackSessionInterfaceLMK.h
    M Source/WebKit/Platform/ios/PlaybackSessionInterfaceLMK.mm
    M Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.h
    M Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.mm
    M Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h
    M Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in
    M Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm
    M Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.h
    M Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.messages.in
    M Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.mm
    M Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm
    M Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaPlayer.swift
    M Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaTypes.swift
    M Source/WebKit/WebKitSwift/LinearMediaKit/WKSLinearMediaPlayer.h
    M Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h
    M Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm
    M Source/WebKit/WebProcess/cocoa/VideoPresentationManager.mm

  Log Message:
  -----------
  [visionOS] add support for MV-HEVC spatial video playback
https://bugs.webkit.org/show_bug.cgi?id=278827
rdar://134896614

Reviewed by Jer Noble.

Following 282641 at main, to support entering spatial mode in element fullscreen
we needed the UI process to determine if the video contained spatial metadata
prior entering fullscreen.
As such, we stop passing the metadata to the VideoPresentationManager when entering
fullscreen, and instead synchronise the information through the PlaybackSessionInterface
similar to how we synchronise other media's related data (such as the duration).
When entering spatial mode from element fullscreen, we will go straight to immersive mode
while when entered from native video fullscreen we will enter "portal" mode instead.

As there is no infrastructure in place for the video to determine if when
it entered native fullscreen it came from element fullscreen, we use the
same mechanism that sets the "docking" menu on the current view and assume
that if the button is displayed, we were in element fullscreen first.

Manually tested.

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::spatialVideoMetadata const): Deleted.
* Source/WebCore/html/HTMLMediaElement.h:
* Source/WebCore/platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModelClient::spatialVideoMetadataChanged):
* Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h:
* Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
* Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.h:
(WebCore::VideoPresentationInterfaceIOS::setSpatialImmersive):
* Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.mm:
(WebCore::VideoPresentationInterfaceIOS::setSpatialVideoMetadata): Deleted.
* Source/WebKit/Platform/ios/PlaybackSessionInterfaceLMK.h:
* Source/WebKit/Platform/ios/PlaybackSessionInterfaceLMK.mm:
(WebKit::PlaybackSessionInterfaceLMK::spatialVideoMetadataChanged):
* Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.h:
* Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.mm:
(WebKit::VideoPresentationInterfaceLMK::setSpatialImmersive):
(WebKit::VideoPresentationInterfaceLMK::setSpatialVideoMetadata): Deleted.
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionModelContext::spatialVideoMetadataChanged):
(WebKit::PlaybackSessionManagerProxy::spatialVideoMetadataChanged):
* Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.h:
* Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.messages.in:
* Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.mm:
(WebKit::VideoPresentationManagerProxy::setupFullscreenWithID):
* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController invalidate]):
(-[WKFullScreenViewController videoControlsManagerDidChange]): Add convenience method to retrieve the attached PlaybackSessionInterface and use it wherever needed.
(-[WKFullScreenViewController configureEnvironmentPickerButtonView]):
(-[WKFullScreenViewController _didCleanupFullscreen]):
(-[WKFullScreenViewController _playbackSessionInterface]):
(-[WKFullScreenViewController _togglePiPAction:]):
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaPlayer.swift:
(SwiftOnlyData.spatialVideoMetadata):
(SwiftOnlyData.videoReceiverEndpointObserver):
(WKSLinearMediaPlayer.spatialVideoMetadata):
(WKSLinearMediaPlayer.enterFullscreen(_:(any Error)?) -> Void:)):
(WKSLinearMediaPlayer.maybeCreateSpatialEntity):
(WKSLinearMediaPlayer.maybeClearSpatialEntity):
(WKSLinearMediaPlayer.didCompleteExitFullscreen(_:any:)):
(WKSLinearMediaPlayer.makeDefaultEntity):
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaTypes.swift:
(WKSLinearMediaSpatialVideoMetadata.metadata):
* Source/WebKit/WebKitSwift/LinearMediaKit/WKSLinearMediaPlayer.h:
* Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h:
* Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionInterfaceContext::spatialVideoMetadataChanged):
(WebKit::PlaybackSessionManager::spatialVideoMetadataChanged):
* Source/WebKit/WebProcess/cocoa/VideoPresentationManager.mm:
(WebKit::VideoPresentationManager::enterVideoFullscreenForVideoElement):

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