Commit Graph

22 Commits

Author SHA1 Message Date
Zaggy1024
653a3452df LibMedia: Move conversion of Matroska codecs to CodecID to a new file
This function is needed in Matroska::Reader to check for Opus in the
next commit.
2025-11-21 11:02:44 +01:00
Zaggy1024
0f6f5cd353 LibMedia+Tests: Clear the current block when seeking in MatroskaDemuxer
Otherwise, if the sample iterator resides in a block with multiple
frames before the seek, the demuxer will output all the remaining
frames from that block before moving on to the block at the seeked
position.
2025-11-13 13:48:17 +01:00
Zaggy1024
634e5ff491 LibMedia: Move CICP values from CodedFrame to Track
All our current demuxers have these constant for an entire track, so we
don't need to get them for every frame we output.
2025-11-05 18:40:02 +01:00
Zaggy1024
b1c9a872bc LibMedia: Return whether a demuxer seek moved the stream position
We no longer need to return a timestamp from the seek function, which
makes it much easier to implement backend-agnostically.
2025-10-27 17:28:49 -07:00
Zaggy1024
86e236519d LibMedia: Give demuxer seeks an option to always seek to a keyframe
By default, MatroskaDemuxer chooses not to seek if the current frame
is closer to the seek target than the keyframe that precedes the seek
target. However, it can be desirable to seek to a keyframe anyway, so
let's allow that.
2025-10-27 17:28:49 -07:00
Zaggy1024
e94ab24e66 LibMedia: Don't assert when MatroskaDemuxer seeks near the start
Reader::seek_to_random_access_point() isn't actually guaranteed to
return a sample iterator that has already gotten a block timestamp.
This verify passes in almost every case, but if we happen to seek to a
timestamp before the second keyframe, we'd crash.
2025-10-27 17:28:49 -07:00
Zaggy1024
0a03cc1cf7 LibMedia: Store whether a CodedFrame is a keyframe 2025-10-27 17:28:49 -07:00
Zaggy1024
d52ceec1bf LibMedia: Take Track const& in Demuxer methods 2025-10-27 17:28:49 -07:00
Zaggy1024
d3941cd83d LibMedia: Support playing FLAC 2025-10-27 17:28:49 -07:00
Zaggy1024
29ab9c5fd5 LibMedia: Let the Matroska LanguageBCP47 element override Language
The Matroska spec indicates that this field should always override the
Language element when it is present.
2025-10-27 17:28:49 -07:00
Zaggy1024
e11da1f85f LibMedia: Store a name and language in Media::Track 2025-10-27 17:28:49 -07:00
Zaggy1024
e8238b4098 LibMedia: Replace FlyString with String for Matroska track attributes
The values stored by these are either going to be fairly unique or too
short to benefit from FlyString.
2025-10-27 17:28:49 -07:00
Zaggy1024
dd052832c1 LibMedia: Support the MP3 and AAC codecs in our demuxer 2025-10-27 17:28:49 -07:00
Zaggy1024
6b34003c2c LibMedia: Support coded audio frames in our demuxers
This adds a new variant of the metadata storage in CodedFrame for audio
frames, called CodedAudioFrameData.
2025-10-27 17:28:49 -07:00
Zaggy1024
523e7e2ffa LibMedia: Make Demuxer atomically ref-counted
We'll need to share the demuxer between multiple decoder providers, and
those will hold references to the demuxer from their own decoder
threads.
2025-10-27 17:28:49 -07:00
Zaggy1024
8d77e8b09d LibMedia: Refer to demuxer outputs as coded frames
This should be a clearer name, as "sample" is most often used to refer
to the output of a decoder.
2025-09-22 12:04:29 -05:00
Zaggy1024
9077873803 LibMedia: Stop initializing an empty optional in MatroskaDemuxer
There was a warning for the Optional initializer having no effect, but
removing the initializer caused the call to add a track to the HashMap
to complain. A constructor looks a little nicer here anyway.
2025-09-12 11:23:47 +02:00
Zaggy1024
ae7f82591b LibMedia: Separate file duration from track duration in Demuxer
Most users will only care about the total file duration, and shouldn't
be required to determine the file duration from multiple track
durations. To facilitate that, add a total_duration() function that
returns the demuxer's duration not associated to any particular track.
2025-09-12 11:23:47 +02:00
Zaggy1024
6653b747ff LibMedia: Allow demuxers to specify a preferred track
...and return all tracks of a matching type from FFmpegDemuxer, rather
than only the single best one.
2025-09-12 11:23:47 +02:00
Zaggy1024
8d64e72655 LibMedia: Remove the duration field from Track::VideoData
Most demuxer users will only care about the whole file's duration
anyway, so this field doesn't really do us any good.
2025-09-12 11:23:47 +02:00
Luke Wilde
b789ba5e5f LibMedia: Demux videos with FFmpeg
This gives us access to container types other than Matroska, the
biggest one being MP4.
2025-03-13 19:33:44 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00