TrackSampleTable


@UnstableApi
public final class TrackSampleTable


Sample table for a track in an MP4 file.

Summary

Public fields

final long

The duration of the track sample table in microseconds.

final int[]

Sample flags.

final int

Maximum sample size in sizes.

final long[]

Sample offsets in bytes.

final int

Number of samples.

final int[]

Sample sizes in bytes.

final long[]

Sample timestamps in microseconds.

final Track

The track corresponding to this sample table.

Public constructors

TrackSampleTable(
    Track track,
    long[] offsets,
    int[] sizes,
    int maximumSize,
    long[] timestampsUs,
    int[] flags,
    long durationUs
)

Public methods

int

Returns the sample index of the closest synchronization sample at or before the given timestamp, if one is available.

int

Returns the sample index of the closest synchronization sample at or after the given timestamp, if one is available.

Public fields

durationUs

public final long durationUs

The duration of the track sample table in microseconds.

flags

public final int[] flags

Sample flags.

maximumSize

public final int maximumSize

Maximum sample size in sizes.

offsets

public final long[] offsets

Sample offsets in bytes.

sampleCount

public final int sampleCount

Number of samples.

sizes

public final int[] sizes

Sample sizes in bytes.

timestampsUs

public final long[] timestampsUs

Sample timestamps in microseconds.

track

public final Track track

The track corresponding to this sample table.

Public constructors

TrackSampleTable

public TrackSampleTable(
    Track track,
    long[] offsets,
    int[] sizes,
    int maximumSize,
    long[] timestampsUs,
    int[] flags,
    long durationUs
)

Public methods

getIndexOfEarlierOrEqualSynchronizationSample

public int getIndexOfEarlierOrEqualSynchronizationSample(long timeUs)

Returns the sample index of the closest synchronization sample at or before the given timestamp, if one is available.

Parameters
long timeUs

Timestamp adjacent to which to find a synchronization sample.

Returns
int

Index of the synchronization sample, or INDEX_UNSET if none.

getIndexOfLaterOrEqualSynchronizationSample

public int getIndexOfLaterOrEqualSynchronizationSample(long timeUs)

Returns the sample index of the closest synchronization sample at or after the given timestamp, if one is available.

Parameters
long timeUs

Timestamp adjacent to which to find a synchronization sample.

Returns
int

index Index of the synchronization sample, or INDEX_UNSET if none.