Commit 9de6a758 by olly Committed by kim-vde

Remove dynamic data from ExoTrackSelection.Definition

PiperOrigin-RevId: 357587767
parent abaf1e10
......@@ -150,9 +150,7 @@ public class AdaptiveTrackSelection extends BaseTrackSelection {
? new FixedTrackSelection(
definition.group,
/* track= */ definition.tracks[0],
/* type= */ definition.type,
/* reason= */ definition.reason,
definition.data)
/* type= */ definition.type)
: createAdaptiveTrackSelection(
definition.group,
definition.tracks,
......
......@@ -1722,11 +1722,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
override == null
? null
: new ExoTrackSelection.Definition(
rendererTrackGroups.get(override.groupIndex),
override.tracks,
override.type,
C.SELECTION_REASON_MANUAL,
/* data= */ null);
rendererTrackGroups.get(override.groupIndex), override.tracks, override.type);
}
}
......
......@@ -44,10 +44,6 @@ public interface ExoTrackSelection extends TrackSelection {
public final int[] tracks;
/** The type that will be returned from {@link TrackSelection#getType()}. */
public final int type;
/** The track selection reason. One of the {@link C} SELECTION_REASON_ constants. */
public final int reason;
/** Optional data associated with this selection of tracks. */
@Nullable public final Object data;
/**
* @param group The {@link TrackGroup}. Must not be null.
......@@ -55,7 +51,7 @@ public interface ExoTrackSelection extends TrackSelection {
* null or empty. May be in any order.
*/
public Definition(TrackGroup group, int... tracks) {
this(group, tracks, TrackSelection.TYPE_UNSET, C.SELECTION_REASON_UNKNOWN, /* data= */ null);
this(group, tracks, TrackSelection.TYPE_UNSET);
}
/**
......@@ -63,15 +59,11 @@ public interface ExoTrackSelection extends TrackSelection {
* @param tracks The indices of the selected tracks within the {@link TrackGroup}. Must not be
* null or empty. May be in any order.
* @param type The type that will be returned from {@link TrackSelection#getType()}.
* @param reason The track selection reason. One of the {@link C} SELECTION_REASON_ constants.
* @param data Optional data associated with this selection of tracks.
*/
public Definition(TrackGroup group, int[] tracks, int type, int reason, @Nullable Object data) {
public Definition(TrackGroup group, int[] tracks, int type) {
this.group = group;
this.tracks = tracks;
this.type = type;
this.reason = reason;
this.data = data;
}
}
......
......@@ -35,10 +35,19 @@ public final class FixedTrackSelection extends BaseTrackSelection {
* @param track The index of the selected track within the {@link TrackGroup}.
*/
public FixedTrackSelection(TrackGroup group, int track) {
this(group, /* track= */ track, /* type= */ TrackSelection.TYPE_UNSET);
}
/**
* @param group The {@link TrackGroup}. Must not be null.
* @param track The index of the selected track within the {@link TrackGroup}.
* @param type The type that will be returned from {@link TrackSelection#getType()}.
*/
public FixedTrackSelection(TrackGroup group, int track, int type) {
this(
group,
/* track= */ track,
/* type= */ TrackSelection.TYPE_UNSET,
/* type= */ type,
/* reason= */ C.SELECTION_REASON_UNKNOWN,
null);
}
......
......@@ -64,11 +64,7 @@ public final class TrackSelectionUtil {
} else {
selections[i] =
new FixedTrackSelection(
definition.group,
definition.tracks[0],
/* type= */ definition.type,
/* reason= */ definition.reason,
definition.data);
definition.group, definition.tracks[0], /* type= */ definition.type);
}
}
return selections;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment