Skip to main content

PesHeader

Struct PesHeader 

Source
#[non_exhaustive]
pub struct PesHeader<'a> {
Show 14 fields pub scrambling_control: u8, pub pes_priority: bool, pub data_alignment_indicator: bool, pub copyright: bool, pub original_or_copy: bool, pub pts: Option<Pts>, pub dts: Option<Dts>, pub escr: Option<Escr>, pub es_rate: Option<u32>, pub dsm_trick_mode: Option<TrickMode>, pub additional_copy_info: Option<u8>, pub pes_crc: Option<u16>, pub pes_extension: Option<PesExtension<'a>>, pub header_stuffing_len: usize,
}
Expand description

The optional PES header present for non-special stream_ids (ISO/IEC 13818-1 §2.4.3.6, §2.4.3.7). All optional sub-fields are fully typed — the raw optional_fields blob has been replaced with the individual decoded fields.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§scrambling_control: u8

PES_scrambling_control (2 bits).

§pes_priority: bool

PES_priority.

§data_alignment_indicator: bool

data_alignment_indicator.

§copyright: bool

copyright.

§original_or_copy: bool

original_or_copy.

§pts: Option<Pts>

Presentation time stamp, if PTS_DTS_flags indicated one.

§dts: Option<Dts>

Decoding time stamp, if PTS_DTS_flags was 11.

§escr: Option<Escr>

Elementary stream clock reference (6 bytes), if ESCR_flag is set.

§es_rate: Option<u32>

22-bit ES rate (bytes/second × 50), if ES_rate_flag is set.

§dsm_trick_mode: Option<TrickMode>

DSM trick-mode control byte (typed), if DSM_trick_mode_flag is set.

§additional_copy_info: Option<u8>

7-bit additional_copy_info, if additional_copy_info_flag is set.

§pes_crc: Option<u16>

Previous PES packet CRC (16 bits), if PES_CRC_flag is set.

§pes_extension: Option<PesExtension<'a>>

PES extension sub-structure, if PES_extension_flag is set.

§header_stuffing_len: usize

Number of trailing 0xFF stuffing bytes inside the PES_header_data_length region, after the typed optional fields (ISO/IEC 13818-1:2007 §2.4.3.7 — “stuffing_byte: fixed 8-bit value 0xFF”).

Encoders pad the optional-header block (often so the elementary stream starts at a fixed offset). These bytes are part of the wire image; capturing the count lets PesPacket::serialize_into reproduce the header byte-for-byte. Set to 0 when constructing a header with no stuffing.

Trait Implementations§

Source§

impl<'a> Clone for PesHeader<'a>

Source§

fn clone(&self) -> PesHeader<'a>

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<'a> Debug for PesHeader<'a>

Source§

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

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

impl<'a> Eq for PesHeader<'a>

Source§

impl<'a> PartialEq for PesHeader<'a>

Source§

fn eq(&self, other: &PesHeader<'a>) -> 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<'a> Serialize for PesHeader<'a>

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<'a> StructuralPartialEq for PesHeader<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for PesHeader<'a>

§

impl<'a> RefUnwindSafe for PesHeader<'a>

§

impl<'a> Send for PesHeader<'a>

§

impl<'a> Sync for PesHeader<'a>

§

impl<'a> Unpin for PesHeader<'a>

§

impl<'a> UnsafeUnpin for PesHeader<'a>

§

impl<'a> UnwindSafe for PesHeader<'a>

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> 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> 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, 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.