Title: [280998] branches/safari-612.1.27.0.6-branch/Source
Revision
280998
Author
[email protected]
Date
2021-08-12 17:04:20 -0700 (Thu, 12 Aug 2021)

Log Message

Cherry-pick r280776. rdar://problem/81861548

    [Cocoa|GPU] platformLayer() not always added to remotedly hosted context; black video while playing
    https://bugs.webkit.org/show_bug.cgi?id=228873
    <rdar://81271107>

    Reviewed by Eric Carlson.

    Source/WebCore:

    Coalesce calls to renderingModeChanged() by setting a flag to call renderingModeChanged() in
    the next run loop, and call into this coalescing method, setNeedsRenderingModeChanged(),
    whenever the MediaPlayerPrivateAVFoundation subclasses create or destroy a video layer
    or software painting context. This ensures that the MediaPlayerClient is always notified
    when the rendering mode changes, regardless of why that change occurred.

    Drive-by fix: replace the call in createVideoLayer() to "callOnMainThread()"
    with "ensureOnMainThread()". The call to "callOnMainThread()" was added to avoid a
    deadlock in WebKitLegacy, and "ensureOnMainThread()" has the correct behavior there, but
    will be synchronous in WebKit.

    * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
    (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
    (WebCore::MediaPlayerPrivateAVFoundation::setNeedsRenderingModeChanged):
    (WebCore::MediaPlayerPrivateAVFoundation::renderingModeChanged):
    (WebCore::MediaPlayerPrivateAVFoundation::prepareForRendering):
    * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
    * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
    (WebCore::MediaPlayerPrivateAVFoundationCF::destroyVideoLayer):
    (WebCore::AVFWrapper::createAVCFVideoLayer):
    (WebCore::AVFWrapper::createImageGenerator):
    (WebCore::AVFWrapper::destroyImageGenerator):
    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
    (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput):

    Source/WebKit:

    Currently, the RemoteMediaPlayerProxy will insert its MediaPlayer's platformLayer() into the
    remotely hosted context when it receives a "firstVideoFrameAvailable()" notification.
    However this is problematic for two reasons: AVPlayerLayer may not become "ready for
    playback" when it is not in an active CALayer heirarchy, and for
    MediaPlayerPrivateAVFoundation, firstVideoFrameAvailable() is only fired during
    updateStates(), which is not guaranteed to occur unless another state change occurs.

    Instead, reparent the MediaPlayer's platformLayer() when we receive a
    mediaPlayerRenderingModeChanged() notification, which notifies the client whenever a
    platformLayer() is created or destroyed.

    * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
    * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
    (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
    (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280776 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-612.1.27.0.6-branch/Source/WebCore/ChangeLog (280997 => 280998)


--- branches/safari-612.1.27.0.6-branch/Source/WebCore/ChangeLog	2021-08-13 00:01:05 UTC (rev 280997)
+++ branches/safari-612.1.27.0.6-branch/Source/WebCore/ChangeLog	2021-08-13 00:04:20 UTC (rev 280998)
@@ -1,3 +1,102 @@
+2021-08-12  Russell Epstein  <[email protected]>
+
+        Cherry-pick r280776. rdar://problem/81861548
+
+    [Cocoa|GPU] platformLayer() not always added to remotedly hosted context; black video while playing
+    https://bugs.webkit.org/show_bug.cgi?id=228873
+    <rdar://81271107>
+    
+    Reviewed by Eric Carlson.
+    
+    Source/WebCore:
+    
+    Coalesce calls to renderingModeChanged() by setting a flag to call renderingModeChanged() in
+    the next run loop, and call into this coalescing method, setNeedsRenderingModeChanged(),
+    whenever the MediaPlayerPrivateAVFoundation subclasses create or destroy a video layer
+    or software painting context. This ensures that the MediaPlayerClient is always notified
+    when the rendering mode changes, regardless of why that change occurred.
+    
+    Drive-by fix: replace the call in createVideoLayer() to "callOnMainThread()"
+    with "ensureOnMainThread()". The call to "callOnMainThread()" was added to avoid a
+    deadlock in WebKitLegacy, and "ensureOnMainThread()" has the correct behavior there, but
+    will be synchronous in WebKit.
+    
+    * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+    (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
+    (WebCore::MediaPlayerPrivateAVFoundation::setNeedsRenderingModeChanged):
+    (WebCore::MediaPlayerPrivateAVFoundation::renderingModeChanged):
+    (WebCore::MediaPlayerPrivateAVFoundation::prepareForRendering):
+    * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+    * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+    (WebCore::MediaPlayerPrivateAVFoundationCF::destroyVideoLayer):
+    (WebCore::AVFWrapper::createAVCFVideoLayer):
+    (WebCore::AVFWrapper::createImageGenerator):
+    (WebCore::AVFWrapper::destroyImageGenerator):
+    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput):
+    
+    Source/WebKit:
+    
+    Currently, the RemoteMediaPlayerProxy will insert its MediaPlayer's platformLayer() into the
+    remotely hosted context when it receives a "firstVideoFrameAvailable()" notification.
+    However this is problematic for two reasons: AVPlayerLayer may not become "ready for
+    playback" when it is not in an active CALayer heirarchy, and for
+    MediaPlayerPrivateAVFoundation, firstVideoFrameAvailable() is only fired during
+    updateStates(), which is not guaranteed to occur unless another state change occurs.
+    
+    Instead, reparent the MediaPlayer's platformLayer() when we receive a
+    mediaPlayerRenderingModeChanged() notification, which notifies the client whenever a
+    platformLayer() is created or destroyed.
+    
+    * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+    * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
+    (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
+    (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-08-09  Jer Noble  <[email protected]>
+
+            [Cocoa|GPU] platformLayer() not always added to remotedly hosted context; black video while playing
+            https://bugs.webkit.org/show_bug.cgi?id=228873
+            <rdar://81271107>
+
+            Reviewed by Eric Carlson.
+
+            Coalesce calls to renderingModeChanged() by setting a flag to call renderingModeChanged() in
+            the next run loop, and call into this coalescing method, setNeedsRenderingModeChanged(),
+            whenever the MediaPlayerPrivateAVFoundation subclasses create or destroy a video layer
+            or software painting context. This ensures that the MediaPlayerClient is always notified
+            when the rendering mode changes, regardless of why that change occurred.
+
+            Drive-by fix: replace the call in createVideoLayer() to "callOnMainThread()"
+            with "ensureOnMainThread()". The call to "callOnMainThread()" was added to avoid a
+            deadlock in WebKitLegacy, and "ensureOnMainThread()" has the correct behavior there, but
+            will be synchronous in WebKit.
+
+            * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+            (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
+            (WebCore::MediaPlayerPrivateAVFoundation::setNeedsRenderingModeChanged):
+            (WebCore::MediaPlayerPrivateAVFoundation::renderingModeChanged):
+            (WebCore::MediaPlayerPrivateAVFoundation::prepareForRendering):
+            * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+            * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+            (WebCore::MediaPlayerPrivateAVFoundationCF::destroyVideoLayer):
+            (WebCore::AVFWrapper::createAVCFVideoLayer):
+            (WebCore::AVFWrapper::createImageGenerator):
+            (WebCore::AVFWrapper::destroyImageGenerator):
+            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput):
+
 2021-08-10  Russell Epstein  <[email protected]>
 
         Cherry-pick r280826. rdar://problem/81749833

Modified: branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (280997 => 280998)


--- branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2021-08-13 00:01:05 UTC (rev 280997)
+++ branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2021-08-13 00:04:20 UTC (rev 280998)
@@ -142,9 +142,28 @@
 
     // If using a movie layer, inform the client so the compositing tree is updated.
     if (currentMode == MediaRenderingToLayer || preferredMode == MediaRenderingToLayer)
-        m_player->renderingModeChanged();
+        setNeedsRenderingModeChanged();
 }
 
+void MediaPlayerPrivateAVFoundation::setNeedsRenderingModeChanged()
+{
+    if (m_needsRenderingModeChanged)
+        return;
+    m_needsRenderingModeChanged = true;
+
+    queueTaskOnEventLoop([weakThis = makeWeakPtr(*this)] {
+        if (weakThis)
+            weakThis->renderingModeChanged();
+    });
+}
+
+void MediaPlayerPrivateAVFoundation::renderingModeChanged()
+{
+    ASSERT(m_needsRenderingModeChanged);
+    m_needsRenderingModeChanged = false;
+    m_player->renderingModeChanged();
+}
+
 void MediaPlayerPrivateAVFoundation::tearDownVideoRendering()
 {
     INFO_LOG(LOGIDENTIFIER);
@@ -443,7 +462,7 @@
     setUpVideoRendering();
 
     if (currentRenderingMode() == MediaRenderingToLayer || preferredRenderingMode() == MediaRenderingToLayer)
-        m_player->renderingModeChanged();
+        setNeedsRenderingModeChanged();
 }
 
 bool MediaPlayerPrivateAVFoundation::supportsFullscreen() const

Modified: branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (280997 => 280998)


--- branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2021-08-13 00:01:05 UTC (rev 280997)
+++ branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2021-08-13 00:04:20 UTC (rev 280998)
@@ -320,6 +320,9 @@
     void setResolvedURL(URL&&);
     const URL& resolvedURL() const { return m_resolvedURL; }
 
+    void setNeedsRenderingModeChanged();
+    void renderingModeChanged();
+
 private:
     MediaPlayer* m_player;
 
@@ -368,6 +371,7 @@
     bool m_characteristicsChanged;
     bool m_shouldMaintainAspectRatio;
     bool m_seeking;
+    bool m_needsRenderingModeChanged { false };
 };
 
 } // namespace WebCore

Modified: branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (280997 => 280998)


--- branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2021-08-13 00:01:05 UTC (rev 280997)
+++ branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2021-08-13 00:04:20 UTC (rev 280998)
@@ -442,15 +442,21 @@
     if (imageGenerator(m_avfWrapper))
         return;
 
-    if (m_avfWrapper)
-        m_avfWrapper->createImageGenerator();
+    if (!m_avfWrapper)
+        return;
+
+    m_avfWrapper->createImageGenerator();
+    setNeedsRenderingModeChanged();
 }
 
 void MediaPlayerPrivateAVFoundationCF::destroyContextVideoRenderer()
 {
     ASSERT(isMainThread());
-    if (m_avfWrapper)
-        m_avfWrapper->destroyImageGenerator();
+    if (!m_avfWrapper)
+        return;
+
+    m_avfWrapper->destroyImageGenerator();
+    setNeedsRenderingModeChanged();
 }
 
 void MediaPlayerPrivateAVFoundationCF::createVideoLayer()
@@ -458,8 +464,11 @@
     ASSERT(isMainThread());
     ASSERT(supportsAcceleratedRendering());
 
-    if (m_avfWrapper)
-        m_avfWrapper->createAVCFVideoLayer();
+    if (!m_avfWrapper)
+        return;
+
+    m_avfWrapper->createAVCFVideoLayer();
+    setNeedsRenderingModeChanged();
 }
 
 void MediaPlayerPrivateAVFoundationCF::destroyVideoLayer()
@@ -466,8 +475,11 @@
 {
     ASSERT(isMainThread());
     LOG(Media, "MediaPlayerPrivateAVFoundationCF::destroyVideoLayer(%p) - destroying %p", this, videoLayer(m_avfWrapper));
-    if (m_avfWrapper)
-        m_avfWrapper->destroyVideoLayer();
+    if (!m_avfWrapper)
+        return;
+
+    m_avfWrapper->destroyVideoLayer();
+    setNeedsRenderingModeChanged();
 }
 
 bool MediaPlayerPrivateAVFoundationCF::hasAvailableVideoFrame() const

Modified: branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (280997 => 280998)


--- branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2021-08-13 00:01:05 UTC (rev 280997)
+++ branches/safari-612.1.27.0.6-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2021-08-13 00:04:20 UTC (rev 280998)
@@ -606,7 +606,7 @@
     if (!m_avPlayer || m_haveBeenAskedToCreateLayer)
         return;
 
-    callOnMainThread([this, weakThis = makeWeakPtr(*this)] {
+    ensureOnMainThread([this, weakThis = makeWeakPtr(*this)] {
         if (!weakThis)
             return;
 
@@ -619,8 +619,6 @@
 
         if (!m_videoOutput)
             createVideoOutput();
-
-        player()->renderingModeChanged();
     });
 }
 
@@ -645,6 +643,8 @@
     if ([m_videoLayer respondsToSelector:@selector(setPIPModeEnabled:)])
         [m_videoLayer setPIPModeEnabled:(player()->fullscreenMode() & MediaPlayer::VideoFullscreenModePictureInPicture)];
 #endif
+
+    setNeedsRenderingModeChanged();
 }
 
 void MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer()
