#[derive(Clone, Debug)]
pub enum BrandPreset {
Mp4,
Mov,
Ismv,
Custom {
major: [u8; 4],
compatible: Vec<[u8; 4]>,
},
}
impl BrandPreset {
pub fn major_brand(&self) -> [u8; 4] {
match self {
BrandPreset::Mp4 => *b"mp42",
BrandPreset::Mov => *b"qt ",
BrandPreset::Ismv => *b"iso4",
BrandPreset::Custom { major, .. } => *major,
}
}
pub fn compatible_brands(&self) -> Vec<[u8; 4]> {
match self {
BrandPreset::Mp4 => vec![*b"isom", *b"mp42", *b"mp41", *b"iso2"],
BrandPreset::Mov => vec![*b"qt "],
BrandPreset::Ismv => vec![*b"iso4", *b"piff", *b"iso6", *b"isml"],
BrandPreset::Custom { compatible, .. } => compatible.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct Mp4MuxerOptions {
pub brand: BrandPreset,
pub faststart: bool,
}
impl Default for Mp4MuxerOptions {
fn default() -> Self {
Self {
brand: BrandPreset::Mp4,
faststart: false,
}
}
}