Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: f9a82eb37c5e5616212cd4f208bb17b6cc45cc2f https://github.com/WebKit/WebKit/commit/f9a82eb37c5e5616212cd4f208bb17b6cc45cc2f Author: Jean-Yves Avenard <j...@apple.com> Date: 2024-02-08 (Thu, 08 Feb 2024)
Changed paths: M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h Log Message: ----------- Add TimeProgressEstimator class https://bugs.webkit.org/show_bug.cgi?id=268911 rdar://122463053 Reviewed by Eric Carlson and Youenn Fablet. Simplify and move the emulated time progress management to its own class. Fly-by: the time would have continued to progress when pause() was called (until we got a new time update from the GPU process), reading the time following a call to pause() would have temporarily returned the wrong value. When seeking, the time should have stopped until the GPU process signalled we had completed the seek. The class is thread-safe when used with MediaSource, when used with CRABS it will only be called from the main thread. Covered by existing tests. * Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::TimeProgressEstimator::TimeProgressEstimator): (WebKit::MediaPlayerPrivateRemote::TimeProgressEstimator::currentTime const): (WebKit::MediaPlayerPrivateRemote::TimeProgressEstimator::cachedTime const): (WebKit::MediaPlayerPrivateRemote::TimeProgressEstimator::timeIsProgressing const): (WebKit::MediaPlayerPrivateRemote::TimeProgressEstimator::pause): (WebKit::MediaPlayerPrivateRemote::TimeProgressEstimator::setTime): (WebKit::MediaPlayerPrivateRemote::TimeProgressEstimator::setRate): (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): (WebKit::MediaPlayerPrivateRemote::pause): (WebKit::MediaPlayerPrivateRemote::durationMediaTime const): (WebKit::MediaPlayerPrivateRemote::currentMediaTime const): (WebKit::MediaPlayerPrivateRemote::seekToTarget): (WebKit::MediaPlayerPrivateRemote::seeked): (WebKit::MediaPlayerPrivateRemote::rateChanged): (WebKit::MediaPlayerPrivateRemote::playbackStateChanged): (WebKit::MediaPlayerPrivateRemote::currentTimeChanged): (WebKit::MediaPlayerPrivateRemote::performTaskAtMediaTime): fly-by: completionHandler wasn't called under some circumstances. * Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h: Canonical link: https://commits.webkit.org/274278@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes