Class FakeTrackSelector
- java.lang.Object
-
- com.google.android.exoplayer2.trackselection.TrackSelector
-
- com.google.android.exoplayer2.trackselection.MappingTrackSelector
-
- com.google.android.exoplayer2.trackselection.DefaultTrackSelector
-
- com.google.android.exoplayer2.testutil.FakeTrackSelector
-
- All Implemented Interfaces:
RendererCapabilities.Listener
public class FakeTrackSelector extends DefaultTrackSelector
A fakeMappingTrackSelector
that returnsFakeTrackSelection
s.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.android.exoplayer2.trackselection.DefaultTrackSelector
DefaultTrackSelector.Parameters, DefaultTrackSelector.ParametersBuilder, DefaultTrackSelector.SelectionEligibility, DefaultTrackSelector.SelectionOverride
-
Nested classes/interfaces inherited from class com.google.android.exoplayer2.trackselection.MappingTrackSelector
MappingTrackSelector.MappedTrackInfo
-
Nested classes/interfaces inherited from class com.google.android.exoplayer2.trackselection.TrackSelector
TrackSelector.InvalidationListener
-
-
Field Summary
-
Fields inherited from class com.google.android.exoplayer2.trackselection.DefaultTrackSelector
context, SELECTION_ELIGIBILITY_ADAPTIVE, SELECTION_ELIGIBILITY_FIXED, SELECTION_ELIGIBILITY_NO
-
-
Constructor Summary
Constructors Constructor Description FakeTrackSelector()
FakeTrackSelector(boolean mayReuseTrackSelection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<FakeTrackSelection>
getAllTrackSelections()
Returns list of allFakeTrackSelection
s that this track selector has made so far.protected @NullableType ExoTrackSelection.Definition[]
selectAllTracks(MappingTrackSelector.MappedTrackInfo mappedTrackInfo, @com.google.android.exoplayer2.RendererCapabilities.Capabilities int[][][] rendererFormatSupports, @com.google.android.exoplayer2.RendererCapabilities.AdaptiveSupport int[] rendererMixedMimeTypeAdaptationSupports, DefaultTrackSelector.Parameters params)
Called fromDefaultTrackSelector.selectTracks(MappedTrackInfo, int[][][], int[], MediaPeriodId, Timeline)
to make a track selection for each renderer, prior to overrides and disabled flags being applied.-
Methods inherited from class com.google.android.exoplayer2.trackselection.DefaultTrackSelector
buildUponParameters, getFormatLanguageScore, getParameters, getRendererCapabilitiesListener, isSetParametersSupported, isSupported, normalizeUndeterminedLanguageToNull, onRendererCapabilitiesChanged, release, selectAudioTrack, selectOtherTrack, selectTextTrack, selectTracks, selectVideoTrack, setAudioAttributes, setParameters, setParameters, setParameters
-
Methods inherited from class com.google.android.exoplayer2.trackselection.MappingTrackSelector
getCurrentMappedTrackInfo, onSelectionActivated, selectTracks
-
Methods inherited from class com.google.android.exoplayer2.trackselection.TrackSelector
getBandwidthMeter, init, invalidate, invalidateForRendererCapabilitiesChange
-
-
-
-
Constructor Detail
-
FakeTrackSelector
public FakeTrackSelector()
-
FakeTrackSelector
public FakeTrackSelector(boolean mayReuseTrackSelection)
- Parameters:
mayReuseTrackSelection
- Whether thisFakeTrackSelector
will reuseExoTrackSelection
s during track selection, when it finds previously-selected track selection using the sameTrackGroup
.
-
-
Method Detail
-
selectAllTracks
protected @NullableType ExoTrackSelection.Definition[] selectAllTracks(MappingTrackSelector.MappedTrackInfo mappedTrackInfo, @com.google.android.exoplayer2.RendererCapabilities.Capabilities int[][][] rendererFormatSupports, @com.google.android.exoplayer2.RendererCapabilities.AdaptiveSupport int[] rendererMixedMimeTypeAdaptationSupports, DefaultTrackSelector.Parameters params)
Description copied from class:DefaultTrackSelector
Called fromDefaultTrackSelector.selectTracks(MappedTrackInfo, int[][][], int[], MediaPeriodId, Timeline)
to make a track selection for each renderer, prior to overrides and disabled flags being applied.The implementation should not account for overrides and disabled flags. Track selections generated by this method will be overridden to account for these properties.
- Overrides:
selectAllTracks
in classDefaultTrackSelector
- Parameters:
mappedTrackInfo
- Mapped track information.rendererFormatSupports
- TheRendererCapabilities.Capabilities
for each mapped track, indexed by renderer, track group and track (in that order).rendererMixedMimeTypeAdaptationSupports
- TheRendererCapabilities.AdaptiveSupport
for mixed MIME type adaptation for the renderer.params
- The parameters to use for the track selection.- Returns:
- The
ExoTrackSelection.Definition
s for the renderers. A null entry indicates no selection was made.
-
getAllTrackSelections
public List<FakeTrackSelection> getAllTrackSelections()
Returns list of allFakeTrackSelection
s that this track selector has made so far.
-
-