Initial effort to reduce or eliminate the use of assertions in the
production code (i.e. not test code). See issue 43 for an example of how
this can cause an application (thread) to panic when reading an unusual
file. Not all of the changes were as simple as returning an Err, since some
functions did not return a Result. Also, the error type used (InvalidData)
is just a catch-all with a message, and in some cases a more refined error
type may be in order.
cargo test passes
* feat: mvex box中的mehd box改为可选,支持fmp4的解析
* feat: example/mp4sample supports fragmented mp4
* feat: utilize function sample_count(), extract duplicated codes as a new function
* feat: field data_offset in TrunBox is optional
* feat: remove an ".expect()"
* feat: remove an ".expect()"
* chore: re-style code
* feat: mvex box中的mehd box改为可选,支持fmp4的解析
* feat: support to copy mp4 with vp9 codec, but not support to copy fmp4 with vp9 codec
* Update types.rs
undo unnecessary changes.
* Update types.rs
undo reduce unnecessary changes.
* Update types.rs
* Update mp4copy.rs
Add vp9 code after h265
* Update stsd.rs
Add vp09 after the Hevc
* Update types.rs
Add after the HevcConfig.
* fix: Track.rs add vp9 support
* feat: mp4 writer set vp09 box into stsd box
* Add Mp4Box traits for getting json or text summary for each box.
* fix test and serde version.
* skip serializing entries
* skip serializing sample_sizes
* Add custom serializer for FixedPoint types.
* Make EsdsBox in Mp4aBox optional, instead of error when parsing. Also update mp4info example with some missing info that was removed.
* Update Mp4aBox test to check for optional EsdsBox.
* Add ReadBox trait
* Add boxtype macro
* Remove offset in BoxHeader
* Fix parsing error when box has largesize
* Remove duplicated codes reading version and flags
* Update examples
* Fix test failure
* Rename I/O position moving functions
* skip_read() to skip_bytes()
* skip_read_to() to skip_bytes_to()
* skip_write() to write_zeros()
* Rename I/O position moving functions
* skip_read() to skip_bytes()
* skip_read_to() to skip_bytes_to()
* Ensure skip_bytes() does not go back.
Co-authored-by: Byungwan Jun <unipro.kr@gmail.com>
* Add ReadBox trait
* Add boxtype macro
* Remove offset in BoxHeader
* Fix parsing error when box has largesize
* Remove duplicated codes reading version and flags
* Add test code for all leaves in box tree
* Remove entry_count that is duplacated with entries.len()
* Change volume type to Ratio<u16>
Co-authored-by: Byungwan Jun <unipro.kr@gmail.com>
* Add ReadBox trait
* Add boxtype macro
* Remove offset in BoxHeader
* Fix parsing error when box has largesize
* Remove duplicated codes reading version and flags
* Simplify all box size types as largesize
* Add WriteBox trait and improve compatibility with large box
* Split large atoms file into smaller ones
* Refator Error
Co-authored-by: Byungwan Jun <unipro.kr@gmail.com>
* Skip over unknown boxes
If the box size is non-zero, skip over it and continue reading. Otherwise if
the box size is zero, exit the loop.
* Add comment clarifying the box skipping