@@ -659,6 +659,8 @@
     m_videoLayerManager->didDestroyVideoLayer();
 
     m_videoLayer = nil;
+
+    setNeedsRenderingModeChanged();
 }
 
 MediaTime MediaPlayerPrivateAVFoundationObjC::getStartDate() const
@@ -2429,6 +2431,8 @@
     [m_videoOutput setDelegate:m_videoOutputDelegate.get() queue:globalPullDelegateQueue()];
 
     [m_avPlayerItem.get() addOutput:m_videoOutput.get()];
+
+    setNeedsRenderingModeChanged();
 }
 
 void MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput()
@@ -2442,6 +2446,8 @@
     INFO_LOG(LOGIDENTIFIER);
 
     m_videoOutput = 0;
+
+    setNeedsRenderingModeChanged();
 }
 
 bool MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer()

Modified: branches/safari-612.1.27.0.6-branch/Source/WebKit/ChangeLog (280997 => 280998)


--- branches/safari-612.1.27.0.6-branch/Source/WebKit/ChangeLog	2021-08-13 00:01:05 UTC (rev 280997)
+++ branches/safari-612.1.27.0.6-branch/Source/WebKit/ChangeLog	2021-08-13 00:04:20 UTC (rev 280998)
@@ -1,3 +1,89 @@
+2021-08-12  Russell Epstein  <[email protected]>
+
+        Cherry-pick r280776. rdar://problem/81861548
+
+    [Cocoa|GPU] platformLayer() not always added to remotedly hosted context; black video while playing
+    https://bugs.webkit.org/show_bug.cgi?id=228873
+    <rdar://81271107>
+    
+    Reviewed by Eric Carlson.
+    
+    Source/WebCore:
+    
+    Coalesce calls to renderingModeChanged() by setting a flag to call renderingModeChanged() in
+    the next run loop, and call into this coalescing method, setNeedsRenderingModeChanged(),
+    whenever the MediaPlayerPrivateAVFoundation subclasses create or destroy a video layer
+    or software painting context. This ensures that the MediaPlayerClient is always notified
+    when the rendering mode changes, regardless of why that change occurred.
+    
+    Drive-by fix: replace the call in createVideoLayer() to "callOnMainThread()"
+    with "ensureOnMainThread()". The call to "callOnMainThread()" was added to avoid a
+    deadlock in WebKitLegacy, and "ensureOnMainThread()" has the correct behavior there, but
+    will be synchronous in WebKit.
+    
+    * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+    (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
+    (WebCore::MediaPlayerPrivateAVFoundation::setNeedsRenderingModeChanged):
+    (WebCore::MediaPlayerPrivateAVFoundation::renderingModeChanged):
+    (WebCore::MediaPlayerPrivateAVFoundation::prepareForRendering):
+    * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+    * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+    (WebCore::MediaPlayerPrivateAVFoundationCF::destroyVideoLayer):
+    (WebCore::AVFWrapper::createAVCFVideoLayer):
+    (WebCore::AVFWrapper::createImageGenerator):
+    (WebCore::AVFWrapper::destroyImageGenerator):
+    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput):
+    
+    Source/WebKit:
+    
+    Currently, the RemoteMediaPlayerProxy will insert its MediaPlayer's platformLayer() into the
+    remotely hosted context when it receives a "firstVideoFrameAvailable()" notification.
+    However this is problematic for two reasons: AVPlayerLayer may not become "ready for
+    playback" when it is not in an active CALayer heirarchy, and for
+    MediaPlayerPrivateAVFoundation, firstVideoFrameAvailable() is only fired during
+    updateStates(), which is not guaranteed to occur unless another state change occurs.
+    
+    Instead, reparent the MediaPlayer's platformLayer() when we receive a
+    mediaPlayerRenderingModeChanged() notification, which notifies the client whenever a
+    platformLayer() is created or destroyed.
+    
+    * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+    * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
+    (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
+    (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-08-09  Jer Noble  <[email protected]>
+
+            [Cocoa|GPU] platformLayer() not always added to remotedly hosted context; black video while playing
+            https://bugs.webkit.org/show_bug.cgi?id=228873
+            <rdar://81271107>
+
+            Reviewed by Eric Carlson.
+
+            Currently, the RemoteMediaPlayerProxy will insert its MediaPlayer's platformLayer() into the
+            remotely hosted context when it receives a "firstVideoFrameAvailable()" notification.
+            However this is problematic for two reasons: AVPlayerLayer may not become "ready for
+            playback" when it is not in an active CALayer heirarchy, and for
+            MediaPlayerPrivateAVFoundation, firstVideoFrameAvailable() is only fired during
+            updateStates(), which is not guaranteed to occur unless another state change occurs.
+
+            Instead, reparent the MediaPlayer's platformLayer() when we receive a
+            mediaPlayerRenderingModeChanged() notification, which notifies the client whenever a
+            platformLayer() is created or destroyed.
+
+            * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+            * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
+            (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
+            (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged):
+
 2021-08-09  Russell Epstein  <[email protected]>
 
         Cherry-pick r280753. rdar://problem/81700429

Modified: branches/safari-612.1.27.0.6-branch/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp (280997 => 280998)


--- branches/safari-612.1.27.0.6-branch/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp	2021-08-13 00:01:05 UTC (rev 280997)
+++ branches/safari-612.1.27.0.6-branch/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp	2021-08-13 00:04:20 UTC (rev 280998)
@@ -518,10 +518,12 @@
     return m_renderingCanBeAccelerated;
 }
 
+#if !PLATFORM(COCOA)
 void RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged()
 {
     m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::RenderingModeChanged(), m_id);
 }
+#endif
 
 TrackPrivateRemoteIdentifier RemoteMediaPlayerProxy::addRemoteAudioTrackProxy(WebCore::AudioTrackPrivate& track)
 {

Modified: branches/safari-612.1.27.0.6-branch/Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm (280997 => 280998)


--- branches/safari-612.1.27.0.6-branch/Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm	2021-08-13 00:01:05 UTC (rev 280997)
+++ branches/safari-612.1.27.0.6-branch/Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm	2021-08-13 00:04:20 UTC (rev 280998)
@@ -66,11 +66,15 @@
 void RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable()
 {
     // Initially the size of the platformLayer may be 0x0 because we do not provide mediaPlayerContentBoxRect() in this class.
-    m_inlineLayerHostingContext->setRootLayer(m_player->platformLayer());
     setVideoInlineSizeIfPossible(*m_inlineLayerHostingContext, m_videoInlineSize);
     m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::FirstVideoFrameAvailable(), m_id);
 }
 
+void RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged()
+{
+    m_inlineLayerHostingContext->setRootLayer(m_player->platformLayer());
+    m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::RenderingModeChanged(), m_id);
+}
 void RemoteMediaPlayerProxy::setVideoInlineSizeFenced(const WebCore::FloatSize& size, const WTF::MachSendRight& machSendRight)
 {
     m_inlineLayerHostingContext->setFencePort(machSendRight.sendRight());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to