pub struct TrackProtection {
pub stream_index: usize,
pub scheme_type: [u8; 4],
pub scheme_version: u32,
pub tenc: TencBox,
}Expand description
Per-track CENC protection signalling for the muxer (ISO/IEC 14496-12 §8.12 envelope + ISO/IEC 23001-7 §4.1 carriage).
When a Mp4MuxerOptions::track_protection entry targets a
stream, the muxer wraps that track’s sample entry into its
protected form: the FourCC becomes encv / enca / enct /
encs (per the stream’s media type) and a sinf box —
frma(original_format) + schm(scheme_type, scheme_version) +
schi(tenc) — is appended to the entry body, exactly the shape
this crate’s demuxer unwraps back to the original codec id plus
protection_scheme / cenc_default_* options.
The muxer signals protection only — packet payloads are written
as handed in. The caller encrypts each sample first (e.g. via
cenc_cipher::encrypt_sample_in_place with a
CencSchemeDecision built from this same (scheme_type, tenc)
pair) and carries the per-sample IVs / subsample maps through its
own senc / saiz / saio channel.
Fields§
§stream_index: usizeIndex into the muxer’s streams slice (the stream to protect).
scheme_type: [u8; 4]§8.12.5 scheme_type FourCC — one of the ISO/IEC 23001-7 §10
schemes (cenc / cbc1 / cens / cbcs) or a private
dialect FourCC (validated structurally only in that case).
scheme_version: u32§8.12.5 32-bit scheme_version word. Every ISO/IEC 23001-7
edition to date uses 0x0001_0000 (the Default here).
tenc: TencBoxTrack-default encryption parameters written into schi/tenc
(ISO/IEC 23001-7 §8.2). Must satisfy the same round-trip rules
as cenc::build_tenc_box plus scheme coherence (a §10 scheme
pins the tenc version; pattern schemes need a non-zero
pattern pair) — violations fail at open.
Trait Implementations§
Source§impl Clone for TrackProtection
impl Clone for TrackProtection
Source§fn clone(&self) -> TrackProtection
fn clone(&self) -> TrackProtection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more