Back to Exoplayer

TsPayloadReader (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/extractor/ts/TsPayloadReader.html

latest6.2 KB
Original Source

Package com.google.android.exoplayer2.extractor.ts

Interface TsPayloadReader

  • All Known Implementing Classes:PesReader, SectionReader

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceTsPayloadReader

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Parses TS packet payload data.

Nested Class Summary

Nested Classes | Modifier and Type | Interface | Description | | --- | --- | --- | | static class | TsPayloadReader.DvbSubtitleInfo | Deprecated.

Holds information about a DVB subtitle, as defined in ETSI EN 300 468 V1.11.1 section 6.2.41. | | static class | TsPayloadReader.EsInfo | Deprecated.

Holds information associated with a PMT entry. | | static interface | TsPayloadReader.Factory | Deprecated.

Factory of TsPayloadReader instances. | | static interface | TsPayloadReader.Flags | Deprecated.

Contextual flags indicating the presence of indicators in the TS packet or PES packet headers. | | static class | TsPayloadReader.TrackIdGenerator | Deprecated.

Generates track ids for initializing TsPayloadReaders' TrackOutputs. |

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static int | FLAG_DATA_ALIGNMENT_INDICATOR | Deprecated.

Indicates the presence of the data_alignment_indicator in the PES header. | | static int | FLAG_PAYLOAD_UNIT_START_INDICATOR | Deprecated.

Indicates the presence of the payload_unit_start_indicator in the TS packet header. | | static int | FLAG_RANDOM_ACCESS_INDICATOR | Deprecated.

Indicates the presence of the random_access_indicator in the TS packet header adaptation field. |

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | consume​(ParsableByteArray data, @com.google.android.exoplayer2.extractor.ts.TsPayloadReader.Flags int flags) | Deprecated.

Consumes the payload of a TS packet. | | void | init​(TimestampAdjuster timestampAdjuster, ExtractorOutput extractorOutput, TsPayloadReader.TrackIdGenerator idGenerator) | Deprecated.

Initializes the payload reader. | | void | seek() | Deprecated.

Notifies the reader that a seek has occurred. |

Field Detail

- 

FLAG_PAYLOAD_UNIT_START_INDICATOR

static final int FLAG_PAYLOAD_UNIT_START_INDICATOR

Deprecated.

Indicates the presence of the payload_unit_start_indicator in the TS packet header. See Also:Constant Field Values

- 

FLAG_RANDOM_ACCESS_INDICATOR

static final int FLAG_RANDOM_ACCESS_INDICATOR

Deprecated.

Indicates the presence of the random_access_indicator in the TS packet header adaptation field. See Also:Constant Field Values

- 

FLAG_DATA_ALIGNMENT_INDICATOR

static final int FLAG_DATA_ALIGNMENT_INDICATOR

Deprecated.

Indicates the presence of the data_alignment_indicator in the PES header. See Also:Constant Field Values

Method Detail

- 

init

void init​([TimestampAdjuster](../../util/TimestampAdjuster.html "class in com.google.android.exoplayer2.util")timestampAdjuster,[ExtractorOutput](../ExtractorOutput.html "interface in com.google.android.exoplayer2.extractor")extractorOutput,[TsPayloadReader.TrackIdGenerator](TsPayloadReader.TrackIdGenerator.html "class in com.google.android.exoplayer2.extractor.ts")idGenerator)

Deprecated.

Initializes the payload reader. Parameters:timestampAdjuster - A timestamp adjuster for offsetting and scaling sample timestamps.extractorOutput - The ExtractorOutput that receives the extracted data.idGenerator - A TsPayloadReader.TrackIdGenerator that generates unique track ids for the TrackOutputs.

- 

seek

void seek()

Deprecated.

Notifies the reader that a seek has occurred.

Following a call to this method, the data passed to the next invocation of consume(com.google.android.exoplayer2.util.ParsableByteArray, @com.google.android.exoplayer2.extractor.ts.TsPayloadReader.Flags int) will not be a continuation of the data that was previously passed. Hence the reader should reset any internal state.

- 

consume

void consume​([ParsableByteArray](../../util/ParsableByteArray.html "class in com.google.android.exoplayer2.util")data,
             @com.google.android.exoplayer2.extractor.ts.TsPayloadReader.Flags int flags)
      throws[ParserException](../../ParserException.html "class in com.google.android.exoplayer2")

Deprecated.

Consumes the payload of a TS packet. Parameters:data - The TS packet. The position will be set to the start of the payload.flags - See TsPayloadReader.Flags.Throws:ParserException - If the payload could not be parsed.