Changeset 257127 in webkit


Ignore:
Timestamp:
Feb 20, 2020, 10:57:47 PM (5 years ago)
Author:
Peng Liu
Message:

[Media in GPU process] Synchronize the properties of video layers in the GPU process with the hosting layer in the web process
https://bugs.webkit.org/show_bug.cgi?id=206132

Reviewed by Jer Noble.

Source/WebCore:

Update the name (for debugging) of the CALayer created by _web_renderLayerWithContextID (The CALayer will not be only used as video layers).
This patch also fixes the ordering issue related to VideoLayerManagerObjC.h and VideoLayerManagerObjC.mm in the Xcode project file.

  • WebCore.xcodeproj/project.pbxproj:
  • platform/graphics/cocoa/WebCoreCALayerExtras.mm:

(+[CALayer _web_renderLayerWithContextID:]):

Source/WebCore/PAL:

Update the CAContext interface to expose currentContext for external builds.

  • pal/spi/cocoa/QuartzCoreSPI.h:

Source/WebKit:

MediaPlayerPrivateRemote creates WKVideoLayerRemote whose sublayer is created by LayerHostingContext::createPlatformLayerForHostingContext().
The WKVideoLayerRemote will be used by the renderer to manage the video element in the Web process. When its size is changed by the renderer,
it applies a transform without changing its actual size, and sends a message to MediaPlayerPrivateProxy in the GPU process
to change the size of the container layer. After that, WKVideoLayerRemote will set its size to the correct one in the Web process side.
We need to use a MachSendRight to synchronize the transactions in the Web process and the GPU process.

We have to use such a process to change the appearance of WKVideoLayerRemote in order to guarantee the smoothness when a user
change the size of a video element.

  • GPUProcess/media/RemoteMediaPlayerProxy.cpp:

(WebKit::RemoteMediaPlayerProxy::load):
(WebKit::RemoteMediaPlayerProxy::prepareForPlayback):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
(WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeFenced):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerContentBoxRect const): Deleted.

  • GPUProcess/media/RemoteMediaPlayerProxy.h:
  • GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
  • SourcesCocoa.txt:
  • UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:

(WebKit::MediaPlayerPrivateRemote::prepareForPlayback):
(WebKit::MediaPlayerPrivateRemote::firstVideoFrameAvailable):
(WebKit::MediaPlayerPrivateRemote::platformLayer const):
(WebKit::MediaPlayerPrivateRemote::setVideoInlineSizeFenced):
(WebKit::MediaPlayerPrivateRemote::paint):
(WebKit::MediaPlayerPrivateRemote::paintCurrentFrameInContext):

  • WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
  • WebProcess/GPU/media/VideoLayerRemote.h: Added.
  • WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.h: Added.
  • WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm: Added.

(-[WKVideoLayerRemote init]):
(-[WKVideoLayerRemote dealloc]):
(-[WKVideoLayerRemote mediaPlayerPrivateRemote]):
(-[WKVideoLayerRemote setMediaPlayerPrivateRemote:]):
(-[WKVideoLayerRemote videoSublayer]):
(-[WKVideoLayerRemote setVideoSublayer:]):
(-[WKVideoLayerRemote layoutSublayers]):
(-[WKVideoLayerRemote resolveBounds]):
(WebKit::createVideoLayerRemote):

  • WebProcess/WebPage/ios/WebPageIOS.mm: Fixed a unified build failure.
