Skip to main content

StreamType

Enum StreamType 

Source
#[non_exhaustive]
pub enum StreamType {
Show 60 variants Reserved, Mpeg1Video, Mpeg2Video, Mpeg1Audio, Mpeg2Audio, PrivateSections, PesPrivateData, Mheg, DsmCc, H222_1, Iso13818_6TypeA, Iso13818_6TypeB, Iso13818_6TypeC, Iso13818_6TypeD, Auxiliary, AacAdts, Mpeg4Video, AacLatm, SlFlexMuxPes, SlFlexMuxSections, SyncDownload, MetadataPes, MetadataSections, MetadataDataCarousel, MetadataObjectCarousel, MetadataSyncDownload, Ipmp, H264, Iso14496_3Audio, Iso14496_17Text, AuxiliaryVideo, Svc, Mvc, Jpeg2000, AdditionalViewH262, AdditionalViewH264, Hevc, HevcTemporalSubset, Mvcd, Temi, HevcAnnexG, HevcAnnexGTemporal, HevcAnnexH, HevcAnnexHTemporal, GreenAccessUnits, MhasAudioMain, MhasAudioAux, QualityAccessUnits, MediaOrchestration, MctsHevc, JpegXs, Vvc, VvcTemporalSubset, Evc, Ac3, Scte35, EAc3, IpmpHigh, ReservedRange(u8), UserPrivate(u8),
}
Expand description

Stream type coding — Rec. ITU-T H.222.0 (06/2021) Table 2-34.

Identifies the elementary-stream type carried in the associated PID. Values 0x800xFF are user private; only well-established entries cited to their own specs are named — the rest fall through to UserPrivate.

§Examples

use dvb_si::tables::pmt::StreamType;

assert_eq!(StreamType::from_u8(0x02).name(), "MPEG-2 Video");
assert_eq!(StreamType::from_u8(0x1B).to_u8(), 0x1B); // H.264, lossless round-trip

A parsed PmtStream.stream_type is already a StreamType — match on it directly.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Reserved

0x00 — ITU-T | ISO/IEC Reserved.

§

Mpeg1Video

0x01 — ISO/IEC 11172-2 Video (MPEG-1 video).

§

Mpeg2Video

0x02 — Rec. ITU-T H.262 | ISO/IEC 13818-2 Video (MPEG-2 video).

§

Mpeg1Audio

0x03 — ISO/IEC 11172-3 Audio (MPEG-1 audio).

§

Mpeg2Audio

0x04 — ISO/IEC 13818-3 Audio (MPEG-2 audio).

§

PrivateSections

0x05 — Rec. ITU-T H.222.0 | ISO/IEC 13818-1 private_sections.

§

PesPrivateData

0x06 — Rec. ITU-T H.222.0 | ISO/IEC 13818-1 PES packets containing private data.

§

Mheg

0x07 — ISO/IEC 13522 MHEG.

§

DsmCc

0x08 — Rec. ITU-T H.222.0 | ISO/IEC 13818-1 Annex A DSM-CC.

§

H222_1

0x09 — Rec. ITU-T H.222.1.

§

Iso13818_6TypeA

0x0A — ISO/IEC 13818-6 type A.

§

Iso13818_6TypeB

0x0B — ISO/IEC 13818-6 type B.

§

Iso13818_6TypeC

0x0C — ISO/IEC 13818-6 type C.

§

Iso13818_6TypeD

0x0D — ISO/IEC 13818-6 type D.

§

Auxiliary

0x0E — Rec. ITU-T H.222.0 | ISO/IEC 13818-1 auxiliary.

§

AacAdts

0x0F — ISO/IEC 13818-7 Audio with ADTS transport syntax (AAC).

§

Mpeg4Video

0x10 — ISO/IEC 14496-2 Visual (MPEG-4 video).

§

AacLatm

0x11 — ISO/IEC 14496-3 Audio with LATM transport syntax (AAC LATM).

§

SlFlexMuxPes

0x12 — ISO/IEC 14496-1 SL-packetized / FlexMux stream in PES.

§

SlFlexMuxSections

0x13 — ISO/IEC 14496-1 SL-packetized / FlexMux stream in sections.

§

SyncDownload

0x14 — ISO/IEC 13818-6 Synchronized Download Protocol.

§

MetadataPes

0x15 — Metadata carried in PES packets.

§

MetadataSections

0x16 — Metadata carried in metadata_sections.

§

MetadataDataCarousel

0x17 — Metadata carried in ISO/IEC 13818-6 Data Carousel.

§

MetadataObjectCarousel

0x18 — Metadata carried in ISO/IEC 13818-6 Object Carousel.

§

MetadataSyncDownload

0x19 — Metadata carried in ISO/IEC 13818-6 Synchronized Download Protocol.

§

Ipmp

0x1A — IPMP stream (ISO/IEC 13818-11, MPEG-2 IPMP).

§

H264

0x1B — AVC video stream (Rec. ITU-T H.264 | ISO/IEC 14496-10).

§

Iso14496_3Audio

0x1C — ISO/IEC 14496-3 Audio without additional transport syntax (DST, ALS, SLS).

§

