Commit Graph

42 Commits

Author SHA1 Message Date
trav90 d9cca66809 Prevent microseconds calculation overflow 2018-07-25 07:00:09 +08:00
trav90 4f8e7a5731 Revert "Properly handle MP4 time offset in MoofParser" 2018-07-25 06:36:46 +08:00
trav90 ee6bb9e25d Revert "MP4 dts must use the same timeline as pts" 2018-07-25 06:36:44 +08:00
trav90 cd3cf81bba Rebase MP3 demuxer on MediaDataDemuxer interface 2018-07-25 06:35:47 +08:00
trav90 f466cc6b5a Add MP3 track demuxer 2018-07-25 06:35:45 +08:00
trav90 9a6b3eb6b1 Use getter to access MediaRawData mData and mSize member 2018-07-25 01:31:17 +08:00
trav90 0e08420f9c MP4 dts must use the same timeline as pts 2018-07-25 01:30:49 +08:00
trav90 02bb611252 Properly handle MP4 time offset in MoofParser 2018-07-25 01:30:47 +08:00
trav90 8cfee64c42 Properly set dts on plain MP4 media
This fixes a problem of frames being displayed out of order with some versions of LibAV/FFmpeg.
2018-07-25 01:30:41 +08:00
trav90 61cdb3ae72 Use MediaLargeByteBuffer, not MediaByteBuffer 2018-07-25 01:28:30 +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 df0a9e3ddb Ignore invalid MP4 tracks 2018-07-25 01:28:10 +08:00
trav90 22c7029347 Never do blocking read if we don't have data 2018-07-25 01:28:01 +08:00
trav90 c78d266df2 Include ftyp box when parsing init segment 2018-07-25 01:21:33 +08:00
trav90 9a20ef534c Extend BufferStream to work with external buffer array
Also make BufferStream::AppendBytes fallible.
2018-07-25 01:21:30 +08:00
trav90 7cddfbff3c Add MP4Metadata method to retrieve init segment byte range 2018-07-25 01:21:28 +08:00
trav90 e210003812 Use MediaRawDataWriter to access MediaRawData::mCrypto
This is to make it consistent with accessing mData.
2018-07-25 01:21:22 +08:00
trav90 5faffc0065 Parse all trun boxes in MP4 fragments, not just the first one 2018-07-25 01:19:27 +08:00
trav90 e0fec017f3 Remove invalid assertion in MoofParser 2018-07-25 01:19:25 +08:00
trav90 8f2ed1c967 Crash fix: Use fallible array to store MP4 samples index 2018-07-25 01:19:23 +08:00
trav90 850786d1e4 Replace instance of stagefright::Vector with nsTArray 2018-07-25 01:19:21 +08:00
trav90 a6f5fdc72f Fix another typo 2018-07-25 01:19:19 +08:00
trav90 0a855126b2 Add support for the mp4v-es MPEG-4 codec 2018-07-25 01:19:17 +08:00
trav90 d6335febb4 Rename LargeDataBuffer and DataBuffer objects
This prevents conflicts and crashes with WebRTC libs that use those names already. Some linkers appear to get it wrong and calls the destructor of the wrong class.
2018-07-25 01:19:09 +08:00
trav90 1bd24949dc Properly handle box size marked as 0
This indicates that the box goes to the end of the file.
2018-07-25 01:19:07 +08:00
trav90 594cf3f51b Remove unused header 2018-07-25 01:19:00 +08:00
trav90 c39022c3c5 Use new MoofParser::HasMetadata in MP4Metadata
This allows MP4Reader::ReadMetadata() to not be unecessarily blocking on partial init segment.
2018-07-25 01:18:58 +08:00
trav90 610a9e101b Add MoofParser::HasMetadata method
Allows to check if we have a full MP4 metadata's atom available in our stream.
2018-07-25 01:18:56 +08:00
trav90 1c861007ca Add ResourceStream class
A Stream abstract over a MediaResource.
2018-07-25 01:18:54 +08:00
trav90 a2daa59046 Add MP4Metadata class
This allows us to abstract the calls to libstagefright and allows future replacement with our own code.
2018-07-25 01:18:53 +08:00
trav90 52d5912e97 Remove MP4 Index's libstagefright dependency 2018-07-25 01:18:47 +08:00
trav90 cf43ead582 Remove mp4_demuxer::TrackType 2018-07-25 01:18:45 +08:00
trav90 8d99c39267 Remove redundant mHasAudio/mHasVideo member 2018-07-25 01:18:39 +08:00
trav90 a5a1590505 Use AudioInfo/VideoInfo object
This removes remaining references to stagefright/MP4 specific objects.
2018-07-25 01:18:35 +08:00
trav90 6755d0bc55 Use new MediaRawObject across the board 2018-07-25 01:18:27 +08:00
trav90 a09289133e Create new MediaRawData object type
This object extends MediaData and will be used to contain demuxed compressed data.
2018-07-25 01:18:25 +08:00
trav90 cbf0070896 Fix constness and remove use of reference to refcounted ptr 2018-07-25 01:18:23 +08:00
trav90 d346235b7e Remove libstagefright dependencies from Crypto config 2018-07-25 01:18:21 +08:00
trav90 7d5b1d0d09 Use libstagefright only for reading metadata 2018-07-25 01:18:20 +08:00
trav90 ad38df4dcd Merge the PlatformDecoderModule and AVCCDecoderModule
Also separate and rework the H.264 wrapper
2018-07-25 01:06:41 +08:00
trav90 6e6e9636be Create an abstract base class for a track demuxer 2018-07-25 01:04:03 +08:00
Moonchild baf46a6bf1 Merge pull request #1 from mozilla/esr38: Esr38 upstream pull 2018-07-24 23:04:07 +08:00