Title: [283583] trunk/Source/WebCore
- Revision
- 283583
- Author
- [email protected]
- Date
- 2021-10-05 16:28:03 -0700 (Tue, 05 Oct 2021)
Log Message
REGRESSION (Monterey): paramountplus.com: Cannot enter fullscreen in Safari
https://bugs.webkit.org/show_bug.cgi?id=231005
The page performs a lot of canvas readbacks when entering or exiting
fullscreen mode.
When the media is encrypted, attempting to do so would have made the
sync call from the content to GPU process hang for one full second.
Worse the CATransaction should it fail to paint would retry continuously.
After 10 attempts (and blocking the process for over 10s) the
content process would get automatically killed.
This works around rdar://83867877 where outputMediaDataWillChange isn't
called following a call to
[AVPlayerItemVideoOutput requestNotificationOfMediaDataChangeWithAdvanceInterval].
In case we timed out. we will disable this functionality until there's a
track change.
Reviewed by Eric Carlson.
We do not have the infrastructure to easily test interacting with encrypted
content. Once bug 231006 is fixed, we could write a test to ensure that canvas
readbacks do not lock-up.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
(WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (283582 => 283583)
--- trunk/Source/WebCore/ChangeLog 2021-10-05 22:47:35 UTC (rev 283582)
+++ trunk/Source/WebCore/ChangeLog 2021-10-05 23:28:03 UTC (rev 283583)
@@ -1,3 +1,32 @@
+2021-10-05 Jean-Yves Avenard <[email protected]>
+
+ REGRESSION (Monterey): paramountplus.com: Cannot enter fullscreen in Safari
+ https://bugs.webkit.org/show_bug.cgi?id=231005
+
+ The page performs a lot of canvas readbacks when entering or exiting
+ fullscreen mode.
+ When the media is encrypted, attempting to do so would have made the
+ sync call from the content to GPU process hang for one full second.
+ Worse the CATransaction should it fail to paint would retry continuously.
+ After 10 attempts (and blocking the process for over 10s) the
+ content process would get automatically killed.
+ This works around rdar://83867877 where outputMediaDataWillChange isn't
+ called following a call to
+ [AVPlayerItemVideoOutput requestNotificationOfMediaDataChangeWithAdvanceInterval].
+ In case we timed out. we will disable this functionality until there's a
+ track change.
+
+ Reviewed by Eric Carlson.
+
+ We do not have the infrastructure to easily test interacting with encrypted
+ content. Once bug 231006 is fixed, we could write a test to ensure that canvas
+ readbacks do not lock-up.
+
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
+
2021-10-05 Ayumi Kojima <[email protected]>
Unreviewed, reverting r283339.
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (283582 => 283583)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h 2021-10-05 22:47:35 UTC (rev 283582)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h 2021-10-05 23:28:03 UTC (rev 283583)
@@ -444,6 +444,7 @@
#endif
bool m_runningModalPaint { false };
bool m_haveProcessedChapterTracks { false };
+ bool m_waitForVideoOutputMediaDataWillChangeTimedOut { false };
};
}
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (283582 => 283583)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2021-10-05 22:47:35 UTC (rev 283582)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2021-10-05 23:28:03 UTC (rev 283583)
@@ -2388,6 +2388,10 @@
for (auto& track : m_audioTracks)
track->resetPropertiesFromTrack();
+ // In case the video track content changed, we may be able to perform a readback again.
+ if (count)
+ m_waitForVideoOutputMediaDataWillChangeTimedOut = false;
+
ALWAYS_LOG(LOGIDENTIFIER, "track count was ", count, ", is ", m_videoTracks.size());
}
@@ -2601,6 +2605,8 @@
void MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange()
{
+ if (m_waitForVideoOutputMediaDataWillChangeTimedOut)
+ return;
[m_videoOutput requestNotificationOfMediaDataChangeWithAdvanceInterval:0];
// Wait for 1 second.
@@ -2616,9 +2622,10 @@
m_runningModalPaint = false;
bool satisfied = timeoutTimer.isActive();
- if (!satisfied)
+ if (!satisfied) {
ERROR_LOG(LOGIDENTIFIER, "timed out");
- else
+ m_waitForVideoOutputMediaDataWillChangeTimedOut = true;
+ } else
INFO_LOG(LOGIDENTIFIER, "waiting for videoOutput took ", (MonotonicTime::now() - start).seconds());
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes