Skip to main content

check_video_encoder_contract

Function check_video_encoder_contract 

Source
pub fn check_video_encoder_contract<E, F>(
    make: F,
    frames: &[Frame],
) -> Conformance
where E: VideoEncoder, F: FnMut() -> E,
Expand description

Verify a VideoEncoder against the session contract.

make builds a fresh encoder; frames are valid input for it, with timestamps on its clock. Checked:

  • output_config is available before the first frame.
  • Receiving lazily and eagerly yields the same packets (bytes, timestamps, random-access flags); every packet has a timestamp and the timestamps are exactly the frames’.
  • ReceivePending is followed by a Ready; end_input is idempotent, EndOfStream stable, send after it refused.
  • A frame on another clock is ProtocolViolation::ClockMismatch.