public final class SectionReader extends Object implements TsPayloadReader
SectionPayloadReader
.
Useful information on PSI sections can be found in ISO/IEC 13818-1, section 2.4.4.TsPayloadReader.DvbSubtitleInfo, TsPayloadReader.EsInfo, TsPayloadReader.Factory, TsPayloadReader.Flags, TsPayloadReader.TrackIdGenerator
FLAG_DATA_ALIGNMENT_INDICATOR, FLAG_PAYLOAD_UNIT_START_INDICATOR, FLAG_RANDOM_ACCESS_INDICATOR
Constructor and Description |
---|
SectionReader(SectionPayloadReader reader) |
Modifier and Type | Method and Description |
---|---|
void |
consume(ParsableByteArray data,
int flags)
Consumes the payload of a TS packet.
|
void |
init(TimestampAdjuster timestampAdjuster,
ExtractorOutput extractorOutput,
TsPayloadReader.TrackIdGenerator idGenerator)
Initializes the payload reader.
|
void |
seek()
Notifies the reader that a seek has occurred.
|
public SectionReader(SectionPayloadReader reader)
public void init(TimestampAdjuster timestampAdjuster, ExtractorOutput extractorOutput, TsPayloadReader.TrackIdGenerator idGenerator)
TsPayloadReader
init
in interface TsPayloadReader
timestampAdjuster
- A timestamp adjuster for offsetting and scaling sample timestamps.extractorOutput
- The ExtractorOutput
that receives the extracted data.idGenerator
- A PesReader.TrackIdGenerator
that generates unique track ids for the
TrackOutput
s.public void seek()
TsPayloadReader
Following a call to this method, the data passed to the next invocation of TsPayloadReader.consume(com.google.android.exoplayer2.util.ParsableByteArray, int)
will not be a continuation of the data that was previously passed. Hence the reader should
reset any internal state.
seek
in interface TsPayloadReader
public void consume(ParsableByteArray data, @TsPayloadReader.Flags int flags)
TsPayloadReader
consume
in interface TsPayloadReader
data
- The TS packet. The position will be set to the start of the payload.flags
- See TsPayloadReader.Flags
.