pub trait ElementaryStreamConsumer<Ctx> {
    // Required methods
    fn start_stream(&mut self, ctx: &mut Ctx);
    fn begin_packet(&mut self, ctx: &mut Ctx, header: PesHeader<'_>);
    fn continue_packet(&mut self, ctx: &mut Ctx, data: &[u8]);
    fn end_packet(&mut self, ctx: &mut Ctx);
    fn continuity_error(&mut self, ctx: &mut Ctx);
}
Expand description

Trait for types that will receive call-backs as pieces of a specific elementary stream are encounted within a transport stream.

Instances of this type are registered with a PesPacketConsumer, which itself is responsible for extracting elementary stream data from transport stream packets.

Required Methods§

source

fn start_stream(&mut self, ctx: &mut Ctx)

called before the first call to begin_packet()

source

fn begin_packet(&mut self, ctx: &mut Ctx, header: PesHeader<'_>)

called with the header at the start of the PES packet, which may not contain the complete PES payload

source

fn continue_packet(&mut self, ctx: &mut Ctx, data: &[u8])

called after an earlier call to begin_packet() when another part of the packet’s payload data is found in the Transport Stream.

source

fn end_packet(&mut self, ctx: &mut Ctx)

called when a PES packet ends, prior to the next call to begin_packet() (if any).

source

fn continuity_error(&mut self, ctx: &mut Ctx)

called when gap is seen in continuity counter values for this stream, indicating that some data in the original Transport Stream did not reach the parser.

Implementors§