[webkit-changes] [WebKit/WebKit] 925970: MediaPlayerPrivateWebM caused the seeked event to ...

Jean-Yves Avenard noreply at github.com
Tue Jan 16 17:48:41 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 925970b7979d9517eebb9014b76ef399c9572f4a
      https://github.com/WebKit/WebKit/commit/925970b7979d9517eebb9014b76ef399c9572f4a
  Author: Jean-Yves Avenard <jya at apple.com>
  Date:   2024-01-16 (Tue, 16 Jan 2024)

  Changed paths:
    A LayoutTests/media/content/test-vp8.webm
    A LayoutTests/media/content/test-vp8.webm.png
    A LayoutTests/media/media-vp8-webm-expected.html
    A LayoutTests/media/media-vp8-webm.html
    M LayoutTests/platform/mac-wk1/TestExpectations
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
    M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h
    M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm
    M Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.h
    M Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm

  Log Message:
  -----------
  MediaPlayerPrivateWebM caused the seeked event to be fired before the seek has completed.
https://bugs.webkit.org/show_bug.cgi?id=267326
rdar://120776794

Reviewed by Youenn Fablet.

MediaPlayerPrivateWebM only implemented the most basic of seeking operation.
We copy the logic from the MediaPlayerPrivateMediaSourceAVFObjC into the WebM
player.

Now the seeked event will only be fired once the seek operation has completed
and once the frame at the seek operation has completed.
The WebM player would also always start playback after a seek regardless
of the element playing prior the operation, only resume playback if we
were seeking before.

Following a call to flush() WebCoreDecompressionSession could continue
delivering in-flight decompressed frame. We modify it so that we can guarantee
that no frames enqueued before the call to flush() can get delivered.
This is done by using NativePromise to track the actual decoding and storing
the flushId value at the start of the decoding, and to stop delivering the
frame if that flushId has changed.

Add tests.
On macOS < 14 and iOS < 17; the required `isReadyForDisplay` API to accurately
determine that a frame got painted doesn't exist.

* LayoutTests/media/content/test-vp8.webm: Added.
* LayoutTests/media/content/test-vp8.webm.png: Added.
* LayoutTests/media/media-vp8-webm-expected.html: Added.
* LayoutTests/media/media-vp8-webm.html: Added.
* LayoutTests/platform/mac-wk1/TestExpectations:
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h:
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm:
(WebCore::MediaPlayerPrivateWebM::MediaPlayerPrivateWebM):
(WebCore::MediaPlayerPrivateWebM::~MediaPlayerPrivateWebM):
(WebCore::MediaPlayerPrivateWebM::play):
(WebCore::MediaPlayerPrivateWebM::pause):
(WebCore::MediaPlayerPrivateWebM::seekToTarget):
(WebCore::MediaPlayerPrivateWebM::seekInternal):
(WebCore::MediaPlayerPrivateWebM::maybeCompleteSeek):
(WebCore::MediaPlayerPrivateWebM::seeking const):
(WebCore::MediaPlayerPrivateWebM::clampTimeToLastSeekTime const):
(WebCore::MediaPlayerPrivateWebM::shouldBePlaying const):
(WebCore::MediaPlayerPrivateWebM::setRateDouble):
(WebCore::MediaPlayerPrivateWebM::setHasAvailableVideoFrame):
(WebCore::MediaPlayerPrivateWebM::enqueueSample):
(WebCore::MediaPlayerPrivateWebM::destroyDecompressionSession):
(WebCore::MediaPlayerPrivateWebM::layerDidReceiveError):
(WebCore::MediaPlayerPrivateWebM::layerReadyForDisplayChanged):
* Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.h: Remove unused m_consumerQueue related code
* Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::enqueueSample):
(WebCore::WebCoreDecompressionSession::enqueueCompressedSample):
(WebCore::WebCoreDecompressionSession::maybeDecodeNextSample):
(WebCore::WebCoreDecompressionSession::decodeSample):
(WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
(WebCore::WebCoreDecompressionSession::isReadyForMoreMediaData const):
(WebCore::WebCoreDecompressionSession::flush):
(WebCore::WebCoreDecompressionSession::finishCurrentDecodingAndReportError): Deleted.
(WebCore::WebCoreDecompressionSession::finishCurrentDecodingAndDecodeNextSample): Deleted.

Canonical link: https://commits.webkit.org/273109@main




More information about the webkit-changes mailing list