mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
LibVideo: Read Matroska lazily so that large files can start quickly
The Demuxer class was changed to return errors for more functions so that all of the underlying reading can be done lazily. Other than that, the demuxer interface is unchanged, and only the underlying reader was modified. The MatroskaDocument class is no more, and MatroskaReader's getter functions replace it. Every MatroskaReader getter beyond the Segment element's position is parsed lazily from the file as needed. This means that all getter functions can return DecoderErrors which must be handled by callers.
This commit is contained in:
parent
f4c476b26f
commit
393cfdd5c5
11 changed files with 576 additions and 310 deletions
|
@ -18,7 +18,7 @@ class Demuxer {
|
|||
public:
|
||||
virtual ~Demuxer() = default;
|
||||
|
||||
virtual Vector<Track> get_tracks_for_type(TrackType type) = 0;
|
||||
virtual DecoderErrorOr<Vector<Track>> get_tracks_for_type(TrackType type) = 0;
|
||||
|
||||
DecoderErrorOr<NonnullOwnPtr<VideoSample>> get_next_video_sample_for_track(Track track)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ public:
|
|||
|
||||
virtual DecoderErrorOr<void> seek_to_most_recent_keyframe(Track track, size_t timestamp) = 0;
|
||||
|
||||
virtual Time duration() = 0;
|
||||
virtual DecoderErrorOr<Time> duration() = 0;
|
||||
|
||||
protected:
|
||||
virtual DecoderErrorOr<NonnullOwnPtr<Sample>> get_next_sample_for_track(Track track) = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue