@UnstableApi
public final class Metadata implements Parcelable


A collection of metadata entries.

Summary

Nested types

public interface Metadata.Entry extends Parcelable

A metadata entry.

Constants

static final Parcelable.Creator<Metadata>

Public fields

final long

The presentation time of the metadata, in microseconds.

Public constructors

Metadata(Metadata.Entry[] entries)
Metadata(long presentationTimeUs, Metadata.Entry[] entries)
Metadata(long presentationTimeUs, List<Metadata.Entry> entries)

Public methods

Metadata
copyWithAppendedEntries(Metadata.Entry[] entriesToAppend)

Returns a copy of this metadata with the specified entries appended.

Metadata

Returns a copy of this metadata with the entries of the specified metadata appended.

Metadata
copyWithPresentationTimeUs(long presentationTimeUs)

Returns a copy of this metadata with the specified presentation time.

int
boolean
Metadata.Entry
get(int index)

Returns the entry at the specified index.

int
int

Returns the number of metadata entries.

String
void
writeToParcel(Parcel dest, int flags)

Inherited Constants

From android.os.Parcelable
static final int
static final int

Constants

CREATOR

public static final Parcelable.Creator<MetadataCREATOR

Public fields

presentationTimeUs

public final long presentationTimeUs

The presentation time of the metadata, in microseconds.

This time is an offset from the start of the current Timeline.Period.

This time is TIME_UNSET when not known or undefined.

Public constructors

Metadata

public Metadata(Metadata.Entry[] entries)
Parameters
Metadata.Entry[] entries

The metadata entries.

Metadata

public Metadata(List<Metadata.Entry> entries)
Parameters
List<Metadata.Entry> entries

The metadata entries.

Metadata

public Metadata(long presentationTimeUs, Metadata.Entry[] entries)
Parameters
long presentationTimeUs

The presentation time for the metadata entries.

Metadata.Entry[] entries

The metadata entries.

Metadata

public Metadata(long presentationTimeUs, List<Metadata.Entry> entries)
Parameters
long presentationTimeUs

The presentation time for the metadata entries.

List<Metadata.Entry> entries

The metadata entries.

Public methods

copyWithAppendedEntries

public Metadata copyWithAppendedEntries(Metadata.Entry[] entriesToAppend)

Returns a copy of this metadata with the specified entries appended.

Parameters
Metadata.Entry[] entriesToAppend

The entries to append.

Returns
Metadata

The metadata instance with the appended entries.

copyWithAppendedEntriesFrom

public Metadata copyWithAppendedEntriesFrom(@Nullable Metadata other)

Returns a copy of this metadata with the entries of the specified metadata appended. Returns this instance if other is null.

Parameters
@Nullable Metadata other

The metadata that holds the entries to append. If null, this methods returns this instance.

Returns
Metadata

The metadata instance with the appended entries.

copyWithPresentationTimeUs

public Metadata copyWithPresentationTimeUs(long presentationTimeUs)

Returns a copy of this metadata with the specified presentation time.

Parameters
long presentationTimeUs

The new presentation time, in microseconds.

Returns
Metadata

The metadata instance with the new presentation time.

describeContents

public int describeContents()

equals

public boolean equals(@Nullable Object obj)

get

public Metadata.Entry get(int index)

Returns the entry at the specified index.

Parameters
int index

The index of the entry.

Returns
Metadata.Entry

The entry at the specified index.

hashCode

public int hashCode()

length

public int length()

Returns the number of metadata entries.

toString

public String toString()

writeToParcel

public void writeToParcel(Parcel dest, int flags)