[][src]Struct adts_reader::AdtsParser

pub struct AdtsParser<C> where
    C: AdtsConsumer
{ pub consumer: C, // some fields omitted }

Find ADTS frames within provided buffers of data, announcing audio configuration as it is discovered (normally just once at the start, but possibly changing during the stream if the stream is malformed).

Does not currently try to handle re-synchronise with the ADTS bitstream on encountering bad data.

Fields

consumer: C

Methods

impl<C> AdtsParser<C> where
    C: AdtsConsumer
[src]

pub fn new(consumer: C) -> AdtsParser<C>[src]

pub fn start(&mut self)[src]

Initialize or re-initialize parser state. Call this function before processing a group of ADTS frames to ensure that any error state due to processing an earlier group of ADTS frames is cleared.

pub fn push(&mut self, adts_buf: &[u8])[src]

Extracts information about each ADTS frame in the given buffer, which is passed to the AdtsConsumer implementation supplied at construction time.

If the given buffer ends part-way through an ADTS frame, the remaining unconsumed data will be buffered inside this AdtsParser instance, and the rest of the ADTS frame may be passed in another buffer in the next call to this method.

Auto Trait Implementations

impl<C> Sync for AdtsParser<C> where
    C: Sync

impl<C> Unpin for AdtsParser<C> where
    C: Unpin

impl<C> Send for AdtsParser<C> where
    C: Send

impl<C> UnwindSafe for AdtsParser<C> where
    C: UnwindSafe

impl<C> RefUnwindSafe for AdtsParser<C> where
    C: RefUnwindSafe

Blanket Implementations

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.

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

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

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