Module mpeg2ts_reader::descriptor[][src]

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 {:?}", reg.format_identifier());
    }
}

Modules

avcvideo

Provides some metadata from the SPS/PPS within this AVC stream, and also some flags to indicate usage of certain AVC stream features.

iso_639_language

Support for ISO-639 language code metadata, and audio-type metadata.

max_bitrate

Describes the maximum bitrate of the stream to which this descriptor is attached, including transport overheads.

registration

Registration descriptor indicates which kind of syntax any ‘private data’ within the transport stream will be following

Structs

DescriptorIter

Iterator over the descriptor elements in a given byte slice.

UnknownDescriptor

Catch-all type for when there is no explicit handling for the given descriptor type.

Enums

CoreDescriptors

Default implementation of Descriptor covering descriptor types from ISO/IEC 13818-1.

DescriptorError

An error during parsing of a descriptor

Traits

Descriptor

Trait allowing users of this trait to supply their own implementation of descriptor parsing.