pub struct PesParsedContents<'buf> { /* private fields */ }
Expand description

Extra data which may optionally be present in the PesHeader, potentially including Presentation Timestamp (PTS) and Decode Timestamp (DTS) values.

Implementations§

source§

impl<'buf> PesParsedContents<'buf>

source

pub fn from_bytes(buf: &'buf [u8]) -> Option<PesParsedContents<'buf>>

Wrap the given slice in a ParsedPesContents whose methods can parse the structure’s fields

Returns None if the buffer is too short to hold the expected structure, or if the ‘check bit’ values within the buffer do not have the expected values.

TODO: return Result

source

pub fn pes_priority(&self) -> u8

value 1 indicates higher priority and 0 indicates lower priority

source

pub fn data_alignment_indicator(&self) -> DataAlignment

if the returned value is DataAlignment::Aligned, then video or audio access units within this PES data are aligned to the start of PES packets. If the value is DataAlignment::NotAligned, then alignment of access units is not defined.

source

pub fn copyright(&self) -> Copyright

Indicates copyright status of the material in this PES data.

source

pub fn original_or_copy(&self) -> OriginalOrCopy

Indicates the originality of the data in this PES stream.

source

pub fn pts_dts(&self) -> Result<PtsDts, PesError>

Returns the timestamps present in this PES header.

If no timestamp fields are present, then Err(PesError::FieldNotPresent) is produced.

If the value of the pts_dts_flags field in the header is invalid then Err(PesError::PtsDtsFlagsInvalid) is produced.

source

pub fn escr(&self) -> Result<ClockRef, PesError>

Returns the ‘Elementary Stream Clock Reference’ value.

If the field is not present in the header, then Err(PesError::FieldNotPresent) is produced.

source

pub fn es_rate(&self) -> Result<EsRate, PesError>

Returns the ‘Elementary Stream Rate’ value.

If the field is not present in the header, then Err(PesError::FieldNotPresent) is produced.

source

pub fn dsm_trick_mode(&self) -> Result<DsmTrickMode, PesError>

Returns information about the ‘Digital Storage Media trick mode’

If the field is not present in the header, then Err(PesError::FieldNotPresent) is produced.

source

pub fn additional_copy_info(&self) -> Result<u8, PesError>

Returns a 7-bit value containing private data relating to copyright information

If the field is not present in the header, then Err(PesError::FieldNotPresent) is produced.

source

pub fn previous_pes_packet_crc(&self) -> Result<u16, PesError>

returns a 16-bit Cyclic Redundancy Check value for the PES packet data bytes that precededed this one

This crate does not perform any CRC-checks based on this value being present.

If the field is not present in the header, then Err(PesError::FieldNotPresent) is produced.

source

pub fn pes_extension(&self) -> Result<PesExtension<'buf>, PesError>

Returns the PES extension structure if present, or Err(PesError::FieldNotPresent) if not.

source

pub fn payload(&self) -> &'buf [u8]

Provides the portion of the PES payload that was in the same TS packet as the PES header

NB the full PES payload is likely to be split across multiple TS packets, and implementors of ElementaryStreamConsumer must be prepared to accept the PES payload data split between the header and multiple subsequent calls to ElementaryStreamConsumer::continue_packet()

Trait Implementations§

source§

impl<'buf> Debug for PesParsedContents<'buf>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'buf> RefUnwindSafe for PesParsedContents<'buf>

§

impl<'buf> Send for PesParsedContents<'buf>

§

impl<'buf> Sync for PesParsedContents<'buf>

§

impl<'buf> Unpin for PesParsedContents<'buf>

§

impl<'buf> UnwindSafe for PesParsedContents<'buf>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.