[webkit-changes] [WebKit/WebKit] 201806: Refactor VideoPresentationInterfaceIOS

Dana Estra noreply at github.com
Tue Feb 6 11:08:29 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 20180664c83966aecf29787875bb1f80c96623bb
      https://github.com/WebKit/WebKit/commit/20180664c83966aecf29787875bb1f80c96623bb
  Author: Dana Estra <destra at apple.com>
  Date:   2024-02-06 (Tue, 06 Feb 2024)

  Changed paths:
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/platform/graphics/PlatformVideoPresentationInterface.h
    A Source/WebCore/platform/ios/VideoPresentationInterfaceAVKit.h
    A Source/WebCore/platform/ios/VideoPresentationInterfaceAVKit.mm
    M Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.h
    M Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.mm
    A Source/WebCore/platform/ios/VideoPresentationInterfaceLMK.h
    A Source/WebCore/platform/ios/VideoPresentationInterfaceLMK.mm
    M Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
    M Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.mm
    M Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm
    M Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm

  Log Message:
  -----------
  Refactor VideoPresentationInterfaceIOS
https://bugs.webkit.org/show_bug.cgi?id=268636
rdar://122193331

Reviewed by Andy Estes.

This patch extracts the AVKit-specific code from VideoPresentationInterfaceIOS
and places it into a subclass called VideoPresentationInterfaceAVKit. There
is also now a second subclass called VideoPresentationInterfaceLMK, which
will be used on the vision platform in the future. For now, all IOS platforms
instantiate VideoPresentationInterfaceAVKit.

* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/html/HTMLMediaElement.cpp:
* Source/WebCore/platform/graphics/PlatformVideoPresentationInterface.h:
* Source/WebCore/platform/ios/VideoPresentationInterfaceAVKit.h: Added.
(WebCore::VideoPresentationInterfaceAVKit::logClassName const):
(WebCore::VideoPresentationInterfaceAVKit::playerLayerView const):
(WebCore::VideoPresentationInterfaceAVKit::changingStandbyOnly):
(WebCore::VideoPresentationInterfaceAVKit::allowsPictureInPicturePlayback const):
* Source/WebCore/platform/ios/VideoPresentationInterfaceAVKit.mm: Copied from Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.mm.
(clearUIColor):
(boolString):
(-[WebAVPlayerViewControllerDelegate fullscreenInterface]):
(-[WebAVPlayerViewControllerDelegate setFullscreenInterface:]):
(-[WebAVPlayerViewControllerDelegate playerViewControllerWillStartPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate playerViewControllerDidStartPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate playerViewController:failedToStartPictureInPictureWithError:]):
(-[WebAVPlayerViewControllerDelegate playerViewControllerWillStopPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate playerViewControllerDidStopPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart:]):
(convertToExitFullScreenReason):
(-[WebAVPlayerViewControllerDelegate playerViewController:shouldExitFullScreenWithReason:]):
(-[WebAVPlayerViewControllerDelegate playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:]):
(-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerWillStartPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerDidStartPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureController:failedToStartPictureInPictureWithError:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerWillStopPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerDidStopPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:]):
(WebAVPictureInPictureContentViewController_initWithController):
(WebAVPictureInPictureContentViewController_controller):
(WebAVPictureInPictureContentViewController_playerLayer):
(WebAVPictureInPictureContentViewController_setPlayerLayer):
(WebAVPictureInPictureContentViewController_viewWillLayoutSubviews):
(WebAVPictureInPictureContentViewController_dealloc):
(allocWebAVPictureInPictureContentViewControllerInstance):
(-[WebAVPlayerViewController initWithFullscreenInterface:]):
(-[WebAVPlayerViewController configurePlayerViewControllerWithFullscreenInterface:]):
(-[WebAVPlayerViewController dealloc]):
(-[WebAVPlayerViewController playerViewControllerShouldHandleDoneButtonTap:]):
(-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
(-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController observeValueForKeyPath:ofObject:change:context:]):
(-[WebAVPlayerViewController initObserver]):
(-[WebAVPlayerViewController removeObserver]):
(-[WebAVPlayerViewController MY_NO_RETURN]):
(-[WebAVPlayerViewController isPictureInPicturePossible]):
(-[WebAVPlayerViewController isPictureInPictureActive]):
(-[WebAVPlayerViewController pictureInPictureActive]):
(-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
(-[WebAVPlayerViewController view]):
(-[WebAVPlayerViewController flashPlaybackControlsWithDuration:]):
(-[WebAVPlayerViewController showsPlaybackControls]):
(-[WebAVPlayerViewController setShowsPlaybackControls:]):
(-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
(-[WebAVPlayerViewController setDelegate:]):
(-[WebAVPlayerViewController setPlayerController:]):
(-[WebAVPlayerViewController avPlayerViewController]):
(-[WebAVPlayerViewController removeFromParentViewController]):
(-[WebAVPlayerViewController logIdentifier]):
(-[WebAVPlayerViewController loggerPtr]):
(-[WebAVPlayerViewController logChannel]):
(VideoPresentationInterfaceAVKit::create):
(VideoPresentationInterfaceAVKit::VideoPresentationInterfaceAVKit):
(VideoPresentationInterfaceAVKit::~VideoPresentationInterfaceAVKit):
(VideoPresentationInterfaceAVKit::avPlayerViewController const):
(VideoPresentationInterfaceAVKit::videoDimensionsChanged):
(VideoPresentationInterfaceAVKit::setupFullscreen):
(VideoPresentationInterfaceAVKit::setVideoPresentationModel):
(VideoPresentationInterfaceAVKit::hasVideoChanged):
(VideoPresentationInterfaceAVKit::externalPlaybackChanged):
(VideoPresentationInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
(VideoPresentationInterfaceAVKit::exitFullscreen):
(VideoPresentationInterfaceAVKit::cleanupFullscreen):
(VideoPresentationInterfaceAVKit::setPlayerIdentifier):
(VideoPresentationInterfaceAVKit::requestHideAndExitFullscreen):
(VideoPresentationInterfaceAVKit::preparedToReturnToInline):
(VideoPresentationInterfaceAVKit::mayAutomaticallyShowVideoPictureInPicture const):
(VideoPresentationInterfaceAVKit::willStartPictureInPicture):
(VideoPresentationInterfaceAVKit::didStartPictureInPicture):
(VideoPresentationInterfaceAVKit::failedToStartPictureInPicture):
(VideoPresentationInterfaceAVKit::didStopPictureInPicture):
(VideoPresentationInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
(VideoPresentationInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoPresentationInterfaceAVKit::setInlineRect):
(VideoPresentationInterfaceAVKit::doSetup):
(VideoPresentationInterfaceAVKit::doEnterFullscreen):
(VideoPresentationInterfaceAVKit::doExitFullscreen):
(VideoPresentationInterfaceAVKit::exitFullscreenHandler):
(VideoPresentationInterfaceAVKit::enterFullscreenHandler):
(VideoPresentationInterfaceAVKit::watchdogTimerFired):
(VideoPresentationInterfaceAVKit::isPlayingVideoInEnhancedFullscreen const):
(WebCore::setSupportsPictureInPicture):
(WebCore::supportsPictureInPicture):
* Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.h:
(WebCore::VideoPresentationInterfaceIOS::hasMode const):
(WebCore::VideoPresentationInterfaceIOS::playerIdentifier const):
* Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.mm:
(VideoPresentationInterfaceIOS::VideoPresentationInterfaceIOS):
(VideoPresentationInterfaceIOS::~VideoPresentationInterfaceIOS):
(VideoPresentationInterfaceIOS::playerController const):
(VideoPresentationInterfaceIOS::applicationDidBecomeActive):
(clearUIColor): Deleted.
(boolString): Deleted.
(-[WebAVPlayerViewControllerDelegate fullscreenInterface]): Deleted.
(-[WebAVPlayerViewControllerDelegate setFullscreenInterface:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerWillStartPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerDidStartPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewController:failedToStartPictureInPictureWithError:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerWillStopPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerDidStopPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart:]): Deleted.
(convertToExitFullScreenReason): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewController:shouldExitFullScreenWithReason:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerShouldDismiss:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]): Deleted.
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerWillStartPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerDidStartPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate pictureInPictureController:failedToStartPictureInPictureWithError:]): Deleted.
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerWillStopPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerDidStopPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate pictureInPictureController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:]): Deleted.
(WebAVPictureInPictureContentViewController_initWithController): Deleted.
(WebAVPictureInPictureContentViewController_controller): Deleted.
(WebAVPictureInPictureContentViewController_playerLayer): Deleted.
(WebAVPictureInPictureContentViewController_setPlayerLayer): Deleted.
(WebAVPictureInPictureContentViewController_viewWillLayoutSubviews): Deleted.
(WebAVPictureInPictureContentViewController_dealloc): Deleted.
(allocWebAVPictureInPictureContentViewControllerInstance): Deleted.
(-[WebAVPlayerViewController initWithFullscreenInterface:]): Deleted.
(-[WebAVPlayerViewController configurePlayerViewControllerWithFullscreenInterface:]): Deleted.
(-[WebAVPlayerViewController dealloc]): Deleted.
(-[WebAVPlayerViewController playerViewControllerShouldHandleDoneButtonTap:]): Deleted.
(-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]): Deleted.
(-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]): Deleted.
(-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]): Deleted.
(-[WebAVPlayerViewController observeValueForKeyPath:ofObject:change:context:]): Deleted.
(-[WebAVPlayerViewController initObserver]): Deleted.
(-[WebAVPlayerViewController removeObserver]): Deleted.
(-[WebAVPlayerViewController MY_NO_RETURN]): Deleted.
(-[WebAVPlayerViewController isPictureInPicturePossible]): Deleted.
(-[WebAVPlayerViewController isPictureInPictureActive]): Deleted.
(-[WebAVPlayerViewController pictureInPictureActive]): Deleted.
(-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]): Deleted.
(-[WebAVPlayerViewController view]): Deleted.
(-[WebAVPlayerViewController flashPlaybackControlsWithDuration:]): Deleted.
(-[WebAVPlayerViewController showsPlaybackControls]): Deleted.
(-[WebAVPlayerViewController setShowsPlaybackControls:]): Deleted.
(-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]): Deleted.
(-[WebAVPlayerViewController setDelegate:]): Deleted.
(-[WebAVPlayerViewController setPlayerController:]): Deleted.
(-[WebAVPlayerViewController avPlayerViewController]): Deleted.
(-[WebAVPlayerViewController removeFromParentViewController]): Deleted.
(-[WebAVPlayerViewController logIdentifier]): Deleted.
(-[WebAVPlayerViewController loggerPtr]): Deleted.
(-[WebAVPlayerViewController logChannel]): Deleted.
(VideoPresentationInterfaceIOS::create): Deleted.
(VideoPresentationInterfaceIOS::avPlayerViewController const): Deleted.
(VideoPresentationInterfaceIOS::setVideoPresentationModel): Deleted.
(VideoPresentationInterfaceIOS::hasVideoChanged): Deleted.
(VideoPresentationInterfaceIOS::videoDimensionsChanged): Deleted.
(VideoPresentationInterfaceIOS::externalPlaybackChanged): Deleted.
(VideoPresentationInterfaceIOS::pictureInPictureWasStartedWhenEnteringBackground const): Deleted.
(VideoPresentationInterfaceIOS::setupFullscreen): Deleted.
(VideoPresentationInterfaceIOS::exitFullscreen): Deleted.
(VideoPresentationInterfaceIOS::cleanupFullscreen): Deleted.
(VideoPresentationInterfaceIOS::setPlayerIdentifier): Deleted.
(VideoPresentationInterfaceIOS::requestHideAndExitFullscreen): Deleted.
(VideoPresentationInterfaceIOS::preparedToReturnToInline): Deleted.
(VideoPresentationInterfaceIOS::mayAutomaticallyShowVideoPictureInPicture const): Deleted.
(VideoPresentationInterfaceIOS::willStartPictureInPicture): Deleted.
(VideoPresentationInterfaceIOS::didStartPictureInPicture): Deleted.
(VideoPresentationInterfaceIOS::failedToStartPictureInPicture): Deleted.
(VideoPresentationInterfaceIOS::didStopPictureInPicture): Deleted.
(VideoPresentationInterfaceIOS::prepareForPictureInPictureStopWithCompletionHandler): Deleted.
(VideoPresentationInterfaceIOS::shouldExitFullscreenWithReason): Deleted.
(VideoPresentationInterfaceIOS::setInlineRect): Deleted.
(VideoPresentationInterfaceIOS::doSetup): Deleted.
(VideoPresentationInterfaceIOS::doEnterFullscreen): Deleted.
(VideoPresentationInterfaceIOS::doExitFullscreen): Deleted.
(VideoPresentationInterfaceIOS::exitFullscreenHandler): Deleted.
(VideoPresentationInterfaceIOS::enterFullscreenHandler): Deleted.
(VideoPresentationInterfaceIOS::watchdogTimerFired): Deleted.
(VideoPresentationInterfaceIOS::isPlayingVideoInEnhancedFullscreen const): Deleted.
(WebCore::setSupportsPictureInPicture): Deleted.
(WebCore::supportsPictureInPicture): Deleted.
* Source/WebCore/platform/ios/VideoPresentationInterfaceLMK.h: Added.
(WebCore::VideoPresentationInterfaceLMK::logClassName const):
* Source/WebCore/platform/ios/VideoPresentationInterfaceLMK.mm: Added.
(VideoPresentationInterfaceLMK::~VideoPresentationInterfaceLMK):
(VideoPresentationInterfaceLMK::create):
(VideoPresentationInterfaceLMK::VideoPresentationInterfaceLMK):
(VideoPresentationInterfaceLMK::setupFullscreen):
(VideoPresentationInterfaceLMK::setVideoPresentationModel):
(VideoPresentationInterfaceLMK::videoDimensionsChanged):
(VideoPresentationInterfaceLMK::exitFullscreen):
(VideoPresentationInterfaceLMK::pictureInPictureWasStartedWhenEnteringBackground const):
(VideoPresentationInterfaceLMK::hasVideoChanged):
(VideoPresentationInterfaceLMK::externalPlaybackChanged):
(VideoPresentationInterfaceLMK::cleanupFullscreen):
(VideoPresentationInterfaceLMK::setPlayerIdentifier):
(VideoPresentationInterfaceLMK::requestHideAndExitFullscreen):
(VideoPresentationInterfaceLMK::preparedToReturnToInline):
(VideoPresentationInterfaceLMK::mayAutomaticallyShowVideoPictureInPicture const):
(VideoPresentationInterfaceLMK::willStartPictureInPicture):
(VideoPresentationInterfaceLMK::didStartPictureInPicture):
(VideoPresentationInterfaceLMK::failedToStartPictureInPicture):
(VideoPresentationInterfaceLMK::didStopPictureInPicture):
(VideoPresentationInterfaceLMK::prepareForPictureInPictureStopWithCompletionHandler):
(VideoPresentationInterfaceLMK::shouldExitFullscreenWithReason):
(VideoPresentationInterfaceLMK::setInlineRect):
(VideoPresentationInterfaceLMK::doSetup):
(VideoPresentationInterfaceLMK::doEnterFullscreen):
(VideoPresentationInterfaceLMK::doExitFullscreen):
(VideoPresentationInterfaceLMK::exitFullscreenHandler):
(VideoPresentationInterfaceLMK::enterFullscreenHandler):
(VideoPresentationInterfaceLMK::watchdogTimerFired):
(VideoPresentationInterfaceLMK::isPlayingVideoInEnhancedFullscreen const):
(VideoPresentationInterfaceLMK::avPlayerViewController const):
(VideoPresentationInterfaceLMK::playerLayerView const):
* Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::setUpFullscreen):
* Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.mm:
* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:

Canonical link: https://commits.webkit.org/274159@main




More information about the webkit-changes mailing list