pub mod aac_asc;
pub mod ac3_sync;
pub(crate) mod annexb;
pub mod avi;
pub mod cmaf;
pub mod demux;
pub mod hls;
pub mod mp4_sanitize;
pub mod mux;
pub mod streaming;
pub mod ts;
#[derive(Debug, Clone)]
pub struct AudioInfo {
pub codec: String,
pub sample_rate: u32,
pub channels: u16,
pub timescale: u32,
pub asc_bytes: Vec<u8>,
pub codec_private: Vec<u8>,
}
impl AudioInfo {
pub fn aac_lc(sample_rate: u32, channels: u16, asc_bytes: Vec<u8>) -> Self {
Self {
codec: "aac".into(),
sample_rate,
channels,
timescale: sample_rate,
asc_bytes,
codec_private: Vec::new(),
}
}
pub fn opus(input_sample_rate: u32, channels: u16, codec_private: Vec<u8>) -> Self {
Self {
codec: "opus".into(),
sample_rate: input_sample_rate,
channels,
timescale: 48_000,
asc_bytes: Vec::new(),
codec_private,
}
}
pub fn ac3(sample_rate: u32, channels: u16, dac3_body: Vec<u8>) -> Self {
Self {
codec: "ac3".into(),
sample_rate,
channels,
timescale: sample_rate,
asc_bytes: Vec::new(),
codec_private: dac3_body,
}
}
pub fn eac3(sample_rate: u32, channels: u16, dec3_body: Vec<u8>) -> Self {
Self {
codec: "eac3".into(),
sample_rate,
channels,
timescale: sample_rate,
asc_bytes: Vec::new(),
codec_private: dec3_body,
}
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MkvColorInfo {
pub bits_per_channel: Option<u8>,
pub chroma_subsampling_horz: Option<u8>,
pub chroma_subsampling_vert: Option<u8>,
pub chroma_siting_horz: Option<u8>,
pub chroma_siting_vert: Option<u8>,
pub max_cll: Option<u32>,
pub max_fall: Option<u32>,
pub mastering: Option<MkvMasteringMetadata>,
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MkvMasteringMetadata {
pub primary_r_chromaticity_x: Option<f64>,
pub primary_r_chromaticity_y: Option<f64>,
pub primary_g_chromaticity_x: Option<f64>,
pub primary_g_chromaticity_y: Option<f64>,
pub primary_b_chromaticity_x: Option<f64>,
pub primary_b_chromaticity_y: Option<f64>,
pub white_point_chromaticity_x: Option<f64>,
pub white_point_chromaticity_y: Option<f64>,
pub luminance_max: Option<f64>,
pub luminance_min: Option<f64>,
}