Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 86301d12f31fa6659af3ee6fc5c0ac8be73b73a7
      
https://github.com/WebKit/WebKit/commit/86301d12f31fa6659af3ee6fc5c0ac8be73b73a7
  Author: Xabier Rodriguez-Calvar <[email protected]>
  Date:   2023-09-27 (Wed, 27 Sep 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/media/media-source/media-source-play-zero-playbackrate-expected.txt
    A LayoutTests/media/media-source/media-source-play-zero-playbackrate.html
    M LayoutTests/platform/glib/TestExpectations
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
    M 
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp

  Log Message:
  -----------
  [GStreamer] Rework playback rates handling
https://bugs.webkit.org/show_bug.cgi?id=259732

Reviewed by Alicia Boya Garcia.

There were some use cases in MSE where playback rate change was not working 
properly and it was decided that a better
idea would be to do a rework of the playback rate handling in the base class. 
The idea was to not do playback rate state
changes out of the updateStates functions (both regular and MSE) because 
calling that function should do what is
expected at any moment. In order to do that, we needed to switch the boolean 
variable representing if pipeline was
paused because of rate into something more reflecting the different states we 
could be in. We created a self explanatory
enum class (that also was comments to make it even more clear) and set that 
state when needed for updateStates to move
the pipeline if needed.

A fly-by fix was to make the paused function to return true when we are also 
moving to paused during an async state
change because the test we are introducing here arose this flaky bug more 
clearly. The bug was that the media element
went bananas could not realize the player was paused (or on its way to pause) 
and it was skipping state changes and
playback rate changes.

* LayoutTests/TestExpectations:
* 
LayoutTests/media/media-source/media-source-play-zero-playbackrate-expected.txt:
 Added.
* LayoutTests/media/media-source/media-source-play-zero-playbackrate.html: 
Added.
* LayoutTests/platform/glib/TestExpectations:
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::pause):
(WebCore::MediaPlayerPrivateGStreamer::paused const):
(WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
(WebCore::MediaPlayerPrivateGStreamer::setRate):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* 
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::play):
(WebCore::MediaPlayerPrivateGStreamerMSE::pause):
(WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to