#[non_exhaustive]pub struct Track {Show 17 fields
pub name: String,
pub packaging: Packaging,
pub is_live: bool,
pub role: Option<Role>,
pub codec: Option<String>,
pub width: Option<u32>,
pub height: Option<u32>,
pub framerate: Option<f64>,
pub samplerate: Option<u32>,
pub channel_config: Option<String>,
pub bitrate: Option<u64>,
pub init_data: Option<String>,
pub render_group: Option<u32>,
pub alt_group: Option<u32>,
pub max_grp_sap_starting_type: Option<u8>,
pub max_obj_sap_starting_type: Option<u8>,
pub jitter: Option<f64>,
}Expand description
A single track in the MSF catalog.
Marked #[non_exhaustive] because the CMSF/MSF drafts continue to grow
optional fields. External callers build a track with Track::new and
then assign whichever optional fields they need; struct-literal
construction (with or without ..base) is not available outside this
crate.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringUnique track name (case-sensitive).
packaging: PackagingPackaging mode.
is_live: boolWhether new objects will be appended.
role: Option<Role>Content role.
codec: Option<String>WebCodecs codec string.
width: Option<u32>Video frame width in pixels.
height: Option<u32>Video frame height in pixels.
framerate: Option<f64>Video frame rate.
samplerate: Option<u32>Audio sample rate in Hz.
channel_config: Option<String>Audio channel configuration.
bitrate: Option<u64>Bitrate in bits per second.
init_data: Option<String>Base64-encoded initialization data.
render_group: Option<u32>Render group for synchronized playback.
alt_group: Option<u32>Alternate group for quality switching.
max_grp_sap_starting_type: Option<u8>Maximum SAP starting type for groups (CMSF 3.5.2). A value of 1 means every group starts with a closed-GOP IDR.
max_obj_sap_starting_type: Option<u8>Maximum SAP starting type for objects (CMSF 3.5.2). A value of 1 means every object starts with a closed-GOP IDR.
jitter: Option<f64>Jitter in milliseconds (non-standard extension, matches JS implementation).
Implementations§
Source§impl Track
impl Track
Sourcepub fn new(name: impl Into<String>, packaging: Packaging) -> Self
pub fn new(name: impl Into<String>, packaging: Packaging) -> Self
Construct a track with the required identity fields set and every
optional field cleared. Fields are pub, so callers set whatever they
need by assignment afterwards.
This is the only path external crates have to build a Track since the
type is #[non_exhaustive].