public final class

TsPayloadReader.TrackIdGenerator

extends java.lang.Object

 java.lang.Object

↳androidx.media3.extractor.ts.TsPayloadReader.TrackIdGenerator

Overview

Generates track ids for initializing TsPayloadReaders' TrackOutputs.

Summary

Constructors
publicTrackIdGenerator(int firstTrackId, int trackIdIncrement)

publicTrackIdGenerator(int programNumber, int firstTrackId, int trackIdIncrement)

Methods
public voidgenerateNewId()

Generates a new set of track and track format ids.

public java.lang.StringgetFormatId()

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

public intgetTrackId()

Returns the last generated track id.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public TrackIdGenerator(int firstTrackId, int trackIdIncrement)

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

Methods

public void generateNewId()

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

public int getTrackId()

Returns the last generated track id. Must be called after the first TsPayloadReader.TrackIdGenerator.generateNewId() call.

Returns:

The last generated track id.

public java.lang.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 TsPayloadReader.TrackIdGenerator.generateNewId() call.

Returns:

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