Skip to main content

ElementaryStreamConsumer

Trait ElementaryStreamConsumer 

Source
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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§