Struct mpeg2ts_reader::pes::PesParsedContents
source · 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>
impl<'buf> PesParsedContents<'buf>
sourcepub fn from_bytes(buf: &'buf [u8]) -> Option<PesParsedContents<'buf>>
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
sourcepub fn pes_priority(&self) -> u8
pub fn pes_priority(&self) -> u8
value 1 indicates higher priority and 0 indicates lower priority
sourcepub fn data_alignment_indicator(&self) -> DataAlignment
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.
sourcepub fn copyright(&self) -> Copyright
pub fn copyright(&self) -> Copyright
Indicates copyright status of the material in this PES data.
sourcepub fn original_or_copy(&self) -> OriginalOrCopy
pub fn original_or_copy(&self) -> OriginalOrCopy
Indicates the originality of the data in this PES stream.
sourcepub fn pts_dts(&self) -> Result<PtsDts, PesError>
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.
sourcepub fn escr(&self) -> Result<ClockRef, PesError>
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.
sourcepub fn es_rate(&self) -> Result<EsRate, PesError>
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.
sourcepub fn dsm_trick_mode(&self) -> Result<DsmTrickMode, PesError>
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.
sourcepub fn additional_copy_info(&self) -> Result<u8, PesError>
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.
sourcepub fn previous_pes_packet_crc(&self) -> Result<u16, PesError>
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.
sourcepub fn pes_extension(&self) -> Result<PesExtension<'buf>, PesError>
pub fn pes_extension(&self) -> Result<PesExtension<'buf>, PesError>
Returns the PES extension structure if present, or Err(PesError::FieldNotPresent) if not.
sourcepub fn payload(&self) -> &'buf [u8] ⓘ
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()