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 { ...@@ -150,9 +150,7 @@ public class AdaptiveTrackSelection extends BaseTrackSelection {
? new FixedTrackSelection( ? new FixedTrackSelection(
definition.group, definition.group,
/* track= */ definition.tracks[0], /* track= */ definition.tracks[0],
/* type= */ definition.type, /* type= */ definition.type)
/* reason= */ definition.reason,
definition.data)
: createAdaptiveTrackSelection( : createAdaptiveTrackSelection(
definition.group, definition.group,
definition.tracks, definition.tracks,
......
...@@ -1722,11 +1722,7 @@ public class DefaultTrackSelector extends MappingTrackSelector { ...@@ -1722,11 +1722,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
override == null override == null
? null ? null
: new ExoTrackSelection.Definition( : new ExoTrackSelection.Definition(
rendererTrackGroups.get(override.groupIndex), rendererTrackGroups.get(override.groupIndex), override.tracks, override.type);
override.tracks,
override.type,
C.SELECTION_REASON_MANUAL,
/* data= */ null);
} }
} }
......
...@@ -44,10 +44,6 @@ public interface ExoTrackSelection extends TrackSelection { ...@@ -44,10 +44,6 @@ public interface ExoTrackSelection extends TrackSelection {
public final int[] tracks; public final int[] tracks;
/** The type that will be returned from {@link TrackSelection#getType()}. */ /** The type that will be returned from {@link TrackSelection#getType()}. */
public final int type; 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. * @param group The {@link TrackGroup}. Must not be null.
...@@ -55,7 +51,7 @@ public interface ExoTrackSelection extends TrackSelection { ...@@ -55,7 +51,7 @@ public interface ExoTrackSelection extends TrackSelection {
* null or empty. May be in any order. * null or empty. May be in any order.
*/ */
public Definition(TrackGroup group, int... tracks) { 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 { ...@@ -63,15 +59,11 @@ public interface ExoTrackSelection extends TrackSelection {
* @param tracks The indices of the selected tracks within the {@link TrackGroup}. Must not be * @param tracks The indices of the selected tracks within the {@link TrackGroup}. Must not be
* null or empty. May be in any order. * null or empty. May be in any order.
* @param type The type that will be returned from {@link TrackSelection#getType()}. * @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.group = group;
this.tracks = tracks; this.tracks = tracks;
this.type = type; this.type = type;
this.reason = reason;
this.data = data;
} }
} }
......
...@@ -35,10 +35,19 @@ public final class FixedTrackSelection extends BaseTrackSelection { ...@@ -35,10 +35,19 @@ public final class FixedTrackSelection extends BaseTrackSelection {
* @param track The index of the selected track within the {@link TrackGroup}. * @param track The index of the selected track within the {@link TrackGroup}.
*/ */
public FixedTrackSelection(TrackGroup group, int track) { 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( this(
group, group,
/* track= */ track, /* track= */ track,
/* type= */ TrackSelection.TYPE_UNSET, /* type= */ type,
/* reason= */ C.SELECTION_REASON_UNKNOWN, /* reason= */ C.SELECTION_REASON_UNKNOWN,
null); null);
} }
......
...@@ -64,11 +64,7 @@ public final class TrackSelectionUtil { ...@@ -64,11 +64,7 @@ public final class TrackSelectionUtil {
} else { } else {
selections[i] = selections[i] =
new FixedTrackSelection( new FixedTrackSelection(
definition.group, definition.group, definition.tracks[0], /* type= */ definition.type);
definition.tracks[0],
/* type= */ definition.type,
/* reason= */ definition.reason,
definition.data);
} }
} }
return selections; 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