Title: [282774] trunk/Source/WebCore
Revision
282774
Author
peng.l...@apple.com
Date
2021-09-20 13:37:57 -0700 (Mon, 20 Sep 2021)

Log Message

[GPUP] Videos appear black but audio plays normally
https://bugs.webkit.org/show_bug.cgi?id=230471
<rdar://82121369>

Reviewed by Youenn Fablet.

For some videos, the media player (MediaPlayerPrivateAVFoundation) starts
with the "MediaRenderingToContext" mode, and it switches to the "MediaRenderingToLayer"
mode later. When the mode switch happens, we have to destroy the context
video renderer before creating the video layer. Otherwise, we won't receive
the notification regarding "readyForDisplay" key path, which drives the
`firstVideoFrameAvailable` callback.

`destroyContextVideoRenderer()` destroys the `m_videoOutput`, but it will
be recreated by `createVideoLayer()`.

Manually tested.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (282773 => 282774)


--- trunk/Source/WebCore/ChangeLog	2021-09-20 20:18:36 UTC (rev 282773)
+++ trunk/Source/WebCore/ChangeLog	2021-09-20 20:37:57 UTC (rev 282774)
@@ -1,3 +1,26 @@
+2021-09-20  Peng Liu  <peng.l...@apple.com>
+
+        [GPUP] Videos appear black but audio plays normally
+        https://bugs.webkit.org/show_bug.cgi?id=230471
+        <rdar://82121369>
+
+        Reviewed by Youenn Fablet.
+
+        For some videos, the media player (MediaPlayerPrivateAVFoundation) starts
+        with the "MediaRenderingToContext" mode, and it switches to the "MediaRenderingToLayer"
+        mode later. When the mode switch happens, we have to destroy the context
+        video renderer before creating the video layer. Otherwise, we won't receive
+        the notification regarding "readyForDisplay" key path, which drives the
+        `firstVideoFrameAvailable` callback.
+
+        `destroyContextVideoRenderer()` destroys the `m_videoOutput`, but it will
+        be recreated by `createVideoLayer()`.
+
+        Manually tested.
+
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
+
 2021-09-20  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Refactor some code that controls Live Text selection behavior

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (282773 => 282774)


--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2021-09-20 20:18:36 UTC (rev 282773)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2021-09-20 20:37:57 UTC (rev 282774)
@@ -136,6 +136,7 @@
         break;
 
     case MediaRenderingToLayer:
+        destroyContextVideoRenderer();
         createVideoLayer();
         break;
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to