From 3879a485b722caf045a665388a643f279d6c7368 Mon Sep 17 00:00:00 2001 From: christosts Date: Fri, 15 Jan 2021 11:49:12 +0000 Subject: [PATCH] Remove FixedTrackSelection.Factory PiperOrigin-RevId: 351978954 --- RELEASENOTES.md | 3 ++ .../trackselection/FixedTrackSelection.java | 43 ------------------- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7c8b851deb..6e602e4c09 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -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. diff --git a/library/core/src/main/java/com/google/android/exoplayer2/trackselection/FixedTrackSelection.java b/library/core/src/main/java/com/google/android/exoplayer2/trackselection/FixedTrackSelection.java index 91b21bac65..62e9a3dc71 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/trackselection/FixedTrackSelection.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/trackselection/FixedTrackSelection.java @@ -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;