LibWeb: Implement appending and demuxing WebM MSE segments

The segments are parsed for the SourceBufferProcessor by the
WebMByteStreamParser. It parses the initialization segment to update
its internal set of tracks, then SourceBufferProcessor/SourceBuffer set
them up for playback. When a media segment is received, it also parses
as much of it as is available, returning all the coded frames found so
far. SourceBufferProcessor then tells TrackBufferDemuxer to remove any
overlapping frames and insert the new ones.

TrackBufferDemuxer implements the Demuxer interface in terms of the
coded frame store maintained by the SourceBufferProcessor. It returns
the frames in decode order when requested by a data provider. When a
is needed, it finds the keyframe prior to the target timestamp, and
checks that there are no gaps in data up to the target timestamp. If
there are any gaps, it blocks until the gaps are gone.
This commit is contained in:
Zaggy1024
2026-03-26 22:12:32 -05:00
committed by Gregory Bertilson
parent c4612110f5
commit 51c3f7c41e
Notes: github-actions[bot] 2026-04-01 07:56:02 +00:00
26 changed files with 2226 additions and 34 deletions

View File

@@ -5,4 +5,15 @@ PASS: sourceopen fired
PASS: addSourceBuffer succeeded
PASS: loaded media data (2009229 bytes)
PASS: appendBuffer() for slice 1/3
FAIL: sourceopen handler: Error: error event on SourceBuffer
buffered after slice 1/3: not available
PASS: slice 1 appended
PASS: appendBuffer() for slice 2/3
buffered after slice 2/3: not available
PASS: slice 2 appended
PASS: appendBuffer() for slice 3/3
buffered after slice 3/3: not available
PASS: slice 3 appended
PASS: endOfStream succeeded
buffered after endOfStream: not available
PASS: play() promise resolved
PASS: playing