Changeset 267491 in webkit
- Timestamp:
- Sep 23, 2020, 11:45:11 AM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 14 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/WebCore.xcodeproj/project.pbxproj (modified) (2 diffs)
-
WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (modified) (1 diff)
-
WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (modified) (1 diff)
-
WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h (modified) (2 diffs)
-
WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp (modified) (1 diff)
-
WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h (modified) (1 diff)
-
WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in (modified) (1 diff)
-
WebKit/WebProcess/GPU/GPUProcessConnection.cpp (modified) (2 diffs)
-
WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp (modified) (2 diffs)
-
WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h (modified) (3 diffs)
-
WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267486 r267491 1 2020-09-23 Peng Liu <peng.liu6@apple.com> 2 3 [Media in GPU Process] Implement caption support in video fullscreen and PiP 4 https://bugs.webkit.org/show_bug.cgi?id=208752 5 6 Reviewed by Eric Carlson. 7 8 Export TextTrackRepresentation so that WebKit can use it. Also, update the 9 interface of VideoLayerManagerObjC related to text track representation to 10 use PlatformLayer* instead of TextTrackRepresentation*. 11 12 Manually tested. 13 14 * WebCore.xcodeproj/project.pbxproj: 15 Change target membership of TextTrackRepresentation.h. 16 17 * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h: 18 * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: 19 (WebCore::VideoLayerManagerObjC::setTextTrackRepresentationLayer): 20 (WebCore::VideoLayerManagerObjC::setTextTrackRepresentation): Deleted. 21 Replace setTextTrackRepresentation() with setTextTrackRepresentationLayer(). 22 23 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 24 (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation): 25 Use VideoLayerManagerObjC::setTextTrackRepresentationLayer() instead of 26 VideoLayerManagerObjC::setTextTrackRepresentation(). 27 28 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: 29 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation): Ditto. 30 1 31 2020-09-23 Chris Dumez <cdumez@apple.com> 2 32 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r267472 r267491 635 635 1D9F0FC12122029B005D8FD4 /* ShareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DC55400211BA8C8004B780E /* ShareData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 636 636 1DBC1B562347B3D200B901AF /* PictureInPictureObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DBC1B552347B3D200B901AF /* PictureInPictureObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; 637 1DF7E81F251A9E0600DB8F61 /* TextTrackRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = CDD1E525167BA56400CE820B /* TextTrackRepresentation.h */; settings = {ATTRIBUTES = (Private, ); }; }; 637 638 1F36EA9C1E21BA1700621E25 /* WebBackgroundTaskController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F36EA9A1E21BA1700621E25 /* WebBackgroundTaskController.h */; settings = {ATTRIBUTES = (Private, ); }; }; 638 639 1F72BF0B187FD45C0009BCB3 /* TileControllerMemoryHandlerIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F72BF09187FD4270009BCB3 /* TileControllerMemoryHandlerIOS.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 34229 34230 B1AD4E7413A12A4600846B27 /* TextTrackLoader.h in Headers */, 34230 34231 CD8B5A49180E138B008B8E65 /* TextTrackMediaSource.h in Headers */, 34232 1DF7E81F251A9E0600DB8F61 /* TextTrackRepresentation.h in Headers */, 34231 34233 1C73A7132185757E004CCEA5 /* TextUnderlineOffset.h in Headers */, 34232 34234 29FAF4B6195AB08900A522DC /* TextUndoInsertionMarkupMac.h in Headers */, -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r267472 r267491 2113 2113 void MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation(TextTrackRepresentation* representation) 2114 2114 { 2115 m_videoLayerManager->setTextTrackRepresentation(representation); 2115 auto* representationLayer = representation ? representation->platformLayer() : nil; 2116 m_videoLayerManager->setTextTrackRepresentationLayer(representationLayer); 2116 2117 } 2117 2118 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
r267472 r267491 1241 1241 void MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation(TextTrackRepresentation* representation) 1242 1242 { 1243 m_videoLayerManager->setTextTrackRepresentation(representation); 1243 auto* representationLayer = representation ? representation->platformLayer() : nil; 1244 m_videoLayerManager->setTextTrackRepresentationLayer(representationLayer); 1244 1245 } 1245 1246 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h
r260412 r267491 48 48 PlatformLayer *videoInlineLayer() const { return m_videoInlineLayer.get(); } 49 49 void setVideoLayer(PlatformLayer *, IntSize contentSize); 50 void didDestroyVideoLayer(); 50 51 51 52 #if ENABLE(VIDEO_PRESENTATION_MODE) … … 57 58 #endif 58 59 59 void didDestroyVideoLayer();60 61 60 bool requiresTextTrackRepresentation() const; 62 void setTextTrackRepresentation (TextTrackRepresentation*);61 void setTextTrackRepresentationLayer(PlatformLayer*); 63 62 void syncTextTrackBounds(); 64 63 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm
r263323 r267491 183 183 } 184 184 185 void VideoLayerManagerObjC::setTextTrackRepresentation (TextTrackRepresentation* representation)185 void VideoLayerManagerObjC::setTextTrackRepresentationLayer(PlatformLayer* representationLayer) 186 186 { 187 187 #if !ENABLE(VIDEO_PRESENTATION_MODE) 188 UNUSED_PARAM(representation );188 UNUSED_PARAM(representationLayer); 189 189 #else 190 190 ALWAYS_LOG(LOGIDENTIFIER); 191 191 192 PlatformLayer* representationLayer = representation ? representation->platformLayer() : nil;193 192 if (representationLayer == m_textTrackRepresentationLayer) { 194 193 syncTextTrackBounds(); -
trunk/Source/WebKit/ChangeLog
r267490 r267491 1 2020-09-23 Peng Liu <peng.liu6@apple.com> 2 3 [Media in GPU Process] Implement caption support in video fullscreen and PiP 4 https://bugs.webkit.org/show_bug.cgi?id=208752 5 6 Reviewed by Eric Carlson. 7 8 * GPUProcess/media/RemoteMediaPlayerProxy.cpp: 9 (WebKit::RemoteMediaPlayerProxy::syncTextTrackBounds): Deleted. 10 * GPUProcess/media/RemoteMediaPlayerProxy.h: 11 * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: 12 Remove syncTextTrackBounds() because the GPU process does not need to deal with 13 the text track bounds. 14 15 * WebProcess/GPU/GPUProcessConnection.cpp: 16 (WebKit::GPUProcessConnection::dispatchMessage): 17 Add a missing IPC message receiver. 18 19 * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: 20 (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenLayer): Set the flag 21 m_requiresTextTrackRepresentation when changing video presentation mode. 22 (WebKit::MediaPlayerPrivateRemote::requiresTextTrackRepresentation const): Deleted. 23 (WebKit::MediaPlayerPrivateRemote::setTextTrackRepresentation): Deleted. 24 (WebKit::MediaPlayerPrivateRemote::syncTextTrackBounds): Deleted. 25 Move the implementation of those functions to MediaPlayerPrivateRemoteCocoa. 26 27 * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: 28 Add the flag m_requiresTextTrackRepresentation and add a reference 29 to the layer used to render text track (in fullscreen or picture-in-picture). 30 31 * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm: 32 (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame): 33 (WebKit::MediaPlayerPrivateRemote::setTextTrackRepresentation): 34 (WebKit::MediaPlayerPrivateRemote::syncTextTrackBounds): 35 Those functions share a similar implementation as VideoLayerManagerObjC. 36 1 37 2020-09-23 Per Arne Vollan <pvollan@apple.com> 2 38 -
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
r264021 r267491 837 837 } 838 838 839 void RemoteMediaPlayerProxy::syncTextTrackBounds()840 {841 m_player->syncTextTrackBounds();842 }843 844 839 void RemoteMediaPlayerProxy::performTaskAtMediaTime(const MediaTime& taskTime, WallTime messageTime, CompletionHandler<void(Optional<MediaTime>)>&& completionHandler) 845 840 { -
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
r264021 r267491 176 176 void notifyTrackModeChanged(); 177 177 void tracksChanged(); 178 void syncTextTrackBounds();179 178 180 179 void performTaskAtMediaTime(const MediaTime&, WallTime, CompletionHandler<void(Optional<MediaTime>)>&&); -
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
r260412 r267491 113 113 NotifyTrackModeChanged() 114 114 TracksChanged() 115 SyncTextTrackBounds()116 115 117 116 #if ENABLE(WIRELESS_PLAYBACK_TARGET) -
trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp
r267427 r267491 54 54 #include "RemoteAudioSession.h" 55 55 #include "RemoteAudioSessionMessages.h" 56 #endif 57 58 #if PLATFORM(IOS_FAMILY) 59 #include "RemoteMediaSessionHelper.h" 60 #include "RemoteMediaSessionHelperMessages.h" 56 61 #endif 57 62 … … 142 147 } 143 148 #endif 149 #if PLATFORM(IOS_FAMILY) 150 if (decoder.messageReceiverName() == Messages::RemoteMediaSessionHelper::messageReceiverName()) { 151 // FIXME 152 return true; 153 } 154 #endif 144 155 #if ENABLE(ENCRYPTED_MEDIA) 145 156 if (decoder.messageReceiverName() == Messages::RemoteCDMInstanceSession::messageReceiverName()) { -
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
r264297 r267491 652 652 { 653 653 if (!videoFullscreenLayer) { 654 connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::ExitFullscreen(), WTFMove(completionHandler), m_id); 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); 655 661 return; 656 662 } 657 663 658 664 ASSERT(m_videoFullscreenLayer.get() == videoFullscreenLayer); 659 connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::EnterFullscreen(), WTFMove(completionHandler), m_id); 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); 660 672 } 661 673 … … 1010 1022 #endif 1011 1023 1012 bool MediaPlayerPrivateRemote::requiresTextTrackRepresentation() const1013 {1014 notImplemented();1015 return false;1016 }1017 1018 void MediaPlayerPrivateRemote::setTextTrackRepresentation(TextTrackRepresentation*)1019 {1020 notImplemented();1021 }1022 1023 void MediaPlayerPrivateRemote::syncTextTrackBounds()1024 {1025 connection().send(Messages::RemoteMediaPlayerProxy::SyncTextTrackBounds(), m_id);1026 }1027 1028 1024 void MediaPlayerPrivateRemote::tracksChanged() 1029 1025 { -
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
r264021 r267491 49 49 class ISOWebVTTCue; 50 50 class SerializedPlatformDataCueValue; 51 class TextTrackRepresentation; 51 52 } 52 53 … … 324 325 #endif 325 326 326 bool requiresTextTrackRepresentation() const final; 327 bool requiresTextTrackRepresentation() const final { return m_requiresTextTrackRepresentation; } 328 #if PLATFORM(COCOA) 327 329 void setTextTrackRepresentation(WebCore::TextTrackRepresentation*) final; 328 330 void syncTextTrackBounds() final; 331 #endif 329 332 void tracksChanged() final; 330 333 … … 357 360 WebCore::MediaPlayer* m_player { nullptr }; 358 361 RefPtr<WebCore::PlatformMediaResourceLoader> m_mediaResourceLoader; 362 bool m_requiresTextTrackRepresentation { false }; 359 363 PlatformLayerContainer m_videoInlineLayer; 360 364 PlatformLayerContainer m_videoFullscreenLayer; 365 #if PLATFORM(COCOA) 366 RetainPtr<PlatformLayer> m_textTrackRepresentationLayer; 367 #endif 361 368 Optional<LayerHostingContextID> m_fullscreenLayerHostingContextId; 362 369 RemoteMediaPlayerManager& m_manager; -
trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm
r260366 r267491 30 30 31 31 #import <WebCore/FloatRect.h> 32 #import <WebCore/TextTrackRepresentation.h> 32 33 #import <pal/spi/cocoa/QuartzCoreSPI.h> 33 34 #import <wtf/MachSendRight.h> … … 66 67 67 68 [CATransaction commit]; 69 70 syncTextTrackBounds(); 68 71 } 69 72 70 73 #endif 71 74 75 void MediaPlayerPrivateRemote::setTextTrackRepresentation(WebCore::TextTrackRepresentation* representation) 76 { 77 #if !ENABLE(VIDEO_PRESENTATION_MODE) 78 UNUSED_PARAM(representation); 79 #else 80 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 #endif 102 } 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 #endif 117 } 118 72 119 } // namespace WebKit 73 120
Note:
See TracChangeset
for help on using the changeset viewer.