[webkit-changes] [WebKit/WebKit] f78ee0: [MSE] video's readyState keeps incorrectly switchi...

Jean-Yves Avenard noreply at github.com
Sat Mar 25 04:56:02 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f78ee0bea7233a1479a018b549d71c827e4e6769
      https://github.com/WebKit/WebKit/commit/f78ee0bea7233a1479a018b549d71c827e4e6769
  Author: Jean-Yves Avenard <jya at apple.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M Source/WebCore/Modules/mediasource/ManagedMediaSource.cpp
    M Source/WebCore/Modules/mediasource/MediaSource.cpp
    M Source/WebCore/Modules/mediasource/MediaSource.h
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/platform/graphics/MediaPlayer.cpp
    M Source/WebCore/platform/graphics/MediaPlayer.h
    M Source/WebCore/platform/graphics/MediaPlayerPrivate.h
    A Source/WebCore/platform/graphics/MediaSourcePrivate.cpp
    M Source/WebCore/platform/graphics/MediaSourcePrivate.h
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
    M Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp
    M Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h
    M Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp
    M Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
    M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp

  Log Message:
  -----------
  [MSE] video's readyState keeps incorrectly switching between
 HAVE_CURRENT_DATA and HAVE_METADATA
 https://bugs.webkit.org/show_bug.cgi?id=254399 rdar://107178961

Reviewed by Youenn Fablet.

Stop using the MediaPlayer's readyState value to determine if the currentTime is progressing.
Instead use MediaSource's buffered ranges to determine if we have playable
data in the future.
readyState is asynchronously set and decoupled from currentMediaTime since bug
225396 and may not be up to date at the time we check the currentMediaTime.

Additionally, do not update the cached time when pausing if it's marked
as not-progressing.

Testing covered in media/media-source/media-source-monitor-source-buffers.html
once webkit.org/b/225367 is done.

* Source/WebCore/Modules/mediasource/ManagedMediaSource.cpp:
(WebCore::ManagedMediaSource::isBuffered const):
* Source/WebCore/Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::hasBufferedTime):
(WebCore::MediaSource::hasFutureTime):
* Source/WebCore/Modules/mediasource/MediaSource.h:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::currentTimeMayProgress const):
(WebCore::MediaPlayer::readyState const):
(WebCore::MediaPlayer::readyState): Deleted.
* Source/WebCore/platform/graphics/MediaPlayer.h:
* Source/WebCore/platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::currentMediaTimeMayProgress const):
* Source/WebCore/platform/graphics/MediaSourcePrivate.cpp: Added.
(WebCore::MediaSourcePrivate::hasFutureTime const):
* Source/WebCore/platform/graphics/MediaSourcePrivate.h:
(WebCore::MediaSourcePrivate::setTimeFudgeFactor):
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentMediaTimeMayProgress const):
* Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTimeMayProgress const):
* Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::currentMediaTimeMayProgress const):
* Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::mediaPlayerPausedOrStalled const):
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::pause):
(WebKit::MediaPlayerPrivateRemote::currentTimeChanged):

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




More information about the webkit-changes mailing list