diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/TrackGroup.java b/library/common/src/main/java/com/google/android/exoplayer2/source/TrackGroup.java similarity index 86% rename from library/core/src/main/java/com/google/android/exoplayer2/source/TrackGroup.java rename to library/common/src/main/java/com/google/android/exoplayer2/source/TrackGroup.java index 9e837bf05d..607f797103 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/TrackGroup.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/source/TrackGroup.java @@ -23,20 +23,10 @@ import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.util.Assertions; import java.util.Arrays; -// TODO: Add an allowMultipleStreams boolean to indicate where the one stream per group restriction -// does not apply. -/** - * Defines a group of tracks exposed by a {@link MediaPeriod}. - * - *

A {@link MediaPeriod} is only able to provide one {@link SampleStream} corresponding to a - * group at any given time, however this {@link SampleStream} may adapt between multiple tracks - * within the group. - */ +/** Defines an immutable group of tracks identified by their format identity. */ public final class TrackGroup implements Parcelable { - /** - * The number of tracks in the group. - */ + /** The number of tracks in the group. */ public final int length; private final Format[] formats; @@ -45,7 +35,7 @@ public final class TrackGroup implements Parcelable { private int hashCode; /** - * @param formats The track formats. Must not be null, contain null elements or be of length 0. + * @param formats The track formats. At least one {@link Format} must be provided. */ public TrackGroup(Format... formats) { Assertions.checkState(formats.length > 0); diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/TrackGroupArray.java b/library/common/src/main/java/com/google/android/exoplayer2/source/TrackGroupArray.java similarity index 90% rename from library/core/src/main/java/com/google/android/exoplayer2/source/TrackGroupArray.java rename to library/common/src/main/java/com/google/android/exoplayer2/source/TrackGroupArray.java index e737a5fafa..8db7b9c385 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/TrackGroupArray.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/source/TrackGroupArray.java @@ -21,17 +21,13 @@ import androidx.annotation.Nullable; import com.google.android.exoplayer2.C; import java.util.Arrays; -/** An array of {@link TrackGroup}s exposed by a {@link MediaPeriod}. */ +/** An immutable array of {@link TrackGroup}s. */ public final class TrackGroupArray implements Parcelable { - /** - * The empty array. - */ + /** The empty array. */ public static final TrackGroupArray EMPTY = new TrackGroupArray(); - /** - * The number of groups in the array. Greater than or equal to zero. - */ + /** The number of groups in the array. Greater than or equal to zero. */ public final int length; private final TrackGroup[] trackGroups; @@ -39,9 +35,7 @@ public final class TrackGroupArray implements Parcelable { // Lazily initialized hashcode. private int hashCode; - /** - * @param trackGroups The groups. Must not be null or contain null elements, but may be empty. - */ + /** @param trackGroups The groups. May be empty. */ public TrackGroupArray(TrackGroup... trackGroups) { this.trackGroups = trackGroups; this.length = trackGroups.length; @@ -83,9 +77,7 @@ public final class TrackGroupArray implements Parcelable { return C.INDEX_UNSET; } - /** - * Returns whether this track group array is empty. - */ + /** Returns whether this track group array is empty. */ public boolean isEmpty() { return length == 0; } diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/MediaPeriod.java b/library/core/src/main/java/com/google/android/exoplayer2/source/MediaPeriod.java index 39b207e264..1c5a23e48c 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/MediaPeriod.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/MediaPeriod.java @@ -29,14 +29,16 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; /** * Loads media corresponding to a {@link Timeline.Period}, and allows that media to be read. All - * methods are called on the player's internal playback thread, as described in the - * {@link ExoPlayer} Javadoc. + * methods are called on the player's internal playback thread, as described in the {@link + * ExoPlayer} Javadoc. + * + *

A {@link MediaPeriod} may only able to provide one {@link SampleStream} corresponding to a + * group at any given time, however this {@link SampleStream} may adapt between multiple tracks + * within the group. */ public interface MediaPeriod extends SequenceableLoader { - /** - * A callback to be notified of {@link MediaPeriod} events. - */ + /** A callback to be notified of {@link MediaPeriod} events. */ interface Callback extends SequenceableLoader.Callback { /**