Commit Graph

10 Commits

Author SHA1 Message Date
trav90 2e4dc2cf58 Re-land virtual int64_t GetEvictionOfset in MP4Demuxer 2018-07-25 01:28:51 +08:00
trav90 ffd606eb44 Moved fallible code from MP4TrackDemuxer constructor to caller
In MP4TrackDemuxer constructor, getting the track info and indices could  potentially fail, triggering crashing assertions. The fallible work is now done before calling the constructor, and if it fails a nullptr is returned, which is correctly handled in MediaFormatReader. Also reordered some MP4TrackDemuxer members for more natural construction.
2018-07-25 01:28:21 +08:00
trav90 91fb55b087 Do not allocate memory spanning across MP4 ftyp and moov atom
A typical non-fragmented mp4 would have the ftyp atom located at the beginning of the mp4 and the moov at the end. We would to calculate the location of the metadata by spanning the byte range of the two atoms. As such, we would typically allocate an amount of memory equivalent to the size of the mp4.

Instead we now reconstruct the metadata to only have the ftyp and moov atoms contiguously.
2018-07-25 01:28:19 +08:00
trav90 d652360633 Only rescans MP4's moof when necessary 2018-07-25 01:28:15 +08:00
trav90 faff7ba6a4 Properly recalculate next keyframe time after seeking 2018-07-25 01:28:07 +08:00
trav90 20214918e5 Fix MP4TrackDemuxer eviction offset calculations 2018-07-25 01:27:55 +08:00
trav90 9410bc7a49 Add MediaDecoderReader::NotifyDataRemoved method 2018-07-25 01:27:52 +08:00
trav90 2d6edea7be Use fallible array to store MP4 samples index in MP4Demuxer 2018-07-25 01:21:37 +08:00
trav90 50ad6cdcd2 Ensure we have up to date index when calculating offsets 2018-07-25 01:21:35 +08:00
trav90 8e0f0aa649 Add MP4Demuxer object 2018-07-25 01:21:31 +08:00