Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4b47aa217bc82f6f0dc160eeec086eac846bb651
      
https://github.com/WebKit/WebKit/commit/4b47aa217bc82f6f0dc160eeec086eac846bb651
  Author: Jean-Yves Avenard <j...@apple.com>
  Date:   2023-04-18 (Tue, 18 Apr 2023)

  Changed paths:
    M Source/WebCore/Modules/mediasource/ManagedMediaSource.cpp
    M Source/WebCore/Modules/mediasource/ManagedMediaSource.h
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/file-with-managedmse.html
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPageHasMediaStreamingActivity.mm

  Log Message:
  -----------
  ManagedMediaSource should stop tagging network operations as media if player 
is not following guidance
https://bugs.webkit.org/show_bug.cgi?id=255584
rdar://106091782

Reviewed by Jer Noble.

As soon as the Managed Media Source element's streaming attribute was
true, we would tag all networking activity as media related.
However, this didn't account for live playback where small buffers are
appended repeatedly without ever filling the buffered window requested.

We request from the JS player to have "high threshold" seconds ahead of
currentTime. If we fail to buffer that much within "high threshold" seconds
we can assume one of the following:
- networking is too slow to keep up with playback
- or it's a live stream where the player will continously append new data.

In either case, we don't want to keep the 5G mode on to reduce power usage.
So we stop flagging networking activity as media then.

Add API test.

* Source/WebCore/Modules/mediasource/ManagedMediaSource.cpp:
(WebCore::ManagedMediaSource::ManagedMediaSource):
(WebCore::ManagedMediaSource::~ManagedMediaSource):
(WebCore::ManagedMediaSource::setStreaming):
(WebCore::ManagedMediaSource::ensurePrefsRead):
(WebCore::ManagedMediaSource::monitorSourceBuffers):
(WebCore::ManagedMediaSource::streamingTimerFired):
* Source/WebCore/Modules/mediasource/ManagedMediaSource.h:
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaState const):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPageHasMediaStreamingActivity.mm:
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/Tests/WebKit/file-with-managedmse.html:

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to