Trait mpeg2ts_reader::psi::SectionProcessor [−][src]
pub trait SectionProcessor {
type Context;
fn start_section<'a>(
&mut self,
ctx: &mut Self::Context,
header: &SectionCommonHeader,
section_data: &'a [u8]
);
fn continue_section<'a>(
&mut self,
ctx: &mut Self::Context,
section_data: &'a [u8]
);
fn reset(&mut self);
}Trait for types which process the data within a PSI section following the 12-byte
section_length field (which is one of the items available in the SectionCommonHeader that
is passed in.
- For PSI tables that use ‘section syntax’, the existing
SectionSyntaxSectionProcessorimplementation of this trait can be used. - This trait should be implemented directly for PSI tables that use ‘compact’ syntax (i.e.
they lack the 5-bytes-worth of fields represented by
TableSyntaxHeader)
Implementations of this trait will need to use the section_length method of the header
param passed to start_section() to determine when the complete section has been supplied
(if the complete header is not supplied in the call to start_section() more data may be
supplied in one or more subsequent calls to continue_section().
Associated Types
type Context[src]
The type of the context object that the caller will pass through to the methods of this trait
Required methods
fn start_section<'a>(
&mut self,
ctx: &mut Self::Context,
header: &SectionCommonHeader,
section_data: &'a [u8]
)[src]
&mut self,
ctx: &mut Self::Context,
header: &SectionCommonHeader,
section_data: &'a [u8]
)
Note that the first 3 bytes of section_data contain the header fields that have also
been supplied to this call in the header parameter. This is to allow implementers to
calculate a CRC over the whole section if required.
fn continue_section<'a>(
&mut self,
ctx: &mut Self::Context,
section_data: &'a [u8]
)[src]
&mut self,
ctx: &mut Self::Context,
section_data: &'a [u8]
)
may be called to pass the implementation additional slices of section data, if the complete section was not already passed.
fn reset(&mut self)[src]
called if there is a problem in the transport stream that means any in-progress section data should be discarded.
Implementors
impl<SP> SectionProcessor for CompactSyntaxSectionProcessor<SP> where
SP: CompactSyntaxPayloadParser, [src]
SP: CompactSyntaxPayloadParser,
type Context = SP::Context
fn start_section<'a>(
&mut self,
ctx: &mut Self::Context,
header: &SectionCommonHeader,
data: &'a [u8]
)[src]
&mut self,
ctx: &mut Self::Context,
header: &SectionCommonHeader,
data: &'a [u8]
)
fn continue_section<'a>(&mut self, ctx: &mut Self::Context, data: &'a [u8])[src]
fn reset(&mut self)[src]
impl<SP> SectionProcessor for SectionSyntaxSectionProcessor<SP> where
SP: SectionSyntaxPayloadParser, [src]
SP: SectionSyntaxPayloadParser,