Iso14496_17Text

0x1D — ISO/IEC 14496-17 Text.

§

AuxiliaryVideo

0x1E — Auxiliary video stream (ISO/IEC 23002-3).

§

Svc

0x1F — SVC video sub-bitstream of an AVC video stream (H.264 Annex G).

§

Mvc

0x20 — MVC video sub-bitstream of an AVC video stream (H.264 Annex H).

§

Jpeg2000

0x21 — JPEG 2000 video (Rec. ITU-T T.800 | ISO/IEC 15444-1).

§

AdditionalViewH262

0x22 — Additional view H.262 | ISO/IEC 13818-2 video for service-compatible stereoscopic 3D.

§

AdditionalViewH264

0x23 — Additional view H.264 | ISO/IEC 14496-10 video for service-compatible stereoscopic 3D.

§

Hevc

0x24 — Rec. ITU-T H.265 | ISO/IEC 23008-2 video (HEVC) or HEVC temporal sub-bitstream.

§

HevcTemporalSubset

0x25 — HEVC temporal video subset (H.265 Annex A profiles).

§

Mvcd

0x26 — MVCD video sub-bitstream of an AVC video stream (H.264 Annex I).

§

Temi

0x27 — Timeline and External Media Information (TEMI, H.222.0 Annex U).

§

HevcAnnexG

0x28 — HEVC enhancement sub-partition incl. TemporalId 0 (H.265 Annex G).

§

HevcAnnexGTemporal

0x29 — HEVC temporal enhancement sub-partition (H.265 Annex G).

§

HevcAnnexH

0x2A — HEVC enhancement sub-partition incl. TemporalId 0 (H.265 Annex H).

§

HevcAnnexHTemporal

0x2B — HEVC temporal enhancement sub-partition (H.265 Annex H).

§

GreenAccessUnits

0x2C — Green access units carried in MPEG-2 sections.

§

MhasAudioMain

0x2D — ISO/IEC 23008-3 Audio with MHAS transport syntax — main stream.

§

MhasAudioAux

0x2E — ISO/IEC 23008-3 Audio with MHAS transport syntax — auxiliary stream.

§

QualityAccessUnits

0x2F — Quality access units carried in sections.

§

MediaOrchestration

0x30 — Media Orchestration Access Units carried in sections.

§

MctsHevc

0x31 — MCTS substream of an H.265 | ISO/IEC 23008-2 video stream.

§

JpegXs

0x32 — JPEG XS video stream (ISO/IEC 21122-2 profiles).

§

Vvc

0x33 — VVC video stream (Rec. ITU-T H.266 | ISO/IEC 23090-3) or VVC temporal sub-bitstream.

§

VvcTemporalSubset

0x34 — VVC temporal video subset (H.266 Annex A profiles).

§

Evc

0x35 — EVC video stream or EVC temporal sub-bitstream (ISO/IEC 23094-1).

§

Ac3

0x81 — ATSC AC-3 audio (A/52).

§

Scte35

0x86 — SCTE-35 splice_info_section (ANSI/SCTE 35).

§

EAc3

0x87 — ATSC E-AC-3 / Dolby Digital Plus audio (A/52B).

§

IpmpHigh

0x7F — IPMP stream (H.222.0 Table 2-34).

§

ReservedRange(u8)

Rec. ITU-T H.222.0 reserved range 0x36..=0x7E.

§

UserPrivate(u8)

User private range 0x80..=0xFF (except named entries).

Implementations§

Source§

impl StreamType

Source

pub fn from_u8(v: u8) -> Self

Decode from the wire byte. Every byte maps to a variant (lossless).

Source

pub const fn to_u8(self) -> u8

Encode to the wire byte. Inverse of from_u8.

Source

pub fn is_video(self) -> bool

Returns true if this stream_type carries a video elementary stream.

Covers the video-coded stream types defined in Rec. ITU-T H.222.0 | ISO/IEC 13818-1 Table 2-34 (2021 edition):

VariantValueSpec
Mpeg1Video0x01ISO/IEC 11172-2
Mpeg2Video0x02ITU-T H.262 / ISO/IEC 13818-2
Mpeg4Video0x10ISO/IEC 14496-2
H2640x1BITU-T H.264 / ISO/IEC 14496-10
AuxiliaryVideo0x1EISO/IEC 23002-3
Svc0x1FH.264 Annex G
Mvc0x20H.264 Annex H
Jpeg20000x21ITU-T T.800 / ISO/IEC 15444-1
AdditionalViewH2620x22H.262 stereoscopic 3D
AdditionalViewH2640x23H.264 stereoscopic 3D
Hevc0x24ITU-T H.265 / ISO/IEC 23008-2
HevcTemporalSubset0x25H.265 Annex A
Mvcd0x26H.264 Annex I
HevcAnnexG0x28H.265 Annex G
HevcAnnexGTemporal0x29H.265 Annex G
HevcAnnexH0x2AH.265 Annex H
HevcAnnexHTemporal0x2BH.265 Annex H
MctsHevc0x31H.265 / ISO/IEC 23008-2
JpegXs0x32ISO/IEC 21122-2
Vvc0x33ITU-T H.266 / ISO/IEC 23090-3
VvcTemporalSubset0x34H.266 Annex A
Evc0x35ISO/IEC 23094-1

