mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Remove FixedTrackSelection.Factory
PiperOrigin-RevId: 351978954
This commit is contained in:
parent
4270d97fc5
commit
3879a485b7
2 changed files with 3 additions and 43 deletions
|
|
@ -12,6 +12,9 @@
|
||||||
instead.
|
instead.
|
||||||
* `DrmInitData.get(UUID)`. Use `DrmInitData.get(int)` and
|
* `DrmInitData.get(UUID)`. Use `DrmInitData.get(int)` and
|
||||||
`DrmInitData.SchemeData.matches(UUID)` instead.
|
`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.setMinLoadableRetryCount(int)`. Use
|
||||||
`ExtractorsMediaSource.Factory.setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy)`
|
`ExtractorsMediaSource.Factory.setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy)`
|
||||||
instead.
|
instead.
|
||||||
|
|
|
||||||
|
|
@ -17,59 +17,16 @@ package com.google.android.exoplayer2.trackselection;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.C;
|
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.TrackGroup;
|
||||||
import com.google.android.exoplayer2.source.chunk.MediaChunk;
|
import com.google.android.exoplayer2.source.chunk.MediaChunk;
|
||||||
import com.google.android.exoplayer2.source.chunk.MediaChunkIterator;
|
import com.google.android.exoplayer2.source.chunk.MediaChunkIterator;
|
||||||
import com.google.android.exoplayer2.upstream.BandwidthMeter;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.checkerframework.checker.nullness.compatqual.NullableType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link TrackSelection} consisting of a single track.
|
* A {@link TrackSelection} consisting of a single track.
|
||||||
*/
|
*/
|
||||||
public final class FixedTrackSelection extends BaseTrackSelection {
|
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;
|
private final int reason;
|
||||||
@Nullable private final Object data;
|
@Nullable private final Object data;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue