#[non_exhaustive]pub struct Track {Show 18 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 stalled: Option<bool>,
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<Duration>,
/* private fields */
}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.
draft-00 marks this required, but its own examples omit it on
mediatimeline/eventtimeline tracks, so we default to false when
absent rather than reject the whole catalog.
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.
stalled: Option<bool>Whether the publisher recommends temporarily avoiding this track.
This is a non-standard extension shared with the hang catalog.
init_data: Option<String>Resolved base64 initialization data.
On the wire this is carried indirectly through draft-01’s initDataList +
initRef; Catalog (de)serialization resolves it so callers always see
the inline payload here. draft-00’s inline initData is also accepted.
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<Duration>Jitter (non-standard extension; not in the MSF/CMSF drafts).
Serialized as a JSON number of milliseconds, matching the hang catalog.
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].