public final class PesReader extends java.lang.Object implements TsPayloadReader
TsPayloadReader.DvbSubtitleInfo, TsPayloadReader.EsInfo, TsPayloadReader.Factory, TsPayloadReader.Flags, TsPayloadReader.TrackIdGeneratorFLAG_DATA_ALIGNMENT_INDICATOR, FLAG_PAYLOAD_UNIT_START_INDICATOR, FLAG_RANDOM_ACCESS_INDICATOR| Constructor and Description |
|---|
PesReader(ElementaryStreamReader 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 PesReader(ElementaryStreamReader reader)
public void init(TimestampAdjuster timestampAdjuster, ExtractorOutput extractorOutput, TsPayloadReader.TrackIdGenerator idGenerator)
TsPayloadReaderinit in interface TsPayloadReadertimestampAdjuster - 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
TrackOutputs.public final void seek()
TsPayloadReaderFollowing 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 TsPayloadReaderpublic final void consume(ParsableByteArray data, @TsPayloadReader.Flags int flags) throws ParserException
TsPayloadReaderconsume in interface TsPayloadReaderdata - The TS packet. The position will be set to the start of the payload.flags - See TsPayloadReader.Flags.ParserException - If the payload could not be parsed.