Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ebca0eca47d9d85b228679df6e88dfe21d5e636b
https://github.com/WebKit/WebKit/commit/ebca0eca47d9d85b228679df6e88dfe21d5e636b
Author: Jean-Yves Avenard <[email protected]>
Date: 2025-04-07 (Mon, 07 Apr 2025)
Changed paths:
M
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h
M
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h
M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm
M Source/WebCore/platform/graphics/cocoa/VideoMediaSampleRenderer.h
M Source/WebCore/platform/graphics/cocoa/VideoMediaSampleRenderer.mm
M Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.h
M Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm
Log Message:
-----------
Vimeo web app videos reset to beginning when brought back from background the
first time
https://bugs.webkit.org/show_bug.cgi?id=290900
rdar://148397123
Reviewed by Jer Noble and Youenn Fablet.
When the web process goes into the background, the AVSampleBufferDisplayLayer
will send a notification that to resume playback we need to flush, all while
playback is paused. Existing VT session are also invalidated and can no longer
be used to further decode content.
>From time to time, the SourceBufferPrivateAVFObjC will continue to attempt
to decode current content before playback is paused. This could lead the current
WebCoreDecompressionSession with its now invalidated VT session to attempt
to decode which would error.
Detect when the VTDecompressionSession got invalidated and signal that to
continue decoding we need to flush the video track and recreate the
WebCoreDecompressionSession.
If the switch to a new VT session can be done transparently (that is the change
occurred on a keyframe) we will do so and immediately recreate the VT session
without the need for a flush.
In a follow-up change we will handle when/how to flush the
VideoMediaSampleRenderer
when the process is now in the background.
Manually tested. The current testing infrastructure is using iOS simulator
which doesn't use a videocodecd process, VT session aren't invalidated when
the webview goes into the background and we can't replicate the condition
that would have triggered this bug.
Work to add a regression test will be considered in webkit.org/b/291072
*
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
*
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::setLayerRequiresFlush):
(WebCore::SourceBufferPrivateAVFObjC::configureVideoRenderer):
(WebCore::SourceBufferPrivateAVFObjC::invalidateVideoRenderer):
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h:
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm:
(WebCore::MediaPlayerPrivateWebM::setReadyState):
(WebCore::MediaPlayerPrivateWebM::trackDidChangeSelected):
(WebCore::MediaPlayerPrivateWebM::invalidateVideoRenderer):
(WebCore::MediaPlayerPrivateWebM::setVideoRenderer):
(WebCore::MediaPlayerPrivateWebM::setLayerRequiresFlush):
* Source/WebCore/platform/graphics/cocoa/VideoMediaSampleRenderer.h:
* Source/WebCore/platform/graphics/cocoa/VideoMediaSampleRenderer.mm:
(WebCore::VideoMediaSampleRenderer::enqueueSample):
(WebCore::VideoMediaSampleRenderer::decodeNextSample):
(WebCore::VideoMediaSampleRenderer::initializeDecompressionSession):
(WebCore::VideoMediaSampleRenderer::flush):
(WebCore::VideoMediaSampleRenderer::notifyWhenVideoRendererRequiresFlushToResumeDecoding):
(WebCore::VideoMediaSampleRenderer::notifyVideoRendererRequiresFlushToResumeDecoding):
* Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.h:
* Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
(WebCore::WebCoreDecompressionSession::decodeSampleInternal):
(WebCore::WebCoreDecompressionSession::decodeSampleSync):
Canonical link: https://commits.webkit.org/293396@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes