summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibVideo/Containers/Demuxer.h
AgeCommit message (Collapse)Author
2023-02-08LibVideo: Pass the current sample to demuxers to lazily seek betterZaggy1024
In cases where the PlaybackManager's earliest buffered or displayed sample is closer to the seek target than the demuxer's chosen keyframe, we don't want to seek at all. To enable this, demuxers now receive an optional parameter with the earliest timestamp that the caller can still access. The demuxer in turn returns an optional to indicate when a seek was not needed, which allows PlaybackManager to avoid clearing its queue and re-decoding frames.
2022-11-25LibVideo: Add a fast seeking mode to seek only to keyframesZaggy1024
Now that we're able to find the nearest keyframe, we can have a fast seeking mode that only seeks to keyframes, so that it doesn't have to also decode inter frames until it reaches the timestamp. The default is still accurate seeking, so that the entire seeking implementation can be tested.
2022-11-25VideoPlayer/LibVideo: Implement the UI functionality for seekingZaggy1024
With these changes, the seek bar can be used, but only to seek to the start of the file. Seeking to anywhere else in the file will cause an error in the demuxer. The timestamp label that was previously invisible now has its text set according to either the playback or seek slider's position.
2022-11-25LibVideo: Read Matroska lazily so that large files can start quicklyZaggy1024
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.
2022-11-25LibVideo: Reorganize demuxer file hierarchy and rename Matroska filesZaggy1024
As new demuxers are added, this will get quite full of files, so it'll be good to have a separate folder for these. To avoid too many chained namespaces, the Containers subdirectory is not also a namespace, but the Matroska folder is for the sake of separating the multiple classes for parsed information entering the Video namespace.