Bug 248217 - [GStreamer] Fix readyState calculations
Summary: [GStreamer] Fix readyState calculations
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-11-22 04:38 PST by Vivienne Watermeier
Modified: 2022-11-28 03:50 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vivienne Watermeier 2022-11-22 04:38:34 PST
On some platforms, the audio sink is acting as a fake sink while the decoder fetches data from the pipeline and transfers it to the SoC drivers, removing it from the gstreamer pipeline. This is done even in READY and PAUSED states.

Now, in webkit, if the progressive playback player is in a READY or PAUSED state, we're assuming the queue2 element (or multiqueue in AV pipelines) is very much the only place which accumulates the data and thus we treat it like a reliable source of information on whether we have enough data to play or not.

What happens is the following: for pipelines with very low download speed (like e.g. livestreams) we're slowly feeding the queue2 element with data (regardless the READY/PAUSED/PLAYING state) while the decoder is consuming the data very fast from the very same queue2 element at the same time. So, generally speaking, in that situation (on that platform) we cannot really relay on buffering messages anymore - regardless the state a player is in.

Additionally, since the buffering query is issued to the entire pipeline, on some platforms it may yield misleading results if some random element implements buffering query and receives that query first.

See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/975
Comment 1 Vivienne Watermeier 2022-11-22 05:30:43 PST
I forgot to mention, on that platform the audio sink implements buffering queries, so that could be used to get accurate information, which is why the mentioned buffering query[1] is relevant.

[1]: https://github.com/WebKit/WebKit/blob/9ba628e9a29dbe1c7519f925f8e3f1ce94e73076/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp#L2340
Comment 2 Vivienne Watermeier 2022-11-22 05:36:09 PST
Pull request: https://github.com/WebKit/WebKit/pull/6732
Comment 3 EWS 2022-11-28 03:49:01 PST
Committed 257066@main (738525821b03): <https://commits.webkit.org/257066@main>

Reviewed commits have been landed. Closing PR #6732 and removing active labels.
Comment 4 Radar WebKit Bug Importer 2022-11-28 03:50:20 PST
<rdar://problem/102711776>