Changeset 263707 in webkit
- Timestamp:
- Jun 29, 2020 4:32:18 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r263706 r263707 1 2020-06-29 Peng Liu <peng.liu6@apple.com> 2 3 Video spills over PiP screen a little when using Picture in Picture 4 https://bugs.webkit.org/show_bug.cgi?id=213658 5 6 Reviewed by Eric Carlson. 7 8 * media/picture-in-picture/picture-in-picture-window-aspect-ratio-expected.txt: Added. 9 * media/picture-in-picture/picture-in-picture-window-aspect-ratio.html: Added. 10 1 11 2020-06-29 Karl Rackler <rackler@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r263700 r263707 1 2020-06-29 Peng Liu <peng.liu6@apple.com> 2 3 Video spills over PiP screen a little when using Picture in Picture 4 https://bugs.webkit.org/show_bug.cgi?id=213658 5 6 Reviewed by Eric Carlson. 7 8 We need to provide video content dimensions instead of video element sizes to 9 AVPlayerController to make sure that the Picture-in-Picture window will have 10 the correct aspect ratio. 11 12 Test: media/picture-in-picture/picture-in-picture-window-aspect-ratio.html 13 14 * platform/ios/VideoFullscreenInterfaceAVKit.h: 15 * platform/ios/VideoFullscreenInterfaceAVKit.mm: 16 (VideoFullscreenInterfaceAVKit::setupFullscreen): 17 * platform/ios/WebVideoFullscreenControllerAVKit.mm: 18 (VideoFullscreenControllerContext::setUpFullscreen): 19 1 20 2020-06-29 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> 2 21 -
trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h
r262185 r263707 80 80 WEBCORE_EXPORT void externalPlaybackChanged(bool enabled, PlaybackSessionModel::ExternalPlaybackTargetType, const String& localizedDeviceName) final; 81 81 82 WEBCORE_EXPORT void setupFullscreen(UIView& , const IntRect& initialRect, UIView *, HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicturePlayback, bool standby);82 WEBCORE_EXPORT void setupFullscreen(UIView& videoView, const IntRect& initialRect, const FloatSize& videoDimensions, UIView* parentView, HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicturePlayback, bool standby); 83 83 WEBCORE_EXPORT void enterFullscreen(); 84 84 WEBCORE_EXPORT void exitFullscreen(const IntRect& finalRect); -
trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm
r263500 r263707 890 890 } 891 891 892 void VideoFullscreenInterfaceAVKit::setupFullscreen(UIView& videoView, const IntRect& initialRect, UIView* parentView, HTMLMediaElementEnums::VideoFullscreenMode mode, bool allowsPictureInPicturePlayback, bool standby)892 void VideoFullscreenInterfaceAVKit::setupFullscreen(UIView& videoView, const IntRect& initialRect, const FloatSize& videoDimensions, UIView* parentView, HTMLMediaElementEnums::VideoFullscreenMode mode, bool allowsPictureInPicturePlayback, bool standby) 893 893 { 894 894 ASSERT(standby || mode != HTMLMediaElementEnums::VideoFullscreenModeNone); … … 897 897 [playerController() setHasEnabledVideo:true]; 898 898 [playerController() setHasVideo:true]; 899 [playerController() setContentDimensions: initialRect.size()];899 [playerController() setContentDimensions:videoDimensions]; 900 900 901 901 m_allowsPictureInPicturePlayback = allowsPictureInPicturePlayback; -
trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
r260486 r263707 982 982 m_fullscreenModel->setVideoLayerFrame(videoLayerFrame); 983 983 984 dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, videoElementClientRect, viewRef, mode, allowsPictureInPicture] { 984 FloatSize videoDimensions = { (float)videoElement.videoWidth(), (float)videoElement.videoHeight() }; 985 986 dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, videoElementClientRect, videoDimensions, viewRef, mode, allowsPictureInPicture] { 985 987 ASSERT(isUIThread()); 986 988 WebThreadLock(); … … 994 996 m_videoFullscreenView = adoptNS([PAL::allocUIViewInstance() init]); 995 997 996 m_interface->setupFullscreen(*m_videoFullscreenView.get(), videoElementClientRect, vi ewRef.get(), mode, allowsPictureInPicture, false);998 m_interface->setupFullscreen(*m_videoFullscreenView.get(), videoElementClientRect, videoDimensions, viewRef.get(), mode, allowsPictureInPicture, false); 997 999 }); 998 1000 } -
trunk/Source/WebKit/ChangeLog
r263705 r263707 1 2020-06-29 Peng Liu <peng.liu6@apple.com> 2 3 Video spills over PiP screen a little when using Picture in Picture 4 https://bugs.webkit.org/show_bug.cgi?id=213658 5 6 Reviewed by Eric Carlson. 7 8 Add the video content dimensions to the IPC message VideoFullscreenManagerProxy::SetupFullscreenWithID. 9 10 * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: 11 * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in: 12 * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: 13 (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): 14 (WebKit::VideoFullscreenManagerProxy::setVideoDimensions): 15 (WebKit::VideoFullscreenManagerProxy::enterFullscreen): 16 * WebProcess/cocoa/VideoFullscreenManager.mm: 17 (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): 18 1 19 2020-06-29 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h
r263490 r263707 56 56 namespace WebKit { 57 57 58 constexpr size_t DefaultMockPictureInPictureWindowWidth = 100; 59 constexpr size_t DefaultMockPictureInPictureWindowHeight = 100; 60 58 61 class WebPageProxy; 59 62 class PlaybackSessionManagerProxy; … … 161 164 162 165 // Messages from VideoFullscreenManager 163 void setupFullscreenWithID(PlaybackSessionContextIdentifier, WebKit::LayerHostingContextID videoLayerID, const WebCore::IntRect& initialRect, float hostingScaleFactor, WebCore::HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicture, bool standby);166 void setupFullscreenWithID(PlaybackSessionContextIdentifier, WebKit::LayerHostingContextID videoLayerID, const WebCore::IntRect& initialRect, const WebCore::FloatSize& videoDimensions, float hostingScaleFactor, WebCore::HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicture, bool standby); 164 167 void setInlineRect(PlaybackSessionContextIdentifier, const WebCore::IntRect& inlineRect, bool visible); 165 168 void setHasVideoContentLayer(PlaybackSessionContextIdentifier, bool value); … … 189 192 190 193 bool m_mockVideoPresentationModeEnabled { false }; 194 WebCore::FloatSize m_mockPictureInPictureWindowSize { DefaultMockPictureInPictureWindowWidth, DefaultMockPictureInPictureWindowHeight }; 191 195 192 196 WebPageProxy* m_page; -
trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in
r263490 r263707 25 25 SetHasVideo(WebKit::PlaybackSessionContextIdentifier contextId, bool hasVideo) 26 26 SetVideoDimensions(WebKit::PlaybackSessionContextIdentifier contextId, WebCore::FloatSize videoDimensions) 27 SetupFullscreenWithID(WebKit::PlaybackSessionContextIdentifier contextId, WebKit::LayerHostingContextID videoLayerID, WebCore::IntRect initialRect, float hostingScaleFactor, WebCore::HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode, bool allowsPictureInPicture, bool standby)27 SetupFullscreenWithID(WebKit::PlaybackSessionContextIdentifier contextId, WebKit::LayerHostingContextID videoLayerID, WebCore::IntRect initialRect, WebCore::FloatSize videoDimensions, float hostingScaleFactor, WebCore::HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode, bool allowsPictureInPicture, bool standby) 28 28 EnterFullscreen(WebKit::PlaybackSessionContextIdentifier contextId) 29 29 ExitFullscreen(WebKit::PlaybackSessionContextIdentifier contextId, WebCore::IntRect finalRect) -
trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm
r263490 r263707 507 507 #pragma mark Messages from VideoFullscreenManager 508 508 509 void VideoFullscreenManagerProxy::setupFullscreenWithID(PlaybackSessionContextIdentifier contextId, WebKit::LayerHostingContextID videoLayerID, const WebCore::IntRect& initialRect, float hostingDeviceScaleFactor, HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode, bool allowsPictureInPicture, bool standby)509 void VideoFullscreenManagerProxy::setupFullscreenWithID(PlaybackSessionContextIdentifier contextId, WebKit::LayerHostingContextID videoLayerID, const WebCore::IntRect& initialRect, const WebCore::FloatSize& videoDimensions, float hostingDeviceScaleFactor, HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode, bool allowsPictureInPicture, bool standby) 510 510 { 511 511 MESSAGE_CHECK(videoLayerID); … … 515 515 516 516 if (m_mockVideoPresentationModeEnabled) { 517 if (!videoDimensions.isEmpty()) 518 m_mockPictureInPictureWindowSize.setHeight(DefaultMockPictureInPictureWindowWidth / videoDimensions.aspectRatio()); 517 519 #if PLATFORM(IOS_FAMILY) 518 520 requestVideoContentLayer(contextId); … … 541 543 auto* rootNode = downcast<RemoteLayerTreeDrawingAreaProxy>(*m_page->drawingArea()).remoteLayerTreeHost().rootNode(); 542 544 UIView *parentView = rootNode ? rootNode->uiView() : nil; 543 interface->setupFullscreen(*model->layerHostView(), initialRect, parentView, videoFullscreenMode, allowsPictureInPicture, standby); 544 #else 545 interface->setupFullscreen(*model->layerHostView(), initialRect, videoDimensions, parentView, videoFullscreenMode, allowsPictureInPicture, standby); 546 #else 547 UNUSED_PARAM(videoDimensions); 545 548 IntRect initialWindowRect; 546 549 m_page->rootViewToWindow(initialRect, initialWindowRect); … … 560 563 void VideoFullscreenManagerProxy::setVideoDimensions(PlaybackSessionContextIdentifier contextId, const FloatSize& videoDimensions) 561 564 { 562 if (m_mockVideoPresentationModeEnabled) 563 return; 564 565 if (auto* interface = findInterface(contextId)) 566 interface->videoDimensionsChanged(videoDimensions); 565 auto* interface = findInterface(contextId); 566 if (!interface) 567 return; 568 569 if (m_mockVideoPresentationModeEnabled) { 570 if (videoDimensions.isEmpty()) 571 return; 572 573 m_mockPictureInPictureWindowSize.setHeight(DefaultMockPictureInPictureWindowWidth / videoDimensions.aspectRatio()); 574 return; 575 } 576 577 interface->videoDimensionsChanged(videoDimensions); 567 578 } 568 579 … … 571 582 if (m_mockVideoPresentationModeEnabled) { 572 583 didEnterFullscreen(contextId); 573 setVideoLayerFrame(contextId, {0, 0, 200, 150});584 setVideoLayerFrame(contextId, {0, 0, m_mockPictureInPictureWindowSize.width(), m_mockPictureInPictureWindowSize.height()}); 574 585 return; 575 586 } -
trunk/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm
r263476 r263707 286 286 } 287 287 288 m_page->send(Messages::VideoFullscreenManagerProxy::SetupFullscreenWithID(contextId, interface->layerHostingContext()->contextID(), videoRect, m_page->deviceScaleFactor(), interface->fullscreenMode(), allowsPictureInPicture, standby));288 m_page->send(Messages::VideoFullscreenManagerProxy::SetupFullscreenWithID(contextId, interface->layerHostingContext()->contextID(), videoRect, FloatSize(videoElement.videoWidth(), videoElement.videoHeight()), m_page->deviceScaleFactor(), interface->fullscreenMode(), allowsPictureInPicture, standby)); 289 289 } 290 290
Note: See TracChangeset
for help on using the changeset viewer.