Struct mpeg2ts_reader::pes::PesParsedContents[][src]

pub struct PesParsedContents<'buf> { /* fields omitted */ }

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

Implementations

impl<'buf> PesParsedContents<'buf>[src]

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

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

pub fn pes_priority(&self) -> u8[src]

value 1 indicates higher priority and 0 indicates lower priority

pub fn data_alignment_indicator(&self) -> DataAlignment[src]

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.

pub fn copyright(&self) -> Copyright[src]

Indicates copyright status of the material in this PES data.

pub fn original_or_copy(&self) -> OriginalOrCopy[src]

Indicates the originality of the data in this PES stream.

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

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.

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

Returns the ‘Elementary Stream Clock Reference’ value.

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

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

Returns the ‘Elementary Stream Rate’ value.

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

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

Returns information about the ‘Digital Storage Media trick mode’

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

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

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.

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

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.

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

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

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

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

impl<'buf> Debug for PesParsedContents<'buf>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.