Commit 3879a485 by christosts Committed by Oliver Woodman

Remove FixedTrackSelection.Factory

PiperOrigin-RevId: 351978954
parent 4270d97f
......@@ -12,6 +12,9 @@
instead.
* `DrmInitData.get(UUID)`. Use `DrmInitData.get(int)` and
`DrmInitData.SchemeData.matches(UUID)` instead.
* `FixedTrackSelection.Factory`. If you need to disable adaptive
selection in `DefaultTrackSelector`, enable the
`DefaultTrackSelector.Parameters.forceHighestSupportedBitrate` flag.
* `ExtractorsMediaSource.Factory.setMinLoadableRetryCount(int)`. Use
`ExtractorsMediaSource.Factory.setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy)`
instead.
......
......@@ -17,59 +17,16 @@ package com.google.android.exoplayer2.trackselection;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.source.MediaSource.MediaPeriodId;
import com.google.android.exoplayer2.source.TrackGroup;
import com.google.android.exoplayer2.source.chunk.MediaChunk;
import com.google.android.exoplayer2.source.chunk.MediaChunkIterator;
import com.google.android.exoplayer2.upstream.BandwidthMeter;
import java.util.List;
import org.checkerframework.checker.nullness.compatqual.NullableType;
/**
* A {@link TrackSelection} consisting of a single track.
*/
public final class FixedTrackSelection extends BaseTrackSelection {
/**
* @deprecated Don't use as adaptive track selection factory as it will throw when multiple tracks
* are selected. If you would like to disable adaptive selection in {@link
* DefaultTrackSelector}, enable the {@link
* DefaultTrackSelector.Parameters#forceHighestSupportedBitrate} flag instead.
*/
@Deprecated
public static final class Factory implements TrackSelection.Factory {
private final int reason;
@Nullable private final Object data;
public Factory() {
this.reason = C.SELECTION_REASON_UNKNOWN;
this.data = null;
}
/**
* @param reason A reason for the track selection.
* @param data Optional data associated with the track selection.
*/
public Factory(int reason, @Nullable Object data) {
this.reason = reason;
this.data = data;
}
@Override
public @NullableType TrackSelection[] createTrackSelections(
@NullableType Definition[] definitions,
BandwidthMeter bandwidthMeter,
MediaPeriodId mediaPeriodId,
Timeline timeline) {
return TrackSelectionUtil.createTrackSelectionsForDefinitions(
definitions,
definition ->
new FixedTrackSelection(definition.group, definition.tracks[0], reason, data));
}
}
private final int reason;
@Nullable private final Object data;
......
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