PassthroughSectionPayloadReader


@UnstableApi
public final class PassthroughSectionPayloadReader implements SectionPayloadReader


A SectionPayloadReader that directly outputs the section bytes as sample data.

Timestamp adjustment is provided through subsampleOffsetUs.

Summary

Public constructors

Create a new PassthroughSectionPayloadReader.

Public methods

void

Called by a SectionReader when a full section is received.

void
init(
    TimestampAdjuster timestampAdjuster,
    ExtractorOutput extractorOutput,
    TsPayloadReader.TrackIdGenerator idGenerator
)

Initializes the section payload reader.

Public constructors

PassthroughSectionPayloadReader

public PassthroughSectionPayloadReader(String mimeType)

Create a new PassthroughSectionPayloadReader.

Parameters
String mimeType

The MIME type set as sampleMimeType on the created output track.

Public methods

consume

public void consume(ParsableByteArray sectionData)

Called by a SectionReader when a full section is received.

Parameters
ParsableByteArray sectionData

The data belonging to a section starting from the table_id. If section_syntax_indicator is set to '1', sectionData excludes the CRC_32 field. Otherwise, all bytes belonging to the table section are included.

init

public void init(
    TimestampAdjuster timestampAdjuster,
    ExtractorOutput extractorOutput,
    TsPayloadReader.TrackIdGenerator idGenerator
)

Initializes the section payload reader.

Parameters
TimestampAdjuster timestampAdjuster

A timestamp adjuster for offsetting and scaling sample timestamps.

ExtractorOutput extractorOutput

The ExtractorOutput that receives the extracted data.

TsPayloadReader.TrackIdGenerator idGenerator

A PesReader.TrackIdGenerator that generates unique track ids for the TrackOutputs.