Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 81369aab5cd7115eaf01a5df507f540723bd9765
      
https://github.com/WebKit/WebKit/commit/81369aab5cd7115eaf01a5df507f540723bd9765
  Author: Enrique Ocaña González <[email protected]>
  Date:   2025-02-19 (Wed, 19 Feb 2025)

  Changed paths:
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h

  Log Message:
  -----------
  [GStreamer] Account for internal pauses because of buffering
https://bugs.webkit.org/show_bug.cgi?id=287881

Reviewed by Xabier Rodriguez-Calvar and Philippe Normand.

The PlaybackRatePausedState in MediaPlayerPrivateGStreamer only accounts
for different pause reasons because of manual pause and playbackRate ==
0, but pauses because of low buffering level should also be accounted.
Currently they aren't (but the player can get paused because of it) and
that's confusing the code that deals with pauses/unpauses because of
playbackRate.

See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/1455

This downstream PR proposes to "abuse"
PlaybackRatePausedState::RatePaused to keep tack of pauses because of
buffering, but that's conceptually wrong. A new BufferingPaused state
should be created to keep track of this pause reason and be able to
recover from it (unpause) later.

This commit creates that new BufferingPaused state and keeps track of
it in a similar way to how ManuallyPaused is managed (but pauses for
buffering aren't explicit manual pauses).

Co-authored by: suresh-khurdiya-infosys <[email protected]>

* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::play): Also set RatePaused when we're in 
the BufferingPaused state and playbackRate is zero.
(WebCore::MediaPlayerPrivateGStreamer::updateStates): Set 
m_playbackRatePausedState to RatePaused when the rate is actually zero, and to 
BufferingPaused when the pause happens because of buffering.
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 
Added new PlaybackRatePausedState::BufferingPaused state and explanation.

Canonical link: https://commits.webkit.org/290606@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

Reply via email to