Make tests use DefaultTrackSelector
Issue: #3915 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=192259167
This commit is contained in:
parent
986095a4a3
commit
3568dca3b1
@ -50,6 +50,7 @@ import com.google.android.exoplayer2.testutil.ExoHostedTest;
|
|||||||
import com.google.android.exoplayer2.testutil.HostActivity;
|
import com.google.android.exoplayer2.testutil.HostActivity;
|
||||||
import com.google.android.exoplayer2.testutil.HostActivity.HostedTest;
|
import com.google.android.exoplayer2.testutil.HostActivity.HostedTest;
|
||||||
import com.google.android.exoplayer2.testutil.MetricsLogger;
|
import com.google.android.exoplayer2.testutil.MetricsLogger;
|
||||||
|
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||||
import com.google.android.exoplayer2.trackselection.FixedTrackSelection;
|
import com.google.android.exoplayer2.trackselection.FixedTrackSelection;
|
||||||
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
||||||
import com.google.android.exoplayer2.trackselection.RandomTrackSelection;
|
import com.google.android.exoplayer2.trackselection.RandomTrackSelection;
|
||||||
@ -264,8 +265,8 @@ public final class DashTestRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected MappingTrackSelector buildTrackSelector(HostActivity host,
|
protected DefaultTrackSelector buildTrackSelector(
|
||||||
BandwidthMeter bandwidthMeter) {
|
HostActivity host, BandwidthMeter bandwidthMeter) {
|
||||||
return trackSelector;
|
return trackSelector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,7 +376,7 @@ public final class DashTestRunner {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class DashTestTrackSelector extends MappingTrackSelector {
|
private static final class DashTestTrackSelector extends DefaultTrackSelector {
|
||||||
|
|
||||||
private final String tag;
|
private final String tag;
|
||||||
private final String audioFormatId;
|
private final String audioFormatId;
|
||||||
|
@ -32,7 +32,7 @@ import com.google.android.exoplayer2.source.MediaSource;
|
|||||||
import com.google.android.exoplayer2.testutil.ActionSchedule.ActionNode;
|
import com.google.android.exoplayer2.testutil.ActionSchedule.ActionNode;
|
||||||
import com.google.android.exoplayer2.testutil.ActionSchedule.PlayerRunnable;
|
import com.google.android.exoplayer2.testutil.ActionSchedule.PlayerRunnable;
|
||||||
import com.google.android.exoplayer2.testutil.ActionSchedule.PlayerTarget;
|
import com.google.android.exoplayer2.testutil.ActionSchedule.PlayerTarget;
|
||||||
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||||
import com.google.android.exoplayer2.util.HandlerWrapper;
|
import com.google.android.exoplayer2.util.HandlerWrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,7 +64,7 @@ public abstract class Action {
|
|||||||
*/
|
*/
|
||||||
public final void doActionAndScheduleNext(
|
public final void doActionAndScheduleNext(
|
||||||
SimpleExoPlayer player,
|
SimpleExoPlayer player,
|
||||||
MappingTrackSelector trackSelector,
|
DefaultTrackSelector trackSelector,
|
||||||
Surface surface,
|
Surface surface,
|
||||||
HandlerWrapper handler,
|
HandlerWrapper handler,
|
||||||
ActionNode nextAction) {
|
ActionNode nextAction) {
|
||||||
@ -75,7 +75,7 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by {@link #doActionAndScheduleNext(SimpleExoPlayer, MappingTrackSelector, Surface,
|
* Called by {@link #doActionAndScheduleNext(SimpleExoPlayer, DefaultTrackSelector, Surface,
|
||||||
* HandlerWrapper, ActionNode)} to perform the action and to schedule the next action node.
|
* HandlerWrapper, ActionNode)} to perform the action and to schedule the next action node.
|
||||||
*
|
*
|
||||||
* @param player The player to which the action should be applied.
|
* @param player The player to which the action should be applied.
|
||||||
@ -86,7 +86,7 @@ public abstract class Action {
|
|||||||
*/
|
*/
|
||||||
protected void doActionAndScheduleNextImpl(
|
protected void doActionAndScheduleNextImpl(
|
||||||
SimpleExoPlayer player,
|
SimpleExoPlayer player,
|
||||||
MappingTrackSelector trackSelector,
|
DefaultTrackSelector trackSelector,
|
||||||
Surface surface,
|
Surface surface,
|
||||||
HandlerWrapper handler,
|
HandlerWrapper handler,
|
||||||
ActionNode nextAction) {
|
ActionNode nextAction) {
|
||||||
@ -97,7 +97,7 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by {@link #doActionAndScheduleNextImpl(SimpleExoPlayer, MappingTrackSelector, Surface,
|
* Called by {@link #doActionAndScheduleNextImpl(SimpleExoPlayer, DefaultTrackSelector, Surface,
|
||||||
* HandlerWrapper, ActionNode)} to perform the action.
|
* HandlerWrapper, ActionNode)} to perform the action.
|
||||||
*
|
*
|
||||||
* @param player The player to which the action should be applied.
|
* @param player The player to which the action should be applied.
|
||||||
@ -105,7 +105,7 @@ public abstract class Action {
|
|||||||
* @param surface The surface to use when applying actions.
|
* @param surface The surface to use when applying actions.
|
||||||
*/
|
*/
|
||||||
protected abstract void doActionImpl(
|
protected abstract void doActionImpl(
|
||||||
SimpleExoPlayer player, MappingTrackSelector trackSelector, Surface surface);
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calls {@link Player#seekTo(long)} or {@link Player#seekTo(int, long)}.
|
* Calls {@link Player#seekTo(long)} or {@link Player#seekTo(int, long)}.
|
||||||
@ -141,8 +141,8 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
if (windowIndex == null) {
|
if (windowIndex == null) {
|
||||||
player.seekTo(positionMs);
|
player.seekTo(positionMs);
|
||||||
} else {
|
} else {
|
||||||
@ -183,8 +183,8 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
if (reset == null) {
|
if (reset == null) {
|
||||||
player.stop();
|
player.stop();
|
||||||
} else {
|
} else {
|
||||||
@ -212,16 +212,14 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
player.setPlayWhenReady(playWhenReady);
|
player.setPlayWhenReady(playWhenReady);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Calls {@link DefaultTrackSelector#setRendererDisabled(int, boolean)}. */
|
||||||
* Calls {@link MappingTrackSelector#setRendererDisabled(int, boolean)}.
|
|
||||||
*/
|
|
||||||
public static final class SetRendererDisabled extends Action {
|
public static final class SetRendererDisabled extends Action {
|
||||||
|
|
||||||
private final int rendererIndex;
|
private final int rendererIndex;
|
||||||
@ -239,8 +237,8 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
trackSelector.setRendererDisabled(rendererIndex, disabled);
|
trackSelector.setRendererDisabled(rendererIndex, disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,8 +257,8 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
player.clearVideoSurface();
|
player.clearVideoSurface();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,8 +277,8 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
player.setVideoSurface(surface);
|
player.setVideoSurface(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,8 +312,8 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
player.prepare(mediaSource, resetPosition, resetState);
|
player.prepare(mediaSource, resetPosition, resetState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,8 +335,8 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
player.setRepeatMode(repeatMode);
|
player.setRepeatMode(repeatMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,8 +358,8 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
player.setShuffleModeEnabled(shuffleModeEnabled);
|
player.setShuffleModeEnabled(shuffleModeEnabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -407,7 +405,7 @@ public abstract class Action {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(
|
protected void doActionImpl(
|
||||||
final SimpleExoPlayer player, MappingTrackSelector trackSelector, Surface surface) {
|
final SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
if (target instanceof PlayerTarget) {
|
if (target instanceof PlayerTarget) {
|
||||||
((PlayerTarget) target).setPlayer(player);
|
((PlayerTarget) target).setPlayer(player);
|
||||||
}
|
}
|
||||||
@ -440,8 +438,8 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
player.setPlaybackParameters(playbackParameters);
|
player.setPlaybackParameters(playbackParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,7 +461,7 @@ public abstract class Action {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(
|
protected void doActionImpl(
|
||||||
SimpleExoPlayer player, MappingTrackSelector trackSelector, Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
player
|
player
|
||||||
.createMessage(
|
.createMessage(
|
||||||
new Target() {
|
new Target() {
|
||||||
@ -500,7 +498,7 @@ public abstract class Action {
|
|||||||
@Override
|
@Override
|
||||||
protected void doActionAndScheduleNextImpl(
|
protected void doActionAndScheduleNextImpl(
|
||||||
final SimpleExoPlayer player,
|
final SimpleExoPlayer player,
|
||||||
final MappingTrackSelector trackSelector,
|
final DefaultTrackSelector trackSelector,
|
||||||
final Surface surface,
|
final Surface surface,
|
||||||
final HandlerWrapper handler,
|
final HandlerWrapper handler,
|
||||||
final ActionNode nextAction) {
|
final ActionNode nextAction) {
|
||||||
@ -534,7 +532,7 @@ public abstract class Action {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(
|
protected void doActionImpl(
|
||||||
SimpleExoPlayer player, MappingTrackSelector trackSelector, Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
// Not triggered.
|
// Not triggered.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -561,7 +559,7 @@ public abstract class Action {
|
|||||||
@Override
|
@Override
|
||||||
protected void doActionAndScheduleNextImpl(
|
protected void doActionAndScheduleNextImpl(
|
||||||
final SimpleExoPlayer player,
|
final SimpleExoPlayer player,
|
||||||
final MappingTrackSelector trackSelector,
|
final DefaultTrackSelector trackSelector,
|
||||||
final Surface surface,
|
final Surface surface,
|
||||||
final HandlerWrapper handler,
|
final HandlerWrapper handler,
|
||||||
final ActionNode nextAction) {
|
final ActionNode nextAction) {
|
||||||
@ -587,11 +585,10 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
// Not triggered.
|
// Not triggered.
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -609,7 +606,7 @@ public abstract class Action {
|
|||||||
@Override
|
@Override
|
||||||
protected void doActionAndScheduleNextImpl(
|
protected void doActionAndScheduleNextImpl(
|
||||||
final SimpleExoPlayer player,
|
final SimpleExoPlayer player,
|
||||||
final MappingTrackSelector trackSelector,
|
final DefaultTrackSelector trackSelector,
|
||||||
final Surface surface,
|
final Surface surface,
|
||||||
final HandlerWrapper handler,
|
final HandlerWrapper handler,
|
||||||
final ActionNode nextAction) {
|
final ActionNode nextAction) {
|
||||||
@ -626,11 +623,10 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
// Not triggered.
|
// Not triggered.
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -652,7 +648,7 @@ public abstract class Action {
|
|||||||
@Override
|
@Override
|
||||||
protected void doActionAndScheduleNextImpl(
|
protected void doActionAndScheduleNextImpl(
|
||||||
final SimpleExoPlayer player,
|
final SimpleExoPlayer player,
|
||||||
final MappingTrackSelector trackSelector,
|
final DefaultTrackSelector trackSelector,
|
||||||
final Surface surface,
|
final Surface surface,
|
||||||
final HandlerWrapper handler,
|
final HandlerWrapper handler,
|
||||||
final ActionNode nextAction) {
|
final ActionNode nextAction) {
|
||||||
@ -675,11 +671,10 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
// Not triggered.
|
// Not triggered.
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -697,7 +692,7 @@ public abstract class Action {
|
|||||||
@Override
|
@Override
|
||||||
protected void doActionAndScheduleNextImpl(
|
protected void doActionAndScheduleNextImpl(
|
||||||
final SimpleExoPlayer player,
|
final SimpleExoPlayer player,
|
||||||
final MappingTrackSelector trackSelector,
|
final DefaultTrackSelector trackSelector,
|
||||||
final Surface surface,
|
final Surface surface,
|
||||||
final HandlerWrapper handler,
|
final HandlerWrapper handler,
|
||||||
final ActionNode nextAction) {
|
final ActionNode nextAction) {
|
||||||
@ -714,11 +709,10 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
// Not triggered.
|
// Not triggered.
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -737,8 +731,8 @@ public abstract class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
if (runnable instanceof PlayerRunnable) {
|
if (runnable instanceof PlayerRunnable) {
|
||||||
((PlayerRunnable) runnable).setPlayer(player);
|
((PlayerRunnable) runnable).setPlayer(player);
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ import com.google.android.exoplayer2.testutil.Action.WaitForPlaybackState;
|
|||||||
import com.google.android.exoplayer2.testutil.Action.WaitForPositionDiscontinuity;
|
import com.google.android.exoplayer2.testutil.Action.WaitForPositionDiscontinuity;
|
||||||
import com.google.android.exoplayer2.testutil.Action.WaitForSeekProcessed;
|
import com.google.android.exoplayer2.testutil.Action.WaitForSeekProcessed;
|
||||||
import com.google.android.exoplayer2.testutil.Action.WaitForTimelineChanged;
|
import com.google.android.exoplayer2.testutil.Action.WaitForTimelineChanged;
|
||||||
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.HandlerWrapper;
|
import com.google.android.exoplayer2.util.HandlerWrapper;
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ public final class ActionSchedule {
|
|||||||
*/
|
*/
|
||||||
/* package */ void start(
|
/* package */ void start(
|
||||||
SimpleExoPlayer player,
|
SimpleExoPlayer player,
|
||||||
MappingTrackSelector trackSelector,
|
DefaultTrackSelector trackSelector,
|
||||||
Surface surface,
|
Surface surface,
|
||||||
HandlerWrapper mainHandler,
|
HandlerWrapper mainHandler,
|
||||||
@Nullable Callback callback) {
|
@Nullable Callback callback) {
|
||||||
@ -494,7 +494,7 @@ public final class ActionSchedule {
|
|||||||
private ActionNode next;
|
private ActionNode next;
|
||||||
|
|
||||||
private SimpleExoPlayer player;
|
private SimpleExoPlayer player;
|
||||||
private MappingTrackSelector trackSelector;
|
private DefaultTrackSelector trackSelector;
|
||||||
private Surface surface;
|
private Surface surface;
|
||||||
private HandlerWrapper mainHandler;
|
private HandlerWrapper mainHandler;
|
||||||
|
|
||||||
@ -538,7 +538,7 @@ public final class ActionSchedule {
|
|||||||
*/
|
*/
|
||||||
public void schedule(
|
public void schedule(
|
||||||
SimpleExoPlayer player,
|
SimpleExoPlayer player,
|
||||||
MappingTrackSelector trackSelector,
|
DefaultTrackSelector trackSelector,
|
||||||
Surface surface,
|
Surface surface,
|
||||||
HandlerWrapper mainHandler) {
|
HandlerWrapper mainHandler) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
@ -580,11 +580,10 @@ public final class ActionSchedule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(SimpleExoPlayer player, MappingTrackSelector trackSelector,
|
protected void doActionImpl(
|
||||||
Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -605,7 +604,7 @@ public final class ActionSchedule {
|
|||||||
@Override
|
@Override
|
||||||
protected void doActionAndScheduleNextImpl(
|
protected void doActionAndScheduleNextImpl(
|
||||||
SimpleExoPlayer player,
|
SimpleExoPlayer player,
|
||||||
MappingTrackSelector trackSelector,
|
DefaultTrackSelector trackSelector,
|
||||||
Surface surface,
|
Surface surface,
|
||||||
HandlerWrapper handler,
|
HandlerWrapper handler,
|
||||||
ActionNode nextAction) {
|
ActionNode nextAction) {
|
||||||
@ -623,10 +622,9 @@ public final class ActionSchedule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionImpl(
|
protected void doActionImpl(
|
||||||
SimpleExoPlayer player, MappingTrackSelector trackSelector, Surface surface) {
|
SimpleExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) {
|
||||||
// Not triggered.
|
// Not triggered.
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ public abstract class ExoHostedTest extends Player.DefaultEventListener implemen
|
|||||||
|
|
||||||
private ActionSchedule pendingSchedule;
|
private ActionSchedule pendingSchedule;
|
||||||
private HandlerWrapper actionHandler;
|
private HandlerWrapper actionHandler;
|
||||||
private MappingTrackSelector trackSelector;
|
private DefaultTrackSelector trackSelector;
|
||||||
private SimpleExoPlayer player;
|
private SimpleExoPlayer player;
|
||||||
private Surface surface;
|
private Surface surface;
|
||||||
private ExoPlaybackException playerError;
|
private ExoPlaybackException playerError;
|
||||||
@ -359,8 +359,8 @@ public abstract class ExoHostedTest extends Player.DefaultEventListener implemen
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
protected MappingTrackSelector buildTrackSelector(HostActivity host,
|
protected DefaultTrackSelector buildTrackSelector(
|
||||||
BandwidthMeter bandwidthMeter) {
|
HostActivity host, BandwidthMeter bandwidthMeter) {
|
||||||
return new DefaultTrackSelector(new AdaptiveTrackSelection.Factory(bandwidthMeter));
|
return new DefaultTrackSelector(new AdaptiveTrackSelection.Factory(bandwidthMeter));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@ import com.google.android.exoplayer2.source.MediaSource;
|
|||||||
import com.google.android.exoplayer2.source.TrackGroupArray;
|
import com.google.android.exoplayer2.source.TrackGroupArray;
|
||||||
import com.google.android.exoplayer2.text.TextOutput;
|
import com.google.android.exoplayer2.text.TextOutput;
|
||||||
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||||
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
|
||||||
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
|
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
|
||||||
import com.google.android.exoplayer2.trackselection.TrackSelector;
|
import com.google.android.exoplayer2.trackselection.TrackSelector;
|
||||||
import com.google.android.exoplayer2.util.Clock;
|
import com.google.android.exoplayer2.util.Clock;
|
||||||
@ -78,7 +77,7 @@ public final class ExoPlayerTestRunner extends Player.DefaultEventListener
|
|||||||
private Timeline timeline;
|
private Timeline timeline;
|
||||||
private Object manifest;
|
private Object manifest;
|
||||||
private MediaSource mediaSource;
|
private MediaSource mediaSource;
|
||||||
private MappingTrackSelector trackSelector;
|
private DefaultTrackSelector trackSelector;
|
||||||
private LoadControl loadControl;
|
private LoadControl loadControl;
|
||||||
private Format[] supportedFormats;
|
private Format[] supportedFormats;
|
||||||
private Renderer[] renderers;
|
private Renderer[] renderers;
|
||||||
@ -137,13 +136,13 @@ public final class ExoPlayerTestRunner extends Player.DefaultEventListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a {@link MappingTrackSelector} to be used by the test runner. The default value is a
|
* Sets a {@link DefaultTrackSelector} to be used by the test runner. The default value is a
|
||||||
* {@link DefaultTrackSelector}.
|
* {@link DefaultTrackSelector} in its initial configuration.
|
||||||
*
|
*
|
||||||
* @param trackSelector A {@link MappingTrackSelector} to be used by the test runner.
|
* @param trackSelector A {@link DefaultTrackSelector} to be used by the test runner.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public Builder setTrackSelector(MappingTrackSelector trackSelector) {
|
public Builder setTrackSelector(DefaultTrackSelector trackSelector) {
|
||||||
this.trackSelector = trackSelector;
|
this.trackSelector = trackSelector;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -338,7 +337,7 @@ public final class ExoPlayerTestRunner extends Player.DefaultEventListener
|
|||||||
private final Clock clock;
|
private final Clock clock;
|
||||||
private final MediaSource mediaSource;
|
private final MediaSource mediaSource;
|
||||||
private final RenderersFactory renderersFactory;
|
private final RenderersFactory renderersFactory;
|
||||||
private final MappingTrackSelector trackSelector;
|
private final DefaultTrackSelector trackSelector;
|
||||||
private final LoadControl loadControl;
|
private final LoadControl loadControl;
|
||||||
private final @Nullable ActionSchedule actionSchedule;
|
private final @Nullable ActionSchedule actionSchedule;
|
||||||
private final @Nullable Player.EventListener eventListener;
|
private final @Nullable Player.EventListener eventListener;
|
||||||
@ -364,7 +363,7 @@ public final class ExoPlayerTestRunner extends Player.DefaultEventListener
|
|||||||
Clock clock,
|
Clock clock,
|
||||||
MediaSource mediaSource,
|
MediaSource mediaSource,
|
||||||
RenderersFactory renderersFactory,
|
RenderersFactory renderersFactory,
|
||||||
MappingTrackSelector trackSelector,
|
DefaultTrackSelector trackSelector,
|
||||||
LoadControl loadControl,
|
LoadControl loadControl,
|
||||||
@Nullable ActionSchedule actionSchedule,
|
@Nullable ActionSchedule actionSchedule,
|
||||||
@Nullable Player.EventListener eventListener,
|
@Nullable Player.EventListener eventListener,
|
||||||
|
@ -20,13 +20,13 @@ import com.google.android.exoplayer2.ExoPlaybackException;
|
|||||||
import com.google.android.exoplayer2.RendererCapabilities;
|
import com.google.android.exoplayer2.RendererCapabilities;
|
||||||
import com.google.android.exoplayer2.source.TrackGroup;
|
import com.google.android.exoplayer2.source.TrackGroup;
|
||||||
import com.google.android.exoplayer2.source.TrackGroupArray;
|
import com.google.android.exoplayer2.source.TrackGroupArray;
|
||||||
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||||
import com.google.android.exoplayer2.trackselection.TrackSelection;
|
import com.google.android.exoplayer2.trackselection.TrackSelection;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/** A fake {@link MappingTrackSelector} that returns {@link FakeTrackSelection}s. */
|
/** A fake {@link DefaultTrackSelector} that returns {@link FakeTrackSelection}s. */
|
||||||
public class FakeTrackSelector extends MappingTrackSelector {
|
public class FakeTrackSelector extends DefaultTrackSelector {
|
||||||
|
|
||||||
private final List<FakeTrackSelection> selectedTrackSelections = new ArrayList<>();
|
private final List<FakeTrackSelection> selectedTrackSelections = new ArrayList<>();
|
||||||
private final boolean mayReuseTrackSelection;
|
private final boolean mayReuseTrackSelection;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user