Bug 265079 - [GPUP][MSE] RemoteSourceBufferProxy::EvictCodedFrames shouldn't be a sync call
Summary: [GPUP][MSE] RemoteSourceBufferProxy::EvictCodedFrames shouldn't be a sync call
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks: 226632
  Show dependency treegraph
 
Reported: 2023-11-17 22:39 PST by Jean-Yves Avenard [:jya]
Modified: 2024-02-27 06:30 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 Jean-Yves Avenard [:jya] 2023-11-17 22:39:11 PST
The MSE spec requires the Prepare Append [1] algorithm to run synchronously at the start of appendBuffer [2]

Part of this algorithm is the Coded Frames Eviction [3] algorithm. 
With the GPU Process this is a sync dispatch, and is problematic as it can be run at any time and not waiting for any pending SourceBufferPrivate operations to complete.

Currently, the only need for this call to be synchronous is to determine how much data is evictable from the SourceBuffers/TrackBuffers ; we could instead calculate this value after each SourceBuffer operation and update it as time progresses. This information would be sent at regular interval back to the content process, so that the next time the Prepare Append Algorithm is run in the Content Process, it already approximately knows how much data is evictable.
The information doesn't need to be 100% accurate, it just needs to be accurate enough so that on average the buffered size is below the limit.

[1] https://w3c.github.io/media-source/#sourcebuffer-prepare-append
[2] https://w3c.github.io/media-source/#dom-sourcebuffer-appendbuffer
[3] https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction
Comment 1 Radar WebKit Bug Importer 2023-11-24 22:40:15 PST
<rdar://problem/118783504>
Comment 2 Jean-Yves Avenard [:jya] 2024-02-26 01:35:35 PST
Pull request: https://github.com/WebKit/WebKit/pull/25092
Comment 3 EWS 2024-02-27 06:30:51 PST
Committed 275380@main (bbf768df7ba7): <https://commits.webkit.org/275380@main>

Reviewed commits have been landed. Closing PR #25092 and removing active labels.