Location:
trunk/Source
Files:
6 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r257126 r257127  
     12020-02-20  Peng Liu  <peng.liu6@apple.com>
     2
     3        [Media in GPU process] Synchronize the properties of video layers in the GPU process with the hosting layer in the web process
     4        https://bugs.webkit.org/show_bug.cgi?id=206132
     5
     6        Reviewed by Jer Noble.
     7
     8        Update the name (for debugging) of the CALayer created by _web_renderLayerWithContextID (The CALayer will not be only used as video layers).
     9        This patch also fixes the ordering issue related to VideoLayerManagerObjC.h and VideoLayerManagerObjC.mm in the Xcode project file.
     10
     11        * WebCore.xcodeproj/project.pbxproj:
     12        * platform/graphics/cocoa/WebCoreCALayerExtras.mm:
     13        (+[CALayer _web_renderLayerWithContextID:]):
     14
    1152020-02-20  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/Source/WebCore/PAL/ChangeLog

    r257062 r257127  
     12020-02-20  Peng Liu  <peng.liu6@apple.com>
     2
     3        [Media in GPU process] Synchronize the properties of video layers in the GPU process with the hosting layer in the web process
     4        https://bugs.webkit.org/show_bug.cgi?id=206132
     5
     6        Reviewed by Jer Noble.
     7
     8        Update the CAContext interface to expose currentContext for external builds.
     9
     10        * pal/spi/cocoa/QuartzCoreSPI.h:
     11
    1122020-02-20  Alexey Proskuryakov  <ap@apple.com>
    213
  • trunk/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h

    r254042 r257127  
    6161@interface CAContext ()
    6262+ (NSArray *)allContexts;
     63+ (CAContext *)currentContext;
    6364+ (CAContext *)localContext;
    6465+ (CAContext *)remoteContextWithOptions:(NSDictionary *)dict;
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r257125 r257127  
    635635                1D2F8E052344751D00993B68 /* HTMLVideoElementPictureInPicture.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DEF06CC233C3D2000EE228D /* HTMLVideoElementPictureInPicture.h */; settings = {ATTRIBUTES = (Private, ); }; };
    636636                1D2F8E062344752300993B68 /* PictureInPictureWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DEF06CD233C3D2A00EE228D /* PictureInPictureWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
    637                 1D392F2D23F20A7000E04B2D /* VideoLayerManagerObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1D392F2823F209B400E04B2D /* VideoLayerManagerObjC.mm */; };
    638637                1D9F0FC12122029B005D8FD4 /* ShareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DC55400211BA8C8004B780E /* ShareData.h */; settings = {ATTRIBUTES = (Private, ); }; };
    639638                1DBC1B562347B3D200B901AF /* PictureInPictureObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DBC1B552347B3D200B901AF /* PictureInPictureObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    15841583                52B0D4C01C57FD660077CE53 /* VideoFullscreenChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B0D4BF1C57FD660077CE53 /* VideoFullscreenChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
    15851584                52B0D4C21C57FF910077CE53 /* VideoFullscreenInterfaceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B0D4C11C57FF910077CE53 /* VideoFullscreenInterfaceMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1585                52D5A18F1C54592300DE34A3 /* VideoLayerManagerObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52D5A18D1C54590300DE34A3 /* VideoLayerManagerObjC.mm */; };
    15861586                52D5A1A71C57489D00DE34A3 /* VideoFullscreenModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 52D5A1A41C57488900DE34A3 /* VideoFullscreenModel.h */; settings = {ATTRIBUTES = (Private, ); }; };
    15871587                52D5A1A81C5748A300DE34A3 /* VideoFullscreenModelVideoElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 52D5A1A51C57488900DE34A3 /* VideoFullscreenModelVideoElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    65146514                1D0026A92374F9D900CA6CDF /* JSEnterPictureInPictureEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEnterPictureInPictureEvent.cpp; sourceTree = "<group>"; };
    65156515                1D2C82B6236A3F6A0055D6C5 /* PictureInPictureSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PictureInPictureSupport.h; sourceTree = "<group>"; };
    6516                 1D392F2823F209B400E04B2D /* VideoLayerManagerObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VideoLayerManagerObjC.mm; sourceTree = "<group>"; };
    6517                 1D392F2A23F209B500E04B2D /* VideoLayerManagerObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLayerManagerObjC.h; sourceTree = "<group>"; };
    65186516                1DBC1B552347B3D200B901AF /* PictureInPictureObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PictureInPictureObserver.h; sourceTree = "<group>"; };
    65196517                1DC553FD211BA12A004B780E /* NavigatorShare.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorShare.idl; sourceTree = "<group>"; };
     
    84508448                52B0D4C11C57FF910077CE53 /* VideoFullscreenInterfaceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFullscreenInterfaceMac.h; sourceTree = "<group>"; };
    84518449                52CB11DB22FDDB2E009F0A64 /* WHLSLDefaultDelete.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLDefaultDelete.h; sourceTree = "<group>"; };
     8450                52D5A18D1C54590300DE34A3 /* VideoLayerManagerObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VideoLayerManagerObjC.mm; sourceTree = "<group>"; tabWidth = 8; };
     8451                52D5A18E1C54590300DE34A3 /* VideoLayerManagerObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLayerManagerObjC.h; sourceTree = "<group>"; tabWidth = 8; };
    84528452                52D5A1A41C57488900DE34A3 /* VideoFullscreenModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFullscreenModel.h; sourceTree = "<group>"; };
    84538453                52D5A1A51C57488900DE34A3 /* VideoFullscreenModelVideoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFullscreenModelVideoElement.h; sourceTree = "<group>"; };
     
    2675626756                                CDC8B5A918047FF10016E685 /* SourceBufferPrivateAVFObjC.h */,
    2675726757                                CDC8B5A818047FF10016E685 /* SourceBufferPrivateAVFObjC.mm */,
    26758                                 1D392F2A23F209B500E04B2D /* VideoLayerManagerObjC.h */,
    26759                                 1D392F2823F209B400E04B2D /* VideoLayerManagerObjC.mm */,
     26758                                52D5A18E1C54590300DE34A3 /* VideoLayerManagerObjC.h */,
     26759                                52D5A18D1C54590300DE34A3 /* VideoLayerManagerObjC.mm */,
    2676026760                                CD336F6517FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp */,
    2676126761                                CD336F6617FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h */,
     
    3428434284                                7C73FB07191EF417007DE061 /* UserMessageHandlersNamespace.cpp in Sources */,
    3428534285                                3FBC4AF3189881560046EE38 /* VideoFullscreenInterfaceAVKit.mm in Sources */,
    34286                                 1D392F2D23F20A7000E04B2D /* VideoLayerManagerObjC.mm in Sources */,
     34286                                52D5A18F1C54592300DE34A3 /* VideoLayerManagerObjC.mm in Sources */,
    3428734287                                BE88E0DE1715D2A200658D98 /* VideoTrack.cpp in Sources */,
    3428834288                                BE88E0E11715D2A200658D98 /* VideoTrackList.cpp in Sources */,
  • trunk/Source/WebCore/platform/graphics/cocoa/WebCoreCALayerExtras.mm

    r254555 r257127  
    8383    CALayerHost *layerHost = [CALayerHost layer];
    8484#ifndef NDEBUG
    85     [layerHost setName:@"WebVideoHostingLayer"];
     85    [layerHost setName:@"Hosting layer"];
    8686#endif
    8787    layerHost.contextId = contextID;
  • trunk/Source/WebKit/ChangeLog

    r257125 r257127  
     12020-02-20  Peng Liu  <peng.liu6@apple.com>
     2
     3        [Media in GPU process] Synchronize the properties of video layers in the GPU process with the hosting layer in the web process
     4        https://bugs.webkit.org/show_bug.cgi?id=206132
     5
     6        Reviewed by Jer Noble.
     7
     8        MediaPlayerPrivateRemote creates WKVideoLayerRemote whose sublayer is created by LayerHostingContext::createPlatformLayerForHostingContext().
     9        The WKVideoLayerRemote will be used by the renderer to manage the video element in the Web process. When its size is changed by the renderer,
     10        it applies a transform without changing its actual size, and sends a message to MediaPlayerPrivateProxy in the GPU process
     11        to change the size of the container layer. After that, WKVideoLayerRemote will set its size to the correct one in the Web process side.
     12        We need to use a MachSendRight to synchronize the transactions in the Web process and the GPU process.
     13
     14        We have to use such a process to change the appearance of WKVideoLayerRemote in order to guarantee the smoothness when a user
     15        change the size of a video element.
     16
     17        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
     18        (WebKit::RemoteMediaPlayerProxy::load):
     19        (WebKit::RemoteMediaPlayerProxy::prepareForPlayback):
     20        (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
     21        (WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeFenced):
     22        (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentBoxRect const): Deleted.
     23        * GPUProcess/media/RemoteMediaPlayerProxy.h:
     24        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
     25        * SourcesCocoa.txt:
     26        * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
     27        * WebKit.xcodeproj/project.pbxproj:
     28        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
     29        (WebKit::MediaPlayerPrivateRemote::prepareForPlayback):
     30        (WebKit::MediaPlayerPrivateRemote::firstVideoFrameAvailable):
     31        (WebKit::MediaPlayerPrivateRemote::platformLayer const):
     32        (WebKit::MediaPlayerPrivateRemote::setVideoInlineSizeFenced):
     33        (WebKit::MediaPlayerPrivateRemote::paint):
     34        (WebKit::MediaPlayerPrivateRemote::paintCurrentFrameInContext):
     35        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
     36        * WebProcess/GPU/media/VideoLayerRemote.h: Added.
     37        * WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.h: Added.
     38        * WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm: Added.
     39        (-[WKVideoLayerRemote init]):
     40        (-[WKVideoLayerRemote dealloc]):
     41        (-[WKVideoLayerRemote mediaPlayerPrivateRemote]):
     42        (-[WKVideoLayerRemote setMediaPlayerPrivateRemote:]):
     43        (-[WKVideoLayerRemote videoSublayer]):
     44        (-[WKVideoLayerRemote setVideoSublayer:]):
     45        (-[WKVideoLayerRemote layoutSublayers]):
     46        (-[WKVideoLayerRemote resolveBounds]):
     47        (WebKit::createVideoLayerRemote):
     48        * WebProcess/WebPage/ios/WebPageIOS.mm: Fixed a unified build failure.
     49
    1502020-02-20  Eric Carlson  <eric.carlson@apple.com>
    251
  • trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp

    r256353 r257127  
    3030
    3131#include "GPUConnectionToWebProcess.h"
     32#include "LayerHostingContext.h"
    3233#include "MediaPlayerPrivateRemoteMessages.h"
    3334#include "RemoteAudioTrackProxy.h"
     
    101102            WTFLogAlways("Unable to create sandbox extension for media url.\n");
    102103    }
    103 
     104   
    104105    m_player->load(url, contentType, keySystem);
    105106    getConfiguration(configuration);
     
    107108}
    108109
    109 void RemoteMediaPlayerProxy::prepareForPlayback(bool privateMode, WebCore::MediaPlayerEnums::Preload preload, bool preservesPitch, bool prepareForRendering, LayoutRect layoutRect, float videoContentScale, CompletionHandler<void(Optional<LayerHostingContextID>&& contextId)>&& completionHandler)
     110void RemoteMediaPlayerProxy::prepareForPlayback(bool privateMode, WebCore::MediaPlayerEnums::Preload preload, bool preservesPitch, bool prepareForRendering, float videoContentScale, CompletionHandler<void(Optional<LayerHostingContextID>&& contextId)>&& completionHandler)
    110111{
    111112    m_player->setPrivateBrowsingMode(privateMode);
     
    113114    m_player->setPreservesPitch(preservesPitch);
    114115    m_player->prepareForRendering();
    115     m_videoContentBoxRect = layoutRect;
    116116    m_videoContentScale = videoContentScale;
    117117    m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess();
     
    469469void RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable()
    470470{
     471    // Initially the size of the platformLayer will be 0x0 because we do not provide mediaPlayerContentBoxRect() in this class.
    471472    m_layerHostingContext->setRootLayer(m_player->platformLayer());
    472473    m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::FirstVideoFrameAvailable(), m_id);
     
    545546    notImplemented();
    546547    return false;
    547 }
    548 
    549 LayoutRect RemoteMediaPlayerProxy::mediaPlayerContentBoxRect() const
    550 {
    551     return m_videoContentBoxRect;
    552548}
    553549
  • trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h

    r256353 r257127  
    4747#include <wtf/WeakPtr.h>
    4848
     49namespace WTF {
     50class MachSendRight;
     51}
     52
    4953namespace WebCore {
    5054class AudioTrackPrivate;
     
    7781    void getConfiguration(RemoteMediaPlayerConfiguration&);
    7882
    79     void prepareForPlayback(bool privateMode, WebCore::MediaPlayerEnums::Preload, bool preservesPitch, bool prepareForRendering, WebCore::LayoutRect, float videoContentScale, CompletionHandler<void(Optional<LayerHostingContextID>&&)>&&);
     83    void prepareForPlayback(bool privateMode, WebCore::MediaPlayerEnums::Preload, bool preservesPitch, bool prepareForRendering, float videoContentScale, CompletionHandler<void(Optional<LayerHostingContextID>&&)>&&);
    8084    void prepareForRendering();
    8185
     
    109113    void videoTrackSetSelected(TrackPrivateRemoteIdentifier, bool);
    110114    void textTrackSetMode(TrackPrivateRemoteIdentifier, WebCore::InbandTextTrackPrivate::Mode);
     115
     116#if PLATFORM(COCOA)
     117    void setVideoInlineSizeFenced(const WebCore::IntSize&, const WTF::MachSendRight&);
     118#endif
    111119
    112120#if ENABLE(WIRELESS_PLAYBACK_TARGET)
     
    179187    bool mediaPlayerIsFullscreenPermitted() const final;
    180188    bool mediaPlayerIsVideo() const final;
    181     WebCore::LayoutRect mediaPlayerContentBoxRect() const final;
    182189    float mediaPlayerContentsScale() const final;
    183190    void mediaPlayerPause() final;
  • trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in

    r256353 r257127  
    2525
    2626messages -> RemoteMediaPlayerProxy NotRefCounted {
    27     PrepareForPlayback(bool privateMode, enum:uint8_t WebCore::MediaPlayerEnums::Preload preload, bool preservesPitch, bool prepareForRendering, WebCore::LayoutRect layoutRect, float videoContentScale) -> (Optional<WebKit::LayerHostingContextID> layerHostingContextId) Async
     27    PrepareForPlayback(bool privateMode, enum:uint8_t WebCore::MediaPlayerEnums::Preload preload, bool preservesPitch, bool prepareForRendering, float videoContentScale) -> (Optional<WebKit::LayerHostingContextID> layerHostingContextId) Async
    2828
    2929    Load(URL url, Optional<WebKit::SandboxExtension::Handle> sandboxExtension, WebCore::ContentType contentType, String keySystem) -> (struct WebKit::RemoteMediaPlayerConfiguration playerConfiguration) Async
     
    5858    TextTrackSetMode(WebKit::TrackPrivateRemoteIdentifier trackID, enum:uint8_t WebCore::InbandTextTrackPrivate::Mode mode)
    5959
     60#if PLATFORM(COCOA)
     61    SetVideoInlineSizeFenced(WebCore::IntSize size, MachSendRight machSendRight)
     62#endif
     63
    6064    # Paint
    6165    # PaintCurrentFrameInContext
     
    8286    ApplicationWillResignActive()
    8387    ApplicationDidBecomeActive()
    84 
    8588}
    8689
  • trunk/Source/WebKit/SourcesCocoa.txt

    r256820 r257127  
    5858NetworkProcess/webrtc/NetworkRTCSocket.cpp
    5959
     60GPUProcess/EntryPoint/Cocoa/XPCService/GPUServiceEntryPoint.mm
    6061GPUProcess/ios/GPUProcessIOS.mm
    6162GPUProcess/mac/GPUProcessMac.mm
     63GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm
    6264GPUProcess/webrtc/LibWebRTCCodecsProxy.mm
    63 GPUProcess/EntryPoint/Cocoa/XPCService/GPUServiceEntryPoint.mm
    6465
    6566Platform/cf/ModuleCF.cpp
     
    555556WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm
    556557
     558WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm
     559
    557560WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp
    558561
  • trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h

    r246928 r257127  
    191191    HashMap<uint64_t, int> m_clientCounts;
    192192};
    193    
     193
    194194} // namespace WebKit
    195195
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r257085 r257127  
    26812681                1CBBE49E19B66C53006B7D81 /* WebInspectorUIMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebInspectorUIMessageReceiver.cpp; path = DerivedSources/WebKit2/WebInspectorUIMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
    26822682                1CBBE49F19B66C53006B7D81 /* WebInspectorUIMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebInspectorUIMessages.h; path = DerivedSources/WebKit2/WebInspectorUIMessages.h; sourceTree = BUILT_PRODUCTS_DIR; };
     2683                1D0ECEAA23FC858400D172F6 /* RemoteMediaPlayerProxyCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteMediaPlayerProxyCocoa.mm; sourceTree = "<group>"; };
    26832684                1D32F89823A8465A00B1EA6A /* RemoteMediaResource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteMediaResource.h; sourceTree = "<group>"; };
    26842685                1D32F89923A8468000B1EA6A /* RemoteMediaResource.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteMediaResource.cpp; sourceTree = "<group>"; };
     
    26972698                1DE0D095211CC21300439B5F /* WKShareSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKShareSheet.h; sourceTree = "<group>"; };
    26982699                1DE2DFAC23A959F8003E013A /* RemoteMediaResourceIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteMediaResourceIdentifier.h; sourceTree = "<group>"; };
     2700                1DFDD0DF23F60E1E00E9B490 /* VideoLayerRemoteCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VideoLayerRemoteCocoa.mm; sourceTree = "<group>"; };
     2701                1DFDD0E023F60E1F00E9B490 /* VideoLayerRemoteCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLayerRemoteCocoa.h; sourceTree = "<group>"; };
     2702                1DFDD0E223F610F000E9B490 /* VideoLayerRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLayerRemote.h; sourceTree = "<group>"; };
     2703                1DFDD0E323F610FE00E9B490 /* TextTrackPrivateRemote.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TextTrackPrivateRemote.messages.in; sourceTree = "<group>"; };
    26992704                1F0181691858DC1500F92884 /* WKWebProcessPlugInFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInFrame.h; sourceTree = "<group>"; };
    27002705                1F01816A1858DC1500F92884 /* WKWebProcessPlugInFrame.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebProcessPlugInFrame.mm; sourceTree = "<group>"; };
     
    52555260                        isa = PBXGroup;
    52565261                        children = (
     5262                                1DAF5A4D23EC9F7900B7B518 /* cocoa */,
    52575263                                071BC57923C93BB900680D7C /* AudioTrackPrivateRemote.cpp */,
    52585264                                071BC57723C93BB700680D7C /* AudioTrackPrivateRemote.h */,
     
    52725278                                07E19F0823D533B90094FFB4 /* TextTrackPrivateRemote.cpp */,
    52735279                                07E19F0923D533BA0094FFB4 /* TextTrackPrivateRemote.h */,
     5280                                1DFDD0E323F610FE00E9B490 /* TextTrackPrivateRemote.messages.in */,
     5281                                1DFDD0E223F610F000E9B490 /* VideoLayerRemote.h */,
    52745282                                071BC58323CC2BD500680D7C /* VideoTrackPrivateRemote.cpp */,
    52755283                                071BC58223CC2BD300680D7C /* VideoTrackPrivateRemote.h */,
     
    52815289                        isa = PBXGroup;
    52825290                        children = (
     5291                                1D0ECEA923FC84BB00D172F6 /* cocoa */,
    52835292                                071BC57E23CA5DB100680D7C /* RemoteAudioTrackProxy.cpp */,
    52845293                                071BC57F23CA5DB100680D7C /* RemoteAudioTrackProxy.h */,
     
    57375746                                BCC43AB8127B95DC00317F16 /* PlatformPopupMenuData.cpp */,
    57385747                                BCC43AB9127B95DC00317F16 /* PlatformPopupMenuData.h */,
     5748                                49ECA41B23FCA4860023358D /* PolicyDecision.h */,
    57395749                                E18C92F312DB9E7100CF2AEB /* PrintInfo.cpp */,
    57405750                                E1CC1B8E12D7EADF00625838 /* PrintInfo.h */,
     
    58615871                                4960A3BC23C5286400961842 /* WebViewCategory.h */,
    58625872                                C0337DD0127A2980008FF4F4 /* WebWheelEvent.cpp */,
    5863                                 49ECA41B23FCA4860023358D /* PolicyDecision.h */,
    58645873                        );
    58655874                        path = Shared;
     
    61496158                        );
    61506159                        path = Automation;
     6160                        sourceTree = "<group>";
     6161                };
     6162                1D0ECEA923FC84BB00D172F6 /* cocoa */ = {
     6163                        isa = PBXGroup;
     6164                        children = (
     6165                                1D0ECEAA23FC858400D172F6 /* RemoteMediaPlayerProxyCocoa.mm */,
     6166                        );
     6167                        path = cocoa;
     6168                        sourceTree = "<group>";
     6169                };
     6170                1DAF5A4D23EC9F7900B7B518 /* cocoa */ = {
     6171                        isa = PBXGroup;
     6172                        children = (
     6173                                1DFDD0E023F60E1F00E9B490 /* VideoLayerRemoteCocoa.h */,
     6174                                1DFDD0DF23F60E1E00E9B490 /* VideoLayerRemoteCocoa.mm */,
     6175                        );
     6176                        path = cocoa;
    61516177                        sourceTree = "<group>";
    61526178                };
     
    1048510511                                7CD622781739D863005BD7FF /* PluginSandboxProfile.h in Headers */,
    1048610512                                1A6FB7AF11E64B6800DB1371 /* PluginView.h in Headers */,
     10513                                49ECA41C23FCA5D80023358D /* PolicyDecision.h in Headers */,
    1048710514                                57FD318122B3515B008D0E8B /* PopUpSOAuthorizationSession.h in Headers */,
    1048810515                                83A0ED351F747CCF003299EB /* PreconnectTask.h in Headers */,
     
    1077810805                                46C392292316EC4D008EED9B /* WebPageProxyIdentifier.h in Headers */,
    1077910806                                BCBD3915125BB1A800D2C29F /* WebPageProxyMessages.h in Headers */,
    10780                                 49ECA41C23FCA5D80023358D /* PolicyDecision.h in Headers */,
    1078110807                                512127C41908239A00DAF35C /* WebPasteboardOverrides.h in Headers */,
    1078210808                                7C4694D11A51E36800AD5845 /* WebPasteboardProxy.h in Headers */,
  • trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp

    r257125 r257127  
    3535#include "SandboxExtension.h"
    3636#include "TextTrackPrivateRemote.h"
     37#include "VideoLayerRemote.h"
    3738#include "VideoTrackPrivateRemote.h"
    3839#include "WebCoreArgumentCoders.h"
     
    4344#include <WebCore/PlatformTimeRanges.h>
    4445#include <wtf/HashMap.h>
     46#include <wtf/MachSendRight.h>
    4547#include <wtf/MainThread.h>
    4648#include <wtf/StringPrintStream.h>
     
    9698void MediaPlayerPrivateRemote::prepareForPlayback(bool privateMode, MediaPlayer::Preload preload, bool preservesPitch, bool prepare)
    9799{
    98     auto layoutRect = m_player->playerContentBoxRect();
    99100    auto scale = m_player->playerContentsScale();
    100101
    101     connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::PrepareForPlayback(privateMode, preload, preservesPitch, prepare, layoutRect, scale), [weakThis = makeWeakPtr(*this), this](auto contextId) mutable {
     102    connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::PrepareForPlayback(privateMode, preload, preservesPitch, prepare, scale), [weakThis = makeWeakPtr(*this), this](auto contextId) mutable {
    102103        if (!weakThis)
    103104            return;
     
    106107            return;
    107108
    108         m_videoLayer = LayerHostingContext::createPlatformLayerForHostingContext(contextId.value());
     109        m_videoInlineLayer = createVideoLayerRemote(this, contextId.value());
    109110    }, m_id);
    110111}
     
    311312void MediaPlayerPrivateRemote::firstVideoFrameAvailable()
    312313{
     314    INFO_LOG(LOGIDENTIFIER);
    313315    m_player->firstVideoFrameAvailable();
    314316}
     
    587589PlatformLayer* MediaPlayerPrivateRemote::platformLayer() const
    588590{
    589     return m_videoLayer.get();
     591    return m_videoInlineLayer.get();
    590592}
    591593
     
    710712    return 0;
    711713}
     714
     715#if PLATFORM(COCOA)
     716void MediaPlayerPrivateRemote::setVideoInlineSizeFenced(const IntSize& size, const WTF::MachSendRight& machSendRight)
     717{
     718    connection().send(Messages::RemoteMediaPlayerProxy::SetVideoInlineSizeFenced(size, machSendRight), m_id);
     719}
     720#endif
    712721
    713722void MediaPlayerPrivateRemote::paint(GraphicsContext&, const FloatRect&)
  • trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h

    r257125 r257127  
    3939#include <wtf/WeakPtr.h>
    4040
     41namespace WTF {
     42class MachSendRight;
     43}
     44
    4145namespace WebCore {
    4246class ISOWebVTTCue;
     
    9296    void sizeChanged(WebCore::FloatSize);
    9397    void firstVideoFrameAvailable();
     98#if PLATFORM(COCOA)
     99    void setVideoInlineSizeFenced(const WebCore::IntSize&, const WTF::MachSendRight&);
     100#endif
    94101
    95102    void addRemoteAudioTrack(TrackPrivateRemoteIdentifier, TrackPrivateRemoteConfiguration&&);
     
    237244    bool didLoadingProgress() const final;
    238245
    239     // In the Cocoa WebKit port, MediaPlayerPrivateAVFoundationObjC::setSize() does nothing,
    240     // so the Web process does not need to send IPC messages to call it in the GPU process.
    241     // Other WebKit ports may need to do that.
    242     void setSize(const WebCore::IntSize&) final { }
    243 
    244246    void paint(WebCore::GraphicsContext&, const WebCore::FloatRect&) final;
    245 
    246247    void paintCurrentFrameInContext(WebCore::GraphicsContext&, const WebCore::FloatRect&) final;
    247248    bool copyVideoTextureToPlatformTexture(WebCore::GraphicsContextGLOpenGL*, PlatformGLObject, GCGLenum, GCGLint, GCGLenum, GCGLenum, GCGLenum, bool, bool) final;
     
    360361    WebCore::MediaPlayer* m_player { nullptr };
    361362    RefPtr<WebCore::PlatformMediaResourceLoader> m_mediaResourceLoader;
    362     RetainPtr<PlatformLayer> m_videoLayer;
     363    RetainPtr<PlatformLayer> m_videoInlineLayer;
    363364    RemoteMediaPlayerManager& m_manager;
    364365    WebCore::MediaPlayerEnums::MediaEngineIdentifier m_remoteEngineIdentifier;
  • trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r256935 r257127  
    118118#import <WebCore/RenderBlock.h>
    119119#import <WebCore/RenderImage.h>
     120#import <WebCore/RenderLayer.h>
    120121#import <WebCore/RenderThemeIOS.h>
    121122#import <WebCore/RenderView.h>
Note: See TracChangeset for help on using the changeset viewer.