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§
Sourcefn start_stream(&mut self, ctx: &mut Ctx)
fn start_stream(&mut self, ctx: &mut Ctx)
called before the first call to begin_packet()
Sourcefn begin_packet(&mut self, ctx: &mut Ctx, header: PesHeader<'_>)
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
Sourcefn continue_packet(&mut self, ctx: &mut Ctx, data: &[u8])
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.
Sourcefn end_packet(&mut self, ctx: &mut Ctx)
fn end_packet(&mut self, ctx: &mut Ctx)
called when a PES packet ends, prior to the next call to begin_packet() (if any).
Sourcefn continuity_error(&mut self, ctx: &mut Ctx)
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".