[−][src]Struct mpeg2ts_reader::pes::PesHeader
Header at the start of every PES packet.
The header identifies,
- The stream identifier, returned by
stream_id() - The the size of the packet, returned by
pes_packet_length(), which may well be larger than the size of the payload buffer obtained from the header (the payload is likely split across multiple Transport Stream packets)
In addition, the header may provide access to either
- an additional set of header data followed by a payload, when
contents()returnsPesContents::Parsed - just a payload on its own, when
contents()returnsPesContents::Payload
Methods
impl<'buf> PesHeader<'buf>[src]
pub fn from_bytes(buf: &'buf [u8]) -> Option<PesHeader<'buf>>[src]
Wraps the given slice in a PesHeader, which will then provide method to parse the header fields within the slice.
Returns None if the buffer is too small to hold the PES header, or if the PES
'start code prefix' is missing.
TODO: should probably return Result.
pub fn stream_id(&self) -> StreamId[src]
Indicator of the type of stream per ISO/IEC 13818-1, Table 2-18.
pub fn pes_packet_length(&self) -> PesLength[src]
The overall length of the PES packet, once all pieces from the transport stream have been collected.
pub fn contents(&self) -> PesContents<'buf>[src]
Either PesContents::Parsed, or PesContents::Payload, depending on the value of
stream_id()
Auto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,