TrackSampleTable


@UnstableApi
class TrackSampleTable


Sample table for a track in an MP4 file.

Summary

Public constructors

TrackSampleTable(
    track: Track!,
    offsets: LongArray!,
    sizes: IntArray!,
    maximumSize: Int,
    timestampsUs: LongArray!,
    flags: IntArray!,
    durationUs: Long
)

Public functions

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 properties

Long

The duration of the track sample table in microseconds.

IntArray<Int>!

Sample flags.

Int

Maximum sample size in sizes.

LongArray<Long>!

Sample offsets in bytes.

Int

Number of samples.

IntArray<Int>!

Sample sizes in bytes.

LongArray<Long>!

Sample timestamps in microseconds.

Track!

The track corresponding to this sample table.

Public constructors

TrackSampleTable

TrackSampleTable(
    track: Track!,
    offsets: LongArray!,
    sizes: IntArray!,
    maximumSize: Int,
    timestampsUs: LongArray!,
    flags: IntArray!,
    durationUs: Long
)

Public functions

getIndexOfEarlierOrEqualSynchronizationSample

fun getIndexOfEarlierOrEqualSynchronizationSample(timeUs: Long): Int

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

Parameters
timeUs: Long

Timestamp adjacent to which to find a synchronization sample.

Returns
Int

Index of the synchronization sample, or INDEX_UNSET if none.

getIndexOfLaterOrEqualSynchronizationSample

fun getIndexOfLaterOrEqualSynchronizationSample(timeUs: Long): Int

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

Parameters
timeUs: Long

Timestamp adjacent to which to find a synchronization sample.

Returns
Int

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

Public properties

durationUs

val durationUsLong

The duration of the track sample table in microseconds.

flags

val flagsIntArray<Int>!

Sample flags.

maximumSize

val maximumSizeInt

Maximum sample size in sizes.

offsets

val offsetsLongArray<Long>!

Sample offsets in bytes.

sampleCount

val sampleCountInt

Number of samples.

sizes

val sizesIntArray<Int>!

Sample sizes in bytes.

timestampsUs

val timestampsUsLongArray<Long>!

Sample timestamps in microseconds.

track

val trackTrack!

The track corresponding to this sample table.