Skip to main content

Crate zencodec_media

Crate zencodec_media 

Source
Expand description

Media contracts for zen codecs: what a video (and later audio) codec, a container and a pipeline say to each other.

no_std + alloc, no I/O, no async, no codec implementations. The image contract in zencodec stays as it is; this crate adds the pieces video needs and reuses the image side’s shapes wherever they fit:

  • packet: compressed access units with optional timestamps, container random-access evidence and configuration epochs.
  • track: codec identity separate from the container, validated track descriptions.
  • frame: decoded frames as owned, refcounted handles over backend pictures, with planar views and an immutable per-frame interpretation.
  • session: codec sessions with explicit backpressure (send / receive), drain at end of input, and discard-only reset.
  • container: a sans-I/O Demuxer speaking the image decoders’ Input/InputRequest dialogue (so every zencodec-io driver serves it), and a Muxer whose bytes are pulled like a streaming image encoder’s.
  • adapt: the animation traits as a layer over demuxer + decoder and encoder + muxer.

Time comes from zencodec::time. Design and rationale: docs/media-design.md in the repository; the rules every implementation follows: docs/media-contract.md.

Modules§

adapt
Animation as a layer over the video model, both ways, through the real zencodec animation traits.
container
Containers.
frame
Decoded frames and owned software planes.
limits
Structural limits for containers and the queues between stages.
output
Checked synchronous output drivers (requires std). Checked synchronous container output for forward writers and seekable files.
packet
Compressed access units.
policy
Apply the shared application policy before publishing native video frames.
session
Codec sessions: packets in, frames out (VideoDecoder); frames in, packets out (VideoEncoder).
staged
Owned finite video encoding with admitted compressed staging (requires std). Finite video encoding without final-destination waits while the encoder is alive.
staging
Explicit memory/disk compressed packet staging (requires std). Explicit compressed-packet staging for finite encoding.
track
Tracks: what a container says about each stream.