Changeset 267725 in webkit
- Timestamp:
- Sep 28, 2020, 9:52:54 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 15 edited
- 1 copied
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Headers.cmake (modified) (1 diff)
-
WebCore/WebCore.xcodeproj/project.pbxproj (modified) (14 diffs)
-
WebCore/platform/graphics/TextTrackRepresentation.cpp (modified) (1 diff)
-
WebCore/platform/graphics/TextTrackRepresentation.h (modified) (2 diffs)
-
WebCore/platform/graphics/VideoLayerManager.h (copied) (copied from trunk/Source/WebCore/platform/graphics/TextTrackRepresentation.h ) (2 diffs)
-
WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h (modified) (3 diffs)
-
WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm (modified) (4 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h (modified) (3 diffs)
-
WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in (modified) (2 diffs)
-
WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm (modified) (3 diffs)
-
WebKit/GPUProcess/media/gstreamer/RemoteMediaPlayerProxyGStreamer.cpp (modified) (2 diffs)
-
WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp (modified) (10 diffs)
-
WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h (modified) (8 diffs)
-
WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267724 r267725 1 2020-09-28 Peng Liu <peng.liu6@apple.com> 2 3 [Media in GPU Process] Use VideoLayerManager to manage layers of MediaPlayerPrivateRemote 4 https://bugs.webkit.org/show_bug.cgi?id=216995 5 6 Reviewed by Eric Carlson. 7 8 No new tests since no functional changes. 9 10 * Headers.cmake: 11 Export TextTrackRepresentation and VideoLayerManager. 12 13 * WebCore.xcodeproj/project.pbxproj: 14 Add VideoLayerManager.h. 15 Export TextTrackRepresentation, WebVideoContainerLayer and VideoLayerManager. 16 17 * platform/graphics/TextTrackRepresentation.cpp: 18 * platform/graphics/TextTrackRepresentation.h: 19 Minor clean-up. 20 21 * platform/graphics/VideoLayerManager.h: Added. 22 Add this interface so that we can use VideoLayerManager in the C++ code. 23 24 * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h: 25 * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: 26 (WebCore::VideoLayerManagerObjC::videoInlineLayer const): 27 (WebCore::VideoLayerManagerObjC::videoFullscreenLayer const): 28 (WebCore::VideoLayerManagerObjC::videoFullscreenFrame const): 29 (WebCore::VideoLayerManagerObjC::updateVideoFullscreenInlineImage): 30 Fix the issue when RELEASE_LOG_DISABLED is defined and add WEBCORE_EXPORT 31 to some functions. 32 1 33 2020-09-28 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> 2 34 -
trunk/Source/WebCore/Headers.cmake
r267697 r267725 1214 1214 platform/graphics/TabSize.h 1215 1215 platform/graphics/TextRun.h 1216 platform/graphics/TextTrackRepresentation.h 1216 1217 platform/graphics/TiledBacking.h 1217 1218 platform/graphics/TrackPrivateBase.h 1218 1219 platform/graphics/VelocityData.h 1220 platform/graphics/VideoLayerManager.h 1219 1221 platform/graphics/VideoTrackPrivate.h 1220 1222 platform/graphics/WidthCache.h -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r267697 r267725 631 631 1D2F8E062344752300993B68 /* PictureInPictureWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DEF06CD233C3D2A00EE228D /* PictureInPictureWindow.h */; settings = {ATTRIBUTES = (Private, ); }; }; 632 632 1D9F0FC12122029B005D8FD4 /* ShareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DC55400211BA8C8004B780E /* ShareData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 633 1DAB3112251D6BF300FC9485 /* WebVideoContainerLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B31A12379DC8300883FDE /* WebVideoContainerLayer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 634 1DAB3114251D725C00FC9485 /* VideoLayerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DAB3113251D725C00FC9485 /* VideoLayerManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; 635 1DAB3115251D74DB00FC9485 /* VideoLayerManagerObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = 52D5A18E1C54590300DE34A3 /* VideoLayerManagerObjC.h */; settings = {ATTRIBUTES = (Private, ); }; }; 633 636 1DBC1B562347B3D200B901AF /* PictureInPictureObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DBC1B552347B3D200B901AF /* PictureInPictureObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; 637 1DD3B4C6251DA0B80069B24A /* VideoLayerManagerObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52D5A18D1C54590300DE34A3 /* VideoLayerManagerObjC.mm */; }; 634 638 1DF7E81F251A9E0600DB8F61 /* TextTrackRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = CDD1E525167BA56400CE820B /* TextTrackRepresentation.h */; settings = {ATTRIBUTES = (Private, ); }; }; 635 639 1F36EA9C1E21BA1700621E25 /* WebBackgroundTaskController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F36EA9A1E21BA1700621E25 /* WebBackgroundTaskController.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1589 1593 52B0D4C01C57FD660077CE53 /* VideoFullscreenChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B0D4BF1C57FD660077CE53 /* VideoFullscreenChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1590 1594 52B0D4C21C57FF910077CE53 /* VideoFullscreenInterfaceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B0D4C11C57FF910077CE53 /* VideoFullscreenInterfaceMac.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1591 52D5A18F1C54592300DE34A3 /* VideoLayerManagerObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52D5A18D1C54590300DE34A3 /* VideoLayerManagerObjC.mm */; };1592 1595 52D5A1A71C57489D00DE34A3 /* VideoFullscreenModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 52D5A1A41C57488900DE34A3 /* VideoFullscreenModel.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1593 1596 52D5A1A81C5748A300DE34A3 /* VideoFullscreenModelVideoElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 52D5A1A51C57488900DE34A3 /* VideoFullscreenModelVideoElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 6728 6731 1D0026A92374F9D900CA6CDF /* JSEnterPictureInPictureEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEnterPictureInPictureEvent.cpp; sourceTree = "<group>"; }; 6729 6732 1D2C82B6236A3F6A0055D6C5 /* PictureInPictureSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PictureInPictureSupport.h; sourceTree = "<group>"; }; 6733 1DAB3113251D725C00FC9485 /* VideoLayerManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VideoLayerManager.h; sourceTree = "<group>"; }; 6730 6734 1DBC1B552347B3D200B901AF /* PictureInPictureObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PictureInPictureObserver.h; sourceTree = "<group>"; }; 6731 6735 1DC553FD211BA12A004B780E /* NavigatorShare.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorShare.idl; sourceTree = "<group>"; }; … … 8720 8724 52B0D4C11C57FF910077CE53 /* VideoFullscreenInterfaceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFullscreenInterfaceMac.h; sourceTree = "<group>"; }; 8721 8725 52CB11DB22FDDB2E009F0A64 /* WHLSLDefaultDelete.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLDefaultDelete.h; sourceTree = "<group>"; }; 8722 52D5A18D1C54590300DE34A3 /* VideoLayerManagerObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VideoLayerManagerObjC.mm; sourceTree = "<group>"; tabWidth = 8;};8723 52D5A18E1C54590300DE34A3 /* VideoLayerManagerObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLayerManagerObjC.h; sourceTree = "<group>"; tabWidth = 8;};8726 52D5A18D1C54590300DE34A3 /* VideoLayerManagerObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VideoLayerManagerObjC.mm; sourceTree = "<group>"; }; 8727 52D5A18E1C54590300DE34A3 /* VideoLayerManagerObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLayerManagerObjC.h; sourceTree = "<group>"; }; 8724 8728 52D5A1A41C57488900DE34A3 /* VideoFullscreenModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFullscreenModel.h; sourceTree = "<group>"; }; 8725 8729 52D5A1A51C57488900DE34A3 /* VideoFullscreenModelVideoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFullscreenModelVideoElement.h; sourceTree = "<group>"; }; … … 26197 26201 0F5A57CA229B18AE0025EDA9 /* VelocityData.cpp */, 26198 26202 0F1A0C36229A481800D37ADB /* VelocityData.h */, 26203 1DAB3113251D725C00FC9485 /* VideoLayerManager.h */, 26199 26204 BEF29EEA1715DD0900C4B4C9 /* VideoTrackPrivate.h */, 26200 26205 CD6FE5BB24BCE7B6009FCDA4 /* VP9Utilities.cpp */, … … 28496 28501 isa = PBXGroup; 28497 28502 children = ( 28498 E4A664C72521B779007081DC /* LayoutIntegrationRunIterator.cpp */,28499 E4A664C62521B778007081DC /* LayoutIntegrationRunIterator.h */,28500 E4A664C52521B778007081DC /* LayoutIntegrationRunIteratorLegacyPath.h */,28501 E4A664C42521B777007081DC /* LayoutIntegrationRunIteratorModernPath.h */,28502 28503 E418025623D454B500FFB071 /* LayoutIntegrationBoxTree.cpp */, 28503 28504 E418025323D4549A00FFB071 /* LayoutIntegrationBoxTree.h */, … … 28508 28509 E4312AB524B3265600678349 /* LayoutIntegrationPagination.cpp */, 28509 28510 E4312AB724B3265600678349 /* LayoutIntegrationPagination.h */, 28511 E4A664C72521B779007081DC /* LayoutIntegrationRunIterator.cpp */, 28512 E4A664C62521B778007081DC /* LayoutIntegrationRunIterator.h */, 28513 E4A664C52521B778007081DC /* LayoutIntegrationRunIteratorLegacyPath.h */, 28514 E4A664C42521B777007081DC /* LayoutIntegrationRunIteratorModernPath.h */, 28510 28515 ); 28511 28516 path = integration; … … 32448 32453 07969DB217D14151007FF842 /* JSRTCDTMFToneChangeEvent.h in Headers */, 32449 32454 07969DB617D14151007FF842 /* JSRTCIceCandidate.h in Headers */, 32450 E4A664CE2521D4C9007081DC /* LayoutIntegrationRunIteratorModernPath.h in Headers */,32451 32455 316DCB4C1E7910A6001B5F87 /* JSRTCIceConnectionState.h in Headers */, 32452 32456 316DCB4E1E7910A6001B5F87 /* JSRTCIceGatheringState.h in Headers */, … … 32494 32498 B59DD6A911902A71007E9684 /* JSSQLStatementErrorCallback.h in Headers */, 32495 32499 BC82432A0D0CE8A200460C8F /* JSSQLTransaction.h in Headers */, 32496 E4A664CC2521D4AF007081DC /* LayoutIntegrationRunIterator.h in Headers */,32497 32500 B59DD69D11902A42007E9684 /* JSSQLTransactionCallback.h in Headers */, 32498 32501 B59DD6A111902A52007E9684 /* JSSQLTransactionErrorCallback.h in Headers */, … … 32786 32789 E4ABABDD236088FE00FA4345 /* LayoutIntegrationLineLayout.h in Headers */, 32787 32790 E403B7A3251B11C10019E800 /* LayoutIntegrationPagination.h in Headers */, 32791 E4A664CC2521D4AF007081DC /* LayoutIntegrationRunIterator.h in Headers */, 32792 E4A664CF2521D4E2007081DC /* LayoutIntegrationRunIteratorLegacyPath.h in Headers */, 32793 E4A664CE2521D4C9007081DC /* LayoutIntegrationRunIteratorModernPath.h in Headers */, 32788 32794 11310CF420BA4A3D0065A8D0 /* LayoutIterator.h in Headers */, 32789 32795 6FFA4C0123F2FED9007E4EBC /* LayoutLineBreakBox.h in Headers */, … … 32964 32970 C96F5EC51B5872260091EA9D /* MediaSessionInterruptionProviderMac.h in Headers */, 32965 32971 C90F65561B2253BE002163A1 /* MediaSessionManager.h in Headers */, 32966 E4A664CF2521D4E2007081DC /* LayoutIntegrationRunIteratorLegacyPath.h in Headers */,32967 32972 417F7AEF2139BF6F00FBA7EC /* MediaSessionManagerCocoa.h in Headers */, 32968 32973 07638A991884487200E15A1B /* MediaSessionManagerIOS.h in Headers */, … … 34382 34387 52D5A1A71C57489D00DE34A3 /* VideoFullscreenModel.h in Headers */, 34383 34388 52D5A1A81C5748A300DE34A3 /* VideoFullscreenModelVideoElement.h in Headers */, 34389 1DAB3114251D725C00FC9485 /* VideoLayerManager.h in Headers */, 34390 1DAB3115251D74DB00FC9485 /* VideoLayerManagerObjC.h in Headers */, 34384 34391 CDE83DB2183C44060031EAA3 /* VideoPlaybackQuality.h in Headers */, 34385 34392 0757B13E214AE79900794B0D /* VideoPreset.h in Headers */, … … 34558 34565 31DEA4561B39F4D900F77178 /* WebSystemBackdropLayer.h in Headers */, 34559 34566 0F580FA31496939100FB5BD8 /* WebTiledBackingLayer.h in Headers */, 34567 1DAB3112251D6BF300FC9485 /* WebVideoContainerLayer.h in Headers */, 34560 34568 3F42B31D1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h in Headers */, 34561 34569 2D7DA0F22435EB1900F048D1 /* WebViewVisualIdentificationOverlay.h in Headers */, … … 35826 35834 7C73FB07191EF417007DE061 /* UserMessageHandlersNamespace.cpp in Sources */, 35827 35835 3FBC4AF3189881560046EE38 /* VideoFullscreenInterfaceAVKit.mm in Sources */, 35828 52D5A18F1C54592300DE34A3/* VideoLayerManagerObjC.mm in Sources */,35836 1DD3B4C6251DA0B80069B24A /* VideoLayerManagerObjC.mm in Sources */, 35829 35837 CD336F6717FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp in Sources */, 35830 35838 CD8B5A42180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm in Sources */, -
trunk/Source/WebCore/platform/graphics/TextTrackRepresentation.cpp
r262695 r267725 25 25 26 26 #include "config.h" 27 #include "TextTrackRepresentation.h" 27 28 28 29 #if ENABLE(VIDEO) 29 30 #include "TextTrackRepresentation.h"31 30 32 31 #include "IntRect.h" -
trunk/Source/WebCore/platform/graphics/TextTrackRepresentation.h
r262695 r267725 24 24 */ 25 25 26 #ifndef TextTrackRepresentation_h 27 #define TextTrackRepresentation_h 26 #pragma once 28 27 29 28 #if ENABLE(VIDEO) … … 62 61 63 62 #endif 64 65 #endif // TextTrackRepresentation_h -
trunk/Source/WebCore/platform/graphics/VideoLayerManager.h
r267724 r267725 1 1 /* 2 * Copyright (C) 20 12Apple Inc. All rights reserved.2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #ifndef TextTrackRepresentation_h 27 #define TextTrackRepresentation_h 26 #pragma once 28 27 29 #if ENABLE(VIDEO) 30 28 #include "NativeImage.h" 31 29 #include "PlatformLayer.h" 32 #include <wtf/F orward.h>30 #include <wtf/Function.h> 33 31 34 32 namespace WebCore { 35 33 36 class Image;37 class Int Rect;34 class FloatRect; 35 class IntSize; 38 36 39 class TextTrackRepresentationClient{37 class VideoLayerManager { 40 38 public: 41 virtual ~ TextTrackRepresentationClient() = default;39 virtual ~VideoLayerManager() = default; 42 40 43 virtual RefPtr<Image> createTextTrackRepresentationImage()= 0;44 virtual void textTrackRepresentationBoundsChanged(const IntRect&) = 0;45 };41 virtual PlatformLayer* videoInlineLayer() const = 0; 42 virtual void setVideoLayer(PlatformLayer*, IntSize) = 0; 43 virtual void didDestroyVideoLayer() = 0; 46 44 47 class TextTrackRepresentation { 48 WTF_MAKE_FAST_ALLOCATED; 49 public: 50 static std::unique_ptr<TextTrackRepresentation> create(TextTrackRepresentationClient&); 45 #if ENABLE(VIDEO_PRESENTATION_MODE) 46 virtual PlatformLayer* videoFullscreenLayer() const = 0; 47 virtual void setVideoFullscreenLayer(PlatformLayer*, WTF::Function<void()>&& completionHandler, NativeImagePtr) = 0; 48 virtual FloatRect videoFullscreenFrame() const = 0; 49 virtual void setVideoFullscreenFrame(FloatRect) = 0; 50 virtual void updateVideoFullscreenInlineImage(NativeImagePtr) = 0; 51 #endif 51 52 52 virtual ~TextTrackRepresentation() = default; 53 54 virtual void update() = 0; 55 virtual PlatformLayer* platformLayer() = 0; 56 virtual void setContentScale(float) = 0; 57 virtual IntRect bounds() const = 0; 58 virtual void setHidden(bool) const = 0; 53 virtual bool requiresTextTrackRepresentation() const = 0; 54 virtual void setTextTrackRepresentationLayer(PlatformLayer*) = 0; 55 virtual void syncTextTrackBounds() = 0; 59 56 }; 60 57 61 58 } 62 63 #endif64 65 #endif // TextTrackRepresentation_h -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h
r267573 r267725 30 30 #include "NativeImage.h" 31 31 #include "PlatformLayer.h" 32 #include "VideoLayerManager.h" 32 33 #include "WebVideoContainerLayer.h" 33 34 #include <wtf/Function.h> … … 38 39 namespace WebCore { 39 40 40 class TextTrackRepresentation; 41 42 class VideoLayerManagerObjC final : public LoggerHelper { 41 class VideoLayerManagerObjC final 42 : public VideoLayerManager 43 #if !RELEASE_LOG_DISABLED 44 , public LoggerHelper 45 #endif 46 { 43 47 WTF_MAKE_NONCOPYABLE(VideoLayerManagerObjC); 44 48 WTF_MAKE_FAST_ALLOCATED; 49 45 50 public: 46 VideoLayerManagerObjC(const Logger&, const void*); 51 #if !RELEASE_LOG_DISABLED 52 WEBCORE_EXPORT VideoLayerManagerObjC(const Logger&, const void*); 53 #else 54 WEBCORE_EXPORT VideoLayerManagerObjC() = default; 55 #endif 47 56 48 PlatformLayer *videoInlineLayer() const { return m_videoInlineLayer.get(); }57 ~VideoLayerManagerObjC() = default; 49 58 50 void setVideoLayer(PlatformLayer *, IntSize contentSize); 51 void didDestroyVideoLayer(); 59 WEBCORE_EXPORT PlatformLayer* videoInlineLayer() const final; 60 61 WEBCORE_EXPORT void setVideoLayer(PlatformLayer*, IntSize contentSize) final; 62 WEBCORE_EXPORT void didDestroyVideoLayer() final; 52 63 53 64 #if ENABLE(VIDEO_PRESENTATION_MODE) 54 PlatformLayer *videoFullscreenLayer() const { return m_videoFullscreenLayer.get(); }55 void setVideoFullscreenLayer(PlatformLayer *, WTF::Function<void()>&& completionHandler, NativeImagePtr);56 FloatRect videoFullscreenFrame() const { return m_videoFullscreenFrame; }57 void setVideoFullscreenFrame(FloatRect);58 void updateVideoFullscreenInlineImage(NativeImagePtr);65 WEBCORE_EXPORT PlatformLayer* videoFullscreenLayer() const final; 66 WEBCORE_EXPORT void setVideoFullscreenLayer(PlatformLayer*, WTF::Function<void()>&& completionHandler, NativeImagePtr) final; 67 WEBCORE_EXPORT FloatRect videoFullscreenFrame() const final; 68 WEBCORE_EXPORT void setVideoFullscreenFrame(FloatRect) final; 69 WEBCORE_EXPORT void updateVideoFullscreenInlineImage(NativeImagePtr) final; 59 70 #endif 60 71 61 bool requiresTextTrackRepresentation() const;62 void setTextTrackRepresentationLayer(PlatformLayer*);63 void syncTextTrackBounds();72 WEBCORE_EXPORT bool requiresTextTrackRepresentation() const final; 73 WEBCORE_EXPORT void setTextTrackRepresentationLayer(PlatformLayer*) final; 74 WEBCORE_EXPORT void syncTextTrackBounds() final; 64 75 65 76 private: 77 78 #if !RELEASE_LOG_DISABLED 66 79 const Logger& logger() const final { return m_logger.get(); } 67 80 const void* logIdentifier() const final { return m_logIdentifier; } … … 71 84 Ref<const Logger> m_logger; 72 85 const void* m_logIdentifier; 86 #endif 73 87 74 88 RetainPtr<WebVideoContainerLayer> m_videoInlineLayer; -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm
r267573 r267725 44 44 namespace WebCore { 45 45 46 #if !RELEASE_LOG_DISABLED 46 47 VideoLayerManagerObjC::VideoLayerManagerObjC(const Logger& logger, const void* logIdentifier) 47 48 : m_logger(logger) 48 49 , m_logIdentifier(logIdentifier) 49 50 { 51 } 52 #endif 53 54 PlatformLayer* VideoLayerManagerObjC::videoInlineLayer() const 55 { 56 return m_videoInlineLayer.get(); 50 57 } 51 58 … … 88 95 #if ENABLE(VIDEO_PRESENTATION_MODE) 89 96 90 void VideoLayerManagerObjC::updateVideoFullscreenInlineImage(NativeImagePtr image) 91 { 92 if (m_videoInlineLayer) 93 [m_videoInlineLayer setContents:(__bridge id)image.get()]; 97 PlatformLayer* VideoLayerManagerObjC::videoFullscreenLayer() const 98 { 99 return m_videoFullscreenLayer.get(); 94 100 } 95 101 … … 141 147 } 142 148 149 FloatRect VideoLayerManagerObjC::videoFullscreenFrame() const 150 { 151 return m_videoFullscreenFrame; 152 } 153 143 154 void VideoLayerManagerObjC::setVideoFullscreenFrame(FloatRect videoFullscreenFrame) 144 155 { … … 151 162 [m_videoLayer setFrame:m_videoFullscreenFrame]; 152 163 syncTextTrackBounds(); 164 } 165 166 void VideoLayerManagerObjC::updateVideoFullscreenInlineImage(NativeImagePtr image) 167 { 168 if (m_videoInlineLayer) 169 [m_videoInlineLayer setContents:(__bridge id)image.get()]; 153 170 } 154 171 -
trunk/Source/WebKit/ChangeLog
r267713 r267725 1 2020-09-28 Peng Liu <peng.liu6@apple.com> 2 3 [Media in GPU Process] Use VideoLayerManager to manage layers of MediaPlayerPrivateRemote 4 https://bugs.webkit.org/show_bug.cgi?id=216995 5 6 Reviewed by Eric Carlson. 7 8 This patch removes the remote hosting layer in the GPU process for video fullscreen and 9 picture-in-picture. We don't need to keep a layer in the GPU process for video fullscreen 10 and picture-in-picture because no rendering will be done for that layer. We don't need 11 EnterFullscreen, ExitFullscreen and SetVideoFullscreenFrameFenced IPC messages after removing 12 the layer because the RemoteMediaPlayerPrivateRemote in the web process can deal with 13 the video presentation mode change. 14 15 * GPUProcess/media/RemoteMediaPlayerProxy.h: 16 * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: 17 * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm: 18 (WebKit::RemoteMediaPlayerProxy::prepareForPlayback): 19 (WebKit::RemoteMediaPlayerProxy::enterFullscreen): Deleted. 20 (WebKit::RemoteMediaPlayerProxy::exitFullscreen): Deleted. 21 (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenFrameFenced): Deleted. 22 Remove unused IPC messages after removing the remote hosting layer for video fullscreen 23 and picture-in-picture. 24 25 * GPUProcess/media/gstreamer/RemoteMediaPlayerProxyGStreamer.cpp: 26 (WebKit::RemoteMediaPlayerProxy::prepareForPlayback): 27 (WebKit::RemoteMediaPlayerProxy::enterFullscreen): Deleted. 28 (WebKit::RemoteMediaPlayerProxy::exitFullscreen): Deleted. 29 Ditto. 30 31 * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: 32 (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): 33 (WebKit::MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote): 34 (WebKit::MediaPlayerPrivateRemote::prepareForPlayback): 35 Remove the code related to the remote hosting layer for video fullscreen and picture-in-picture. 36 (WebKit::MediaPlayerPrivateRemote::platformLayer const): 37 (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenLayer): 38 Use VideoLayerManager to manage the layer. 39 (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame): Ditto. 40 (WebKit::MediaPlayerPrivateRemote::requiresTextTrackRepresentation const): Ditto. 41 (WebKit::MediaPlayerPrivateRemote::setTextTrackRepresentation): Ditto. 42 (WebKit::MediaPlayerPrivateRemote::syncTextTrackBounds): Ditto. 43 (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrameFenced): Deleted. 44 * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: 45 Need to move the Logger up in the data members so that other members can use it 46 in the constructor, e.g., VideoLayerManager. 47 48 * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm: 49 (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): 50 (WebKit::MediaPlayerPrivateRemote::createVideoFullscreenLayer): 51 (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame): Deleted. 52 (WebKit::MediaPlayerPrivateRemote::setTextTrackRepresentation): Deleted. 53 (WebKit::MediaPlayerPrivateRemote::syncTextTrackBounds): Deleted. 54 Simplify the implementation by managing layers with VideoLayerManager. 55 1 56 2020-09-28 Eric Carlson <eric.carlson@apple.com> 2 57 -
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
r267491 r267725 101 101 void getConfiguration(RemoteMediaPlayerConfiguration&); 102 102 103 void prepareForPlayback(bool privateMode, WebCore::MediaPlayerEnums::Preload, bool preservesPitch, bool prepareForRendering, float videoContentScale, CompletionHandler<void(Optional<LayerHostingContextID>&& inlineLayerHostingContextId , Optional<LayerHostingContextID>&& fullscreenLayerHostingContextId)>&&);103 void prepareForPlayback(bool privateMode, WebCore::MediaPlayerEnums::Preload, bool preservesPitch, bool prepareForRendering, float videoContentScale, CompletionHandler<void(Optional<LayerHostingContextID>&& inlineLayerHostingContextId)>&&); 104 104 void prepareForRendering(); 105 105 … … 125 125 void setShouldMaintainAspectRatio(bool); 126 126 #if ENABLE(VIDEO_PRESENTATION_MODE) 127 void enterFullscreen(CompletionHandler<void()>&&);128 void exitFullscreen(CompletionHandler<void()>&&);129 127 void setVideoFullscreenGravity(WebCore::MediaPlayerEnums::VideoGravity); 130 128 #endif … … 139 137 #if PLATFORM(COCOA) 140 138 void setVideoInlineSizeFenced(const WebCore::IntSize&, const WTF::MachSendRight&); 141 #if ENABLE(VIDEO_PRESENTATION_MODE)142 void setVideoFullscreenFrameFenced(const WebCore::FloatRect&, const WTF::MachSendRight&);143 #endif144 139 #endif 145 140 -
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
r267491 r267725 25 25 26 26 messages -> RemoteMediaPlayerProxy NotRefCounted { 27 PrepareForPlayback(bool privateMode, enum:uint8_t WebCore::MediaPlayerEnums::Preload preload, bool preservesPitch, bool prepareForRendering, float videoContentScale) -> (Optional<WebKit::LayerHostingContextID> inlineLayerHostingContextId , Optional<WebKit::LayerHostingContextID> fullscreenLayerHostingContextId) Async27 PrepareForPlayback(bool privateMode, enum:uint8_t WebCore::MediaPlayerEnums::Preload preload, bool preservesPitch, bool prepareForRendering, float videoContentScale) -> (Optional<WebKit::LayerHostingContextID> inlineLayerHostingContextId) Async 28 28 29 29 Load(URL url, Optional<WebKit::SandboxExtension::Handle> sandboxExtension, WebCore::ContentType contentType, String keySystem) -> (struct WebKit::RemoteMediaPlayerConfiguration playerConfiguration) Async … … 69 69 #if PLATFORM(COCOA) 70 70 SetVideoInlineSizeFenced(WebCore::IntSize size, MachSendRight machSendRight) 71 #if ENABLE(VIDEO_PRESENTATION_MODE)72 SetVideoFullscreenFrameFenced(WebCore::FloatRect rect, MachSendRight machSendRight)73 #endif74 #endif75 76 #if ENABLE(VIDEO_PRESENTATION_MODE)77 EnterFullscreen() -> () Async78 ExitFullscreen() -> () Async79 71 #endif 80 72 -
trunk/Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm
r260412 r267725 37 37 namespace WebKit { 38 38 39 void RemoteMediaPlayerProxy::prepareForPlayback(bool privateMode, WebCore::MediaPlayerEnums::Preload preload, bool preservesPitch, bool prepareForRendering, float videoContentScale, CompletionHandler<void(Optional<LayerHostingContextID>&& inlineLayerHostingContextId , Optional<LayerHostingContextID>&& fullscreenLayerHostingContextId)>&& completionHandler)39 void RemoteMediaPlayerProxy::prepareForPlayback(bool privateMode, WebCore::MediaPlayerEnums::Preload preload, bool preservesPitch, bool prepareForRendering, float videoContentScale, CompletionHandler<void(Optional<LayerHostingContextID>&& inlineLayerHostingContextId)>&& completionHandler) 40 40 { 41 41 m_player->setPrivateBrowsingMode(privateMode); … … 46 46 if (!m_inlineLayerHostingContext) 47 47 m_inlineLayerHostingContext = LayerHostingContext::createForExternalHostingProcess(); 48 #if ENABLE(VIDEO_PRESENTATION_MODE) 49 if (!m_fullscreenLayerHostingContext) 50 m_fullscreenLayerHostingContext = LayerHostingContext::createForExternalHostingProcess(); 51 completionHandler(m_inlineLayerHostingContext->contextID(), m_fullscreenLayerHostingContext->contextID()); 52 #endif 48 completionHandler(m_inlineLayerHostingContext->contextID()); 53 49 } 54 50 … … 75 71 } 76 72 77 #if ENABLE(VIDEO_PRESENTATION_MODE)78 void RemoteMediaPlayerProxy::enterFullscreen(CompletionHandler<void()>&& completionHandler)79 {80 auto videoFullscreenLayer = m_player->createVideoFullscreenLayer();81 [videoFullscreenLayer setName:@"Web Video Fullscreen Layer (remote)"];82 [videoFullscreenLayer setPosition:CGPointZero];83 m_fullscreenLayerHostingContext->setRootLayer(videoFullscreenLayer.get());84 85 m_player->setVideoFullscreenLayer(videoFullscreenLayer.get(), WTFMove(completionHandler));86 }87 88 void RemoteMediaPlayerProxy::exitFullscreen(CompletionHandler<void()>&& completionHandler)89 {90 m_player->setVideoFullscreenLayer(nullptr, WTFMove(completionHandler));91 m_fullscreenLayerHostingContext->setRootLayer(nullptr);92 }93 94 void RemoteMediaPlayerProxy::setVideoFullscreenFrameFenced(const WebCore::FloatRect& rect, const WTF::MachSendRight& machSendRight)95 {96 m_fullscreenLayerHostingContext->setFencePort(machSendRight.sendRight());97 m_player->setVideoFullscreenFrame(rect);98 }99 #endif100 101 73 } // namespace WebKit 102 74 -
trunk/Source/WebKit/GPUProcess/media/gstreamer/RemoteMediaPlayerProxyGStreamer.cpp
r260899 r267725 34 34 namespace WebKit { 35 35 36 void RemoteMediaPlayerProxy::prepareForPlayback(bool, WebCore::MediaPlayerEnums::Preload, bool, bool, float videoContentScale, CompletionHandler<void(Optional<LayerHostingContextID>&& inlineLayerHostingContextId , Optional<LayerHostingContextID>&& fullscreenLayerHostingContextId)>&&)36 void RemoteMediaPlayerProxy::prepareForPlayback(bool, WebCore::MediaPlayerEnums::Preload, bool, bool, float videoContentScale, CompletionHandler<void(Optional<LayerHostingContextID>&& inlineLayerHostingContextId)>&&) 37 37 { 38 38 notImplemented(); … … 49 49 } 50 50 51 #if ENABLE(VIDEO_PRESENTATION_MODE)52 void RemoteMediaPlayerProxy::enterFullscreen(CompletionHandler<void()>&& completionHandler)53 {54 notImplemented();55 }56 57 void RemoteMediaPlayerProxy::exitFullscreen(CompletionHandler<void()>&& completionHandler)58 {59 notImplemented();60 }61 #endif62 63 51 } // namespace WebKit 64 52 -
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
r267491 r267725 25 25 26 26 #include "config.h" 27 #include "MediaPlayerPrivateRemote.h" 27 28 28 29 #if ENABLE(GPU_PROCESS) 29 #include "MediaPlayerPrivateRemote.h" 30 31 #include "AudioTrackPrivateRemote.h" 30 32 31 #include "Logging.h" 33 32 #include "RemoteLegacyCDM.h" … … 37 36 #include "RemoteMediaPlayerProxyMessages.h" 38 37 #include "SandboxExtension.h" 39 #include "TextTrackPrivateRemote.h"40 38 #include "VideoLayerRemote.h" 41 #include "VideoTrackPrivateRemote.h"42 39 #include "WebCoreArgumentCoders.h" 43 40 #include "WebProcess.h" … … 49 46 #include <WebCore/PlatformTimeRanges.h> 50 47 #include <WebCore/ResourceError.h> 48 #include <WebCore/TextTrackRepresentation.h> 49 #include <WebCore/VideoLayerManager.h> 51 50 #include <wtf/HashMap.h> 52 51 #include <wtf/MachSendRight.h> … … 92 91 #endif 93 92 93 #if !PLATFORM(COCOA) 94 94 MediaPlayerPrivateRemote::MediaPlayerPrivateRemote(MediaPlayer* player, MediaPlayerEnums::MediaEngineIdentifier engineIdentifier, MediaPlayerPrivateRemoteIdentifier playerIdentifier, RemoteMediaPlayerManager& manager) 95 : m_player(player) 96 , m_mediaResourceLoader(player->createResourceLoader()) 95 #if !RELEASE_LOG_DISABLED 96 : m_logger(player->mediaPlayerLogger()) 97 , m_logIdentifier(player->mediaPlayerLogIdentifier()) 98 #endif 99 , m_player(player) 100 , m_mediaResourceLoader(*player->createResourceLoader()) 97 101 , m_manager(manager) 98 102 , m_remoteEngineIdentifier(engineIdentifier) 99 103 , m_id(playerIdentifier) 100 #if !RELEASE_LOG_DISABLED101 , m_logger(&player->mediaPlayerLogger())102 , m_logIdentifier(player->mediaPlayerLogIdentifier())103 #endif104 104 { 105 105 INFO_LOG(LOGIDENTIFIER); 106 } 107 #endif 108 109 MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote() 110 { 111 INFO_LOG(LOGIDENTIFIER); 112 #if PLATFORM(COCOA) 113 m_videoLayerManager->didDestroyVideoLayer(); 114 #endif 115 m_manager.deleteRemoteMediaPlayer(m_id); 106 116 } 107 117 … … 113 123 } 114 124 115 MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote()116 {117 INFO_LOG(LOGIDENTIFIER);118 m_manager.deleteRemoteMediaPlayer(m_id);119 }120 121 125 void MediaPlayerPrivateRemote::prepareForPlayback(bool privateMode, MediaPlayer::Preload preload, bool preservesPitch, bool prepare) 122 126 { 123 127 auto scale = m_player->playerContentsScale(); 124 128 125 connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::PrepareForPlayback(privateMode, preload, preservesPitch, prepare, scale), [weakThis = makeWeakPtr(*this), this](auto inlineLayerHostingContextId , auto fullscreenLayerHostingContextId) mutable {129 connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::PrepareForPlayback(privateMode, preload, preservesPitch, prepare, scale), [weakThis = makeWeakPtr(*this), this](auto inlineLayerHostingContextId) mutable { 126 130 if (!weakThis) 127 131 return; … … 130 134 return; 131 135 132 m_video InlineLayer = createVideoLayerRemote(this, inlineLayerHostingContextId.value());133 #if ENABLE(VIDEO_PRESENTATION_MODE)134 m_ fullscreenLayerHostingContextId = fullscreenLayerHostingContextId;136 m_videoLayer = createVideoLayerRemote(this, inlineLayerHostingContextId.value()); 137 #if PLATFORM(COCOA) 138 m_videoLayerManager->setVideoLayer(m_videoLayer.get(), snappedIntRect(m_player->playerContentBoxRect()).size()); 135 139 #endif 136 140 }, m_id); … … 644 648 PlatformLayer* MediaPlayerPrivateRemote::platformLayer() const 645 649 { 646 return m_videoInlineLayer.get(); 650 #if PLATFORM(COCOA) 651 return m_videoLayerManager->videoInlineLayer(); 652 #else 653 return nullptr; 654 #endif 647 655 } 648 656 … … 651 659 void MediaPlayerPrivateRemote::setVideoFullscreenLayer(PlatformLayer* videoFullscreenLayer, WTF::Function<void()>&& completionHandler) 652 660 { 653 if (!videoFullscreenLayer) { 654 connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::ExitFullscreen(), [this, weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)]() mutable { 655 if (!weakThis) 656 return; 657 658 m_requiresTextTrackRepresentation = false; 659 completionHandler(); 660 }, m_id); 661 return; 662 } 663 664 ASSERT(m_videoFullscreenLayer.get() == videoFullscreenLayer); 665 connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::EnterFullscreen(), [this, weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)]() mutable { 666 if (!weakThis) 667 return; 668 669 m_requiresTextTrackRepresentation = true; 670 completionHandler(); 671 }, m_id); 661 #if PLATFORM(COCOA) 662 m_videoLayerManager->setVideoFullscreenLayer(videoFullscreenLayer, WTFMove(completionHandler), nullptr); 663 #endif 672 664 } 673 665 … … 677 669 } 678 670 679 void MediaPlayerPrivateRemote::setVideoFullscreenFrameFenced(const WebCore::FloatRect& rect, const WTF::MachSendRight& sendRight) 680 { 681 connection().send(Messages::RemoteMediaPlayerProxy::SetVideoFullscreenFrameFenced(rect, sendRight), m_id); 671 void MediaPlayerPrivateRemote::setVideoFullscreenFrame(WebCore::FloatRect rect) 672 { 673 #if PLATFORM(COCOA) 674 ALWAYS_LOG(LOGIDENTIFIER, "width = ", rect.size().width(), ", height = ", rect.size().height()); 675 m_videoLayerManager->setVideoFullscreenFrame(rect); 676 #endif 682 677 } 683 678 … … 1022 1017 #endif 1023 1018 1019 bool MediaPlayerPrivateRemote::requiresTextTrackRepresentation() const 1020 { 1021 #if PLATFORM(COCOA) 1022 return m_videoLayerManager->requiresTextTrackRepresentation(); 1023 #else 1024 return false; 1025 #endif 1026 } 1027 1028 void MediaPlayerPrivateRemote::setTextTrackRepresentation(WebCore::TextTrackRepresentation* representation) 1029 { 1030 #if PLATFORM(COCOA) 1031 auto* representationLayer = representation ? representation->platformLayer() : nil; 1032 m_videoLayerManager->setTextTrackRepresentationLayer(representationLayer); 1033 #endif 1034 } 1035 1036 void MediaPlayerPrivateRemote::syncTextTrackBounds() 1037 { 1038 #if PLATFORM(COCOA) 1039 m_videoLayerManager->syncTextTrackBounds(); 1040 #endif 1041 } 1042 1024 1043 void MediaPlayerPrivateRemote::tracksChanged() 1025 1044 { -
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
r267491 r267725 28 28 #if ENABLE(GPU_PROCESS) 29 29 30 #include "AudioTrackPrivateRemote.h" 30 31 #include "LayerHostingContext.h" 31 32 #include "RemoteMediaPlayerConfiguration.h" … … 34 35 #include "RemoteMediaResourceIdentifier.h" 35 36 #include "RemoteMediaResourceProxy.h" 37 #include "TextTrackPrivateRemote.h" 36 38 #include "TrackPrivateRemoteIdentifier.h" 39 #include "VideoTrackPrivateRemote.h" 37 40 #include <WebCore/MediaPlayerPrivate.h> 38 41 #include <WebCore/SecurityOriginData.h> … … 49 52 class ISOWebVTTCue; 50 53 class SerializedPlatformDataCueValue; 51 class TextTrackRepresentation;54 class VideoLayerManager; 52 55 } 53 56 54 57 namespace WebKit { 55 58 56 class AudioTrackPrivateRemote;57 class TextTrackPrivateRemote;58 59 class UserData; 59 class VideoTrackPrivateRemote;60 60 struct TextTrackPrivateRemoteConfiguration; 61 61 struct TrackPrivateRemoteConfiguration; … … 102 102 #if PLATFORM(COCOA) 103 103 void setVideoInlineSizeFenced(const WebCore::IntSize&, const WTF::MachSendRight&); 104 void setVideoFullscreenFrameFenced(const WebCore::FloatRect&, const WTF::MachSendRight&);105 104 #endif 106 105 … … 150 149 #endif 151 150 151 private: 152 152 153 #if !RELEASE_LOG_DISABLED 153 const Logger& logger() const final { return *m_logger; }154 const Logger& logger() const final { return m_logger; } 154 155 const char* logClassName() const override { return "MediaPlayerPrivateRemote"; } 155 156 const void* logIdentifier() const final { return reinterpret_cast<const void*>(m_logIdentifier); } 156 157 WTFLogChannel& logChannel() const final; 157 #endif 158 159 private: 158 159 Ref<const Logger> m_logger; 160 const void* m_logIdentifier; 161 #endif 162 160 163 void load(const URL&, const WebCore::ContentType&, const String&) final; 161 164 void prepareForPlayback(bool privateMode, WebCore::MediaPlayer::Preload, bool preservesPitch, bool prepare) final; … … 325 328 #endif 326 329 327 bool requiresTextTrackRepresentation() const final { return m_requiresTextTrackRepresentation; } 328 #if PLATFORM(COCOA) 330 bool requiresTextTrackRepresentation() const final; 329 331 void setTextTrackRepresentation(WebCore::TextTrackRepresentation*) final; 330 332 void syncTextTrackBounds() final; 331 #endif 333 332 334 void tracksChanged() final; 333 335 … … 359 361 360 362 WebCore::MediaPlayer* m_player { nullptr }; 361 RefPtr<WebCore::PlatformMediaResourceLoader> m_mediaResourceLoader; 362 bool m_requiresTextTrackRepresentation { false }; 363 PlatformLayerContainer m_videoInlineLayer; 364 PlatformLayerContainer m_videoFullscreenLayer; 363 Ref<WebCore::PlatformMediaResourceLoader> m_mediaResourceLoader; 365 364 #if PLATFORM(COCOA) 366 RetainPtr<PlatformLayer> m_textTrackRepresentationLayer; 367 #endif 368 Optional<LayerHostingContextID> m_fullscreenLayerHostingContextId; 365 UniqueRef<WebCore::VideoLayerManager> m_videoLayerManager; 366 #endif 367 PlatformLayerContainer m_videoLayer; 368 369 369 RemoteMediaPlayerManager& m_manager; 370 370 WebCore::MediaPlayerEnums::MediaEngineIdentifier m_remoteEngineIdentifier; … … 389 389 bool m_seeking { false }; 390 390 bool m_isCurrentPlaybackTargetWireless { false }; 391 392 #if !RELEASE_LOG_DISABLED393 RefPtr<const Logger> m_logger;394 const void* m_logIdentifier;395 #endif396 397 391 bool m_invalid { false }; 398 392 }; -
trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm
r267491 r267725 29 29 #if ENABLE(GPU_PROCESS) && PLATFORM(COCOA) 30 30 31 #import <WebCore/FloatRect.h> 32 #import <WebCore/TextTrackRepresentation.h> 31 #import <WebCore/VideoLayerManagerObjC.h> 33 32 #import <pal/spi/cocoa/QuartzCoreSPI.h> 34 #import <wtf/MachSendRight.h>35 33 36 34 namespace WebKit { 35 using namespace WebCore; 36 37 MediaPlayerPrivateRemote::MediaPlayerPrivateRemote(MediaPlayer* player, MediaPlayerEnums::MediaEngineIdentifier engineIdentifier, MediaPlayerPrivateRemoteIdentifier playerIdentifier, RemoteMediaPlayerManager& manager) 38 #if !RELEASE_LOG_DISABLED 39 : m_logger(player->mediaPlayerLogger()) 40 , m_logIdentifier(player->mediaPlayerLogIdentifier()) 41 #endif 42 , m_player(player) 43 , m_mediaResourceLoader(*player->createResourceLoader()) 44 , m_videoLayerManager(makeUniqueRef<VideoLayerManagerObjC>(logger(), logIdentifier())) 45 , m_manager(manager) 46 , m_remoteEngineIdentifier(engineIdentifier) 47 , m_id(playerIdentifier) 48 { 49 INFO_LOG(LOGIDENTIFIER); 50 } 37 51 38 52 #if ENABLE(VIDEO_PRESENTATION_MODE) 39 40 53 PlatformLayerContainer MediaPlayerPrivateRemote::createVideoFullscreenLayer() 41 54 { 42 if (!m_fullscreenLayerHostingContextId) 43 return nullptr; 44 45 if (!m_videoFullscreenLayer) { 46 m_videoFullscreenLayer = adoptNS([[CALayer alloc] init]); 47 auto sublayer = LayerHostingContext::createPlatformLayerForHostingContext(m_fullscreenLayerHostingContextId.value()); 48 [sublayer setName:@"VideoFullscreenLayerSublayer"]; 49 [sublayer setPosition:CGPointMake(0, 0)]; 50 [m_videoFullscreenLayer addSublayer:sublayer.get()]; 51 } 52 53 return m_videoFullscreenLayer; 55 return adoptNS([[CALayer alloc] init]); 54 56 } 55 56 void MediaPlayerPrivateRemote::setVideoFullscreenFrame(WebCore::FloatRect rect)57 {58 auto context = [m_videoFullscreenLayer context];59 if (!context)60 return;61 62 [CATransaction begin];63 [CATransaction setDisableActions:YES];64 65 MachSendRight fenceSendRight = MachSendRight::adopt([context createFencePort]);66 setVideoFullscreenFrameFenced(rect, fenceSendRight);67 68 [CATransaction commit];69 70 syncTextTrackBounds();71 }72 73 57 #endif 74 75 void MediaPlayerPrivateRemote::setTextTrackRepresentation(WebCore::TextTrackRepresentation* representation)76 {77 #if !ENABLE(VIDEO_PRESENTATION_MODE)78 UNUSED_PARAM(representation);79 #else80 PlatformLayer* representationLayer = representation ? representation->platformLayer() : nil;81 82 if (representationLayer == m_textTrackRepresentationLayer) {83 syncTextTrackBounds();84 return;85 }86 87 [CATransaction begin];88 [CATransaction setDisableActions:YES];89 90 if (m_textTrackRepresentationLayer)91 [m_textTrackRepresentationLayer removeFromSuperlayer];92 93 m_textTrackRepresentationLayer = representationLayer;94 95 if (m_videoFullscreenLayer && m_textTrackRepresentationLayer) {96 syncTextTrackBounds();97 [m_videoFullscreenLayer addSublayer:m_textTrackRepresentationLayer.get()];98 }99 100 [CATransaction commit];101 #endif102 }103 104 void MediaPlayerPrivateRemote::syncTextTrackBounds()105 {106 #if ENABLE(VIDEO_PRESENTATION_MODE)107 if (!m_videoFullscreenLayer || !m_textTrackRepresentationLayer)108 return;109 110 [CATransaction begin];111 [CATransaction setDisableActions:YES];112 113 [m_textTrackRepresentationLayer setFrame:m_videoFullscreenLayer.get().bounds];114 115 [CATransaction commit];116 #endif117 }118 58 119 59 } // namespace WebKit
Note:
See TracChangeset
for help on using the changeset viewer.