mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
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.
43 lines
1.4 KiB
Plaintext
43 lines
1.4 KiB
Plaintext
#import <DOM/EventHandler.idl>
|
|
#import <MediaSourceExtensions/MediaSourceHandle.idl>
|
|
#import <MediaSourceExtensions/SourceBufferList.idl>
|
|
|
|
// https://w3c.github.io/media-source/#dom-mediasource
|
|
enum ReadyState {
|
|
"closed",
|
|
"open",
|
|
"ended",
|
|
};
|
|
|
|
// https://w3c.github.io/media-source/#dom-mediasource
|
|
enum EndOfStreamError {
|
|
"network",
|
|
"decode",
|
|
};
|
|
|
|
// https://w3c.github.io/media-source/#dom-mediasource
|
|
[Exposed=(Window,DedicatedWorker), Experimental]
|
|
interface MediaSource : EventTarget {
|
|
constructor();
|
|
|
|
[FIXME, SameObject, Exposed=DedicatedWorker]
|
|
readonly attribute MediaSourceHandle handle;
|
|
readonly attribute SourceBufferList sourceBuffers;
|
|
readonly attribute SourceBufferList activeSourceBuffers;
|
|
readonly attribute ReadyState readyState;
|
|
|
|
attribute unrestricted double duration;
|
|
attribute EventHandler onsourceopen;
|
|
attribute EventHandler onsourceended;
|
|
attribute EventHandler onsourceclose;
|
|
|
|
static readonly attribute boolean canConstructInDedicatedWorker;
|
|
|
|
SourceBuffer addSourceBuffer(DOMString type);
|
|
[FIXME] undefined removeSourceBuffer(SourceBuffer sourceBuffer);
|
|
undefined endOfStream(optional EndOfStreamError error);
|
|
[FIXME] undefined setLiveSeekableRange(double start, double end);
|
|
[FIXME] undefined clearLiveSeekableRange();
|
|
static boolean isTypeSupported(DOMString type);
|
|
};
|