TsPayloadReader.TrackIdGenerator


public final class TsPayloadReader.TrackIdGenerator


Generates track ids for initializing TsPayloadReaders' TrackOutputs.

Summary

Public fields

String
int

Public constructors

TrackIdGenerator(int firstTrackId, int trackIdIncrement)
TrackIdGenerator(
    int programNumber,
    int firstTrackId,
    int trackIdIncrement
)

Public methods

void

Generates a new set of track and track format ids.

String

Returns the last generated format id, with the format "programNumber/trackId".

int

Returns the last generated track id.

Public fields

formatId

public String formatId

trackId

public int trackId

Public constructors

TrackIdGenerator

public TrackIdGenerator(int firstTrackId, int trackIdIncrement)

TrackIdGenerator

public TrackIdGenerator(
    int programNumber,
    int firstTrackId,
    int trackIdIncrement
)

Public methods

generateNewId

public void generateNewId()

Generates a new set of track and track format ids. Must be called before get* methods.

getFormatId

public String getFormatId()

Returns the last generated format id, with the format "programNumber/trackId". If no programNumber was provided, the trackId alone is used as format id. Must be called after the first generateNewId call.

Returns
String

The last generated format id, with the format "programNumber/trackId". If no programNumber was provided, the trackId alone is used as format id.

getTrackId

public int getTrackId()

Returns the last generated track id. Must be called after the first generateNewId call.

Returns
int

The last generated track id.