Expand description

Descriptors provide metadata about an element of a Transport Stream.

For example, a descriptor may be used to specify the language of an audio track. Use of specific descriptors is often not mandatory (many streams do not describe the language of their audio).

The syntax of specific PSI tables often allows descriptors to be attached to the table itself, or to entries within the table.

Extensions

Descriptors are a point of extension, with a range of descriptor types defined by the core standard, and further descriptor types defined by standards based upon transport streams. In order to support this extension, while avoiding allocations (a la dyn Trait), descriptor-related types and methods within this crate have a type-parameter so that calling code which wants to use externally-defined descriptors can supply a type which supports them.

So for example code using PmtSection will need to specify the Descriptor implementation to be produced,

let pmt = PmtSection::from_bytes(&data).unwrap();
// type parameter to descriptors() is inferred from the use of CoreDescriptors below
for d in pmt.descriptors() {
    if let Ok(CoreDescriptors::Registration(reg)) = d {
        println!("registration_descriptor {:#x}", reg.format_identifier());
    }
}

Modules

Structs

Enums

Traits