Note on PesPrivateData (0x06): this stream_type alone does not identify the payload — AC-3, H.264, DVB subtitle, teletext, and others all share 0x06 and are disambiguated by component/registration descriptors per ETSI TS 101 154. is_video returns false for PesPrivateData; callers must inspect the ES_info descriptor loop to resolve the actual content type.

Source

pub fn is_audio(self) -> bool

Returns true if this stream_type carries an audio elementary stream.

Covers the audio-coded stream types defined in Rec. ITU-T H.222.0 | ISO/IEC 13818-1 Table 2-34 (2021 edition):

VariantValueSpec
Mpeg1Audio0x03ISO/IEC 11172-3
Mpeg2Audio0x04ISO/IEC 13818-3
AacAdts0x0FISO/IEC 13818-7 (AAC in ADTS)
AacLatm0x11ISO/IEC 14496-3 (AAC in LATM)
Iso14496_3Audio0x1CISO/IEC 14496-3 (raw, no transport syntax)
MhasAudioMain0x2DISO/IEC 23008-3 MHAS main
MhasAudioAux0x2EISO/IEC 23008-3 MHAS auxiliary
Ac30x81ATSC A/52 (AC-3)
EAc30x87ATSC A/52B (E-AC-3 / Dolby Digital Plus)

Note on PesPrivateData (0x06): this stream_type alone does not identify the payload — AC-3 carried over DVB uses 0x06 with an AC-3/enhanced AC-3 descriptor per ETSI TS 101 154. is_audio returns false for PesPrivateData; callers must inspect the ES_info descriptor loop to resolve the actual content type.

Source

pub fn is_subtitle(self) -> bool

Returns true if this stream_type unambiguously carries subtitle/text content.

Only Iso14496_17Text (0x1D, ISO/IEC 14496-17 timed text) is unambiguously identified as subtitle/text by the stream_type byte alone.

Note on PesPrivateData (0x06): DVB bitmap subtitles (ETSI EN 300 743) and DVB teletext (ETSI EN 300 472) both use stream_type 0x06 and are identified by subtitling / teletext descriptors in the ES_info loop per ETSI TS 101 154. is_subtitle returns false for PesPrivateData; callers must inspect the ES_info descriptor loop to resolve the actual content type.

Source

pub fn is_data(self) -> bool

Returns true if this stream_type carries data, private sections, signalling, or metadata — i.e. neither video, audio, nor subtitle.

This includes:

VariantValueNotes
Reserved0x00ITU-T / ISO reserved
PrivateSections0x05private_sections (H.222.0 §2.4.4.10)
PesPrivateData0x06descriptor-dependent; see note below
Mheg0x07MHEG interactive
DsmCc0x08DSM-CC (H.222.0 Annex A)
H222_10x09H.222.1
Iso13818_6TypeATypeD0x0A–0x0DISO/IEC 13818-6 carousel/download
Auxiliary0x0EH.222.0 auxiliary
SlFlexMuxPes0x12SL/FlexMux in PES
SlFlexMuxSections0x13SL/FlexMux in sections
SyncDownload0x14ISO/IEC 13818-6 Synchronized Download Protocol
MetadataPesMetadataSyncDownload0x15–0x19metadata streams
Ipmp0x1AIPMP (ISO/IEC 13818-11)
Temi0x27Timeline and External Media Information
GreenAccessUnits0x2Cgreen access units
QualityAccessUnits0x2Fquality access units
MediaOrchestration0x30Media Orchestration
IpmpHigh0x7FIPMP (H.222.0 Table 2-34)
Scte350x86SCTE-35 splice_info_section
ReservedRange(_)0x36–0x7Ereserved, treated conservatively as data
UserPrivate(_)0x80–0xFFuser private, treated conservatively as data

Note on PesPrivateData (0x06): this stream_type is shared by many DVB content types — AC-3 audio, E-AC-3, DVB subtitles, teletext, and others — all identified via descriptors per ETSI TS 101 154. This predicate conservatively classifies 0x06 as data/unknown. Callers that need to classify 0x06 streams must inspect the ES_info descriptor loop.

Source

pub fn name(self) -> &'static str

Human-readable spec display name.

Trait Implementations§

Source§

impl Clone for StreamType

Source§

fn clone(&self) -> StreamType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StreamType

Source§

impl Debug for StreamType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for StreamType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for StreamType

Source§

impl PartialEq for StreamType

Source§

fn eq(&self, other: &StreamType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for StreamType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for StreamType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DescriptorObject for T
where T: Debug + Any + Send + Sync + Serialize,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Available on crate feature serde only.
Borrow as &dyn Any so the caller can downcast to the concrete type.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> ExtensionObject for T
where T: Debug + Any + Send + Sync + Serialize,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Available on crate feature serde only.
Borrow as &dyn Any so the caller can downcast to the concrete type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> TableObject for T
where T: Debug + Any + Send + Sync + Serialize,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Available on crate feature serde only.
Borrow as &dyn Any so the caller can downcast to the concrete type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.