Trait mpeg2ts_reader::demultiplex::PacketFilter[][src]

pub trait PacketFilter {
    type Ctx: DemuxContext;
    fn consume(&mut self, ctx: &mut Self::Ctx, pk: &Packet<'_>);
}

Trait to which Demultiplex delegates handling of subsets of Transport Stream packets.

A packet filter can collaborate with the owning Demultiplex instance via the DemuxContext to which they will both be lent mutable access. For example, by making entries in the FilterChangeset owned by the DemuxContext, a PacketFilter implementation may alter the handling of subsequent packets in the Transport Stream.

Associated Types

type Ctx: DemuxContext[src]

The type of context-object used by the Demultiplex instance with which implementing PacketFilters will be collaborating.

Loading content...

Required methods

fn consume(&mut self, ctx: &mut Self::Ctx, pk: &Packet<'_>)[src]

Implements filter-specific packet processing logic.

Loading content...

Implementors

impl<Ctx, E> PacketFilter for PesPacketFilter<Ctx, E> where
    Ctx: DemuxContext,
    E: ElementaryStreamConsumer<Ctx>, 
[src]

type Ctx = Ctx

impl<Ctx: DemuxContext> PacketFilter for NullPacketFilter<Ctx>[src]

type Ctx = Ctx

impl<Ctx: DemuxContext> PacketFilter for PatPacketFilter<Ctx>[src]

type Ctx = Ctx

impl<Ctx: DemuxContext> PacketFilter for PmtPacketFilter<Ctx>[src]

type Ctx = Ctx

Loading content...