Skip to main content

iso_bmff/
lib.rs

1//! Sans-IO ISOBMFF / MP4 — freestanding mux and demux.
2//!
3//! Callers own all I/O. No Mediaway types. `ClearKey` sample crypto via [`iso_cenc`].
4
5#![forbid(unsafe_code)]
6#![allow(
7    clippy::cast_possible_truncation,
8    clippy::cast_sign_loss,
9    clippy::cast_possible_wrap
10)]
11
12pub mod bitstream;
13mod codec_features;
14pub mod error;
15pub mod isobmff;
16pub mod types;
17
18#[cfg(all(not(feature = "mux"), not(feature = "demux")))]
19compile_error!("enable at least one of `mux` or `demux` features on iso-bmff");
20
21#[cfg(feature = "demux")]
22pub mod demux;
23#[cfg(feature = "mux")]
24pub mod mux;
25
26/// Typical A/V (+ a couple extras) — stack capacity for track tables.
27pub const INLINE_TRACKS: usize = 4;
28/// Per-fragment sample rows on the stack (covers default fragment batch of 30).
29pub const INLINE_SAMPLES: usize = 32;
30
31/// Mux/demux error.
32pub use error::Error;
33
34#[cfg(feature = "demux")]
35pub use demux::Demuxer;
36#[cfg(feature = "mux")]
37pub use mux::{DEFAULT_FRAGMENT_BATCH, Live, Muxer, Open};
38pub use types::{Bytes, Codec, Rational, Sample, Track};