Skip to main content

check_demuxer_contract

Function check_demuxer_contract 

Source
pub fn check_demuxer_contract<D, F>(make: F, file: &[u8]) -> Conformance
where D: Demuxer, F: FnMut() -> D,
Expand description

Verify a Demuxer against the container contract.

make builds a fresh demuxer; file is a valid container for it. Checked:

  • The in-memory driver at windows of 1, 7 and 64 bytes and the whole file, and the random-access driver at 64 bytes and 4 KiB, give the same events: headers, packets (bytes, track, timestamps, random-access evidence, epoch), configuration changes.
  • Input at an offset the demuxer did not ask for is not consumed, and requested is never empty after Need.
  • Every truncation (at 13 evenly spread cut points) either fails as the demuxer’s own error or succeeds with a prefix of the events; it never breaks the driver protocol.

For seeking, see check_demuxer_seek.