mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Move PriorityTaskManager from DefaultLoadControl to SimpleExoPlayer.
The priority task manager only needs to listen to loading state changes and is independent of the rest of DefaultLoadControl. This also fixes problems where the player stops loading without consultin the LoadControl. PiperOrigin-RevId: 242098374
This commit is contained in:
parent
d6244773ec
commit
346c72c00e
5 changed files with 57 additions and 76 deletions
|
|
@ -99,6 +99,7 @@
|
||||||
* Handle meta atom as a full box when parsing mp4
|
* Handle meta atom as a full box when parsing mp4
|
||||||
([#5698](https://github.com/google/ExoPlayer/issues/5698),
|
([#5698](https://github.com/google/ExoPlayer/issues/5698),
|
||||||
[#5694](https://github.com/google/ExoPlayer/issues/5694)).
|
[#5694](https://github.com/google/ExoPlayer/issues/5694)).
|
||||||
|
* Move `PriorityTaskManager` from `DefaultLoadControl` to `SimpleExoPlayer`.
|
||||||
|
|
||||||
### 2.9.6 ###
|
### 2.9.6 ###
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
|
||||||
import com.google.android.exoplayer2.upstream.Allocator;
|
import com.google.android.exoplayer2.upstream.Allocator;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultAllocator;
|
import com.google.android.exoplayer2.upstream.DefaultAllocator;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.PriorityTaskManager;
|
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -76,21 +75,18 @@ public class DefaultLoadControl implements LoadControl {
|
||||||
private int bufferForPlaybackAfterRebufferMs;
|
private int bufferForPlaybackAfterRebufferMs;
|
||||||
private int targetBufferBytes;
|
private int targetBufferBytes;
|
||||||
private boolean prioritizeTimeOverSizeThresholds;
|
private boolean prioritizeTimeOverSizeThresholds;
|
||||||
private PriorityTaskManager priorityTaskManager;
|
|
||||||
private int backBufferDurationMs;
|
private int backBufferDurationMs;
|
||||||
private boolean retainBackBufferFromKeyframe;
|
private boolean retainBackBufferFromKeyframe;
|
||||||
private boolean createDefaultLoadControlCalled;
|
private boolean createDefaultLoadControlCalled;
|
||||||
|
|
||||||
/** Constructs a new instance. */
|
/** Constructs a new instance. */
|
||||||
public Builder() {
|
public Builder() {
|
||||||
allocator = null;
|
|
||||||
minBufferMs = DEFAULT_MIN_BUFFER_MS;
|
minBufferMs = DEFAULT_MIN_BUFFER_MS;
|
||||||
maxBufferMs = DEFAULT_MAX_BUFFER_MS;
|
maxBufferMs = DEFAULT_MAX_BUFFER_MS;
|
||||||
bufferForPlaybackMs = DEFAULT_BUFFER_FOR_PLAYBACK_MS;
|
bufferForPlaybackMs = DEFAULT_BUFFER_FOR_PLAYBACK_MS;
|
||||||
bufferForPlaybackAfterRebufferMs = DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS;
|
bufferForPlaybackAfterRebufferMs = DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS;
|
||||||
targetBufferBytes = DEFAULT_TARGET_BUFFER_BYTES;
|
targetBufferBytes = DEFAULT_TARGET_BUFFER_BYTES;
|
||||||
prioritizeTimeOverSizeThresholds = DEFAULT_PRIORITIZE_TIME_OVER_SIZE_THRESHOLDS;
|
prioritizeTimeOverSizeThresholds = DEFAULT_PRIORITIZE_TIME_OVER_SIZE_THRESHOLDS;
|
||||||
priorityTaskManager = null;
|
|
||||||
backBufferDurationMs = DEFAULT_BACK_BUFFER_DURATION_MS;
|
backBufferDurationMs = DEFAULT_BACK_BUFFER_DURATION_MS;
|
||||||
retainBackBufferFromKeyframe = DEFAULT_RETAIN_BACK_BUFFER_FROM_KEYFRAME;
|
retainBackBufferFromKeyframe = DEFAULT_RETAIN_BACK_BUFFER_FROM_KEYFRAME;
|
||||||
}
|
}
|
||||||
|
|
@ -165,19 +161,6 @@ public class DefaultLoadControl implements LoadControl {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the {@link PriorityTaskManager} to use.
|
|
||||||
*
|
|
||||||
* @param priorityTaskManager The {@link PriorityTaskManager} to use.
|
|
||||||
* @return This builder, for convenience.
|
|
||||||
* @throws IllegalStateException If {@link #createDefaultLoadControl()} has already been called.
|
|
||||||
*/
|
|
||||||
public Builder setPriorityTaskManager(PriorityTaskManager priorityTaskManager) {
|
|
||||||
Assertions.checkState(!createDefaultLoadControlCalled);
|
|
||||||
this.priorityTaskManager = priorityTaskManager;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the back buffer duration, and whether the back buffer is retained from the previous
|
* Sets the back buffer duration, and whether the back buffer is retained from the previous
|
||||||
* keyframe.
|
* keyframe.
|
||||||
|
|
@ -210,7 +193,6 @@ public class DefaultLoadControl implements LoadControl {
|
||||||
bufferForPlaybackAfterRebufferMs,
|
bufferForPlaybackAfterRebufferMs,
|
||||||
targetBufferBytes,
|
targetBufferBytes,
|
||||||
prioritizeTimeOverSizeThresholds,
|
prioritizeTimeOverSizeThresholds,
|
||||||
priorityTaskManager,
|
|
||||||
backBufferDurationMs,
|
backBufferDurationMs,
|
||||||
retainBackBufferFromKeyframe);
|
retainBackBufferFromKeyframe);
|
||||||
}
|
}
|
||||||
|
|
@ -224,7 +206,6 @@ public class DefaultLoadControl implements LoadControl {
|
||||||
private final long bufferForPlaybackAfterRebufferUs;
|
private final long bufferForPlaybackAfterRebufferUs;
|
||||||
private final int targetBufferBytesOverwrite;
|
private final int targetBufferBytesOverwrite;
|
||||||
private final boolean prioritizeTimeOverSizeThresholds;
|
private final boolean prioritizeTimeOverSizeThresholds;
|
||||||
private final PriorityTaskManager priorityTaskManager;
|
|
||||||
private final long backBufferDurationUs;
|
private final long backBufferDurationUs;
|
||||||
private final boolean retainBackBufferFromKeyframe;
|
private final boolean retainBackBufferFromKeyframe;
|
||||||
|
|
||||||
|
|
@ -253,7 +234,6 @@ public class DefaultLoadControl implements LoadControl {
|
||||||
|
|
||||||
/** @deprecated Use {@link Builder} instead. */
|
/** @deprecated Use {@link Builder} instead. */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public DefaultLoadControl(
|
public DefaultLoadControl(
|
||||||
DefaultAllocator allocator,
|
DefaultAllocator allocator,
|
||||||
int minBufferMs,
|
int minBufferMs,
|
||||||
|
|
@ -270,29 +250,6 @@ public class DefaultLoadControl implements LoadControl {
|
||||||
bufferForPlaybackAfterRebufferMs,
|
bufferForPlaybackAfterRebufferMs,
|
||||||
targetBufferBytes,
|
targetBufferBytes,
|
||||||
prioritizeTimeOverSizeThresholds,
|
prioritizeTimeOverSizeThresholds,
|
||||||
/* priorityTaskManager= */ null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @deprecated Use {@link Builder} instead. */
|
|
||||||
@Deprecated
|
|
||||||
public DefaultLoadControl(
|
|
||||||
DefaultAllocator allocator,
|
|
||||||
int minBufferMs,
|
|
||||||
int maxBufferMs,
|
|
||||||
int bufferForPlaybackMs,
|
|
||||||
int bufferForPlaybackAfterRebufferMs,
|
|
||||||
int targetBufferBytes,
|
|
||||||
boolean prioritizeTimeOverSizeThresholds,
|
|
||||||
PriorityTaskManager priorityTaskManager) {
|
|
||||||
this(
|
|
||||||
allocator,
|
|
||||||
minBufferMs,
|
|
||||||
maxBufferMs,
|
|
||||||
bufferForPlaybackMs,
|
|
||||||
bufferForPlaybackAfterRebufferMs,
|
|
||||||
targetBufferBytes,
|
|
||||||
prioritizeTimeOverSizeThresholds,
|
|
||||||
priorityTaskManager,
|
|
||||||
DEFAULT_BACK_BUFFER_DURATION_MS,
|
DEFAULT_BACK_BUFFER_DURATION_MS,
|
||||||
DEFAULT_RETAIN_BACK_BUFFER_FROM_KEYFRAME);
|
DEFAULT_RETAIN_BACK_BUFFER_FROM_KEYFRAME);
|
||||||
}
|
}
|
||||||
|
|
@ -305,7 +262,6 @@ public class DefaultLoadControl implements LoadControl {
|
||||||
int bufferForPlaybackAfterRebufferMs,
|
int bufferForPlaybackAfterRebufferMs,
|
||||||
int targetBufferBytes,
|
int targetBufferBytes,
|
||||||
boolean prioritizeTimeOverSizeThresholds,
|
boolean prioritizeTimeOverSizeThresholds,
|
||||||
PriorityTaskManager priorityTaskManager,
|
|
||||||
int backBufferDurationMs,
|
int backBufferDurationMs,
|
||||||
boolean retainBackBufferFromKeyframe) {
|
boolean retainBackBufferFromKeyframe) {
|
||||||
assertGreaterOrEqual(bufferForPlaybackMs, 0, "bufferForPlaybackMs", "0");
|
assertGreaterOrEqual(bufferForPlaybackMs, 0, "bufferForPlaybackMs", "0");
|
||||||
|
|
@ -327,7 +283,6 @@ public class DefaultLoadControl implements LoadControl {
|
||||||
this.bufferForPlaybackAfterRebufferUs = C.msToUs(bufferForPlaybackAfterRebufferMs);
|
this.bufferForPlaybackAfterRebufferUs = C.msToUs(bufferForPlaybackAfterRebufferMs);
|
||||||
this.targetBufferBytesOverwrite = targetBufferBytes;
|
this.targetBufferBytesOverwrite = targetBufferBytes;
|
||||||
this.prioritizeTimeOverSizeThresholds = prioritizeTimeOverSizeThresholds;
|
this.prioritizeTimeOverSizeThresholds = prioritizeTimeOverSizeThresholds;
|
||||||
this.priorityTaskManager = priorityTaskManager;
|
|
||||||
this.backBufferDurationUs = C.msToUs(backBufferDurationMs);
|
this.backBufferDurationUs = C.msToUs(backBufferDurationMs);
|
||||||
this.retainBackBufferFromKeyframe = retainBackBufferFromKeyframe;
|
this.retainBackBufferFromKeyframe = retainBackBufferFromKeyframe;
|
||||||
}
|
}
|
||||||
|
|
@ -375,7 +330,6 @@ public class DefaultLoadControl implements LoadControl {
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldContinueLoading(long bufferedDurationUs, float playbackSpeed) {
|
public boolean shouldContinueLoading(long bufferedDurationUs, float playbackSpeed) {
|
||||||
boolean targetBufferSizeReached = allocator.getTotalBytesAllocated() >= targetBufferSize;
|
boolean targetBufferSizeReached = allocator.getTotalBytesAllocated() >= targetBufferSize;
|
||||||
boolean wasBuffering = isBuffering;
|
|
||||||
long minBufferUs = this.minBufferUs;
|
long minBufferUs = this.minBufferUs;
|
||||||
if (playbackSpeed > 1) {
|
if (playbackSpeed > 1) {
|
||||||
// The playback speed is faster than real time, so scale up the minimum required media
|
// The playback speed is faster than real time, so scale up the minimum required media
|
||||||
|
|
@ -389,13 +343,6 @@ public class DefaultLoadControl implements LoadControl {
|
||||||
} else if (bufferedDurationUs >= maxBufferUs || targetBufferSizeReached) {
|
} else if (bufferedDurationUs >= maxBufferUs || targetBufferSizeReached) {
|
||||||
isBuffering = false;
|
isBuffering = false;
|
||||||
} // Else don't change the buffering state
|
} // Else don't change the buffering state
|
||||||
if (priorityTaskManager != null && isBuffering != wasBuffering) {
|
|
||||||
if (isBuffering) {
|
|
||||||
priorityTaskManager.add(C.PRIORITY_PLAYBACK);
|
|
||||||
} else {
|
|
||||||
priorityTaskManager.remove(C.PRIORITY_PLAYBACK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return isBuffering;
|
return isBuffering;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -431,9 +378,6 @@ public class DefaultLoadControl implements LoadControl {
|
||||||
|
|
||||||
private void reset(boolean resetAllocator) {
|
private void reset(boolean resetAllocator) {
|
||||||
targetBufferSize = 0;
|
targetBufferSize = 0;
|
||||||
if (priorityTaskManager != null && isBuffering) {
|
|
||||||
priorityTaskManager.remove(C.PRIORITY_PLAYBACK);
|
|
||||||
}
|
|
||||||
isBuffering = false;
|
isBuffering = false;
|
||||||
if (resetAllocator) {
|
if (resetAllocator) {
|
||||||
allocator.reset();
|
allocator.reset();
|
||||||
|
|
|
||||||
|
|
@ -401,6 +401,11 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
mediaSource = null;
|
mediaSource = null;
|
||||||
internalPlayer.release();
|
internalPlayer.release();
|
||||||
eventHandler.removeCallbacksAndMessages(null);
|
eventHandler.removeCallbacksAndMessages(null);
|
||||||
|
playbackInfo =
|
||||||
|
getResetPlaybackInfo(
|
||||||
|
/* resetPosition= */ true,
|
||||||
|
/* resetState= */ true,
|
||||||
|
/* playbackState= */ Player.STATE_IDLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,10 @@ import com.google.android.exoplayer2.text.TextOutput;
|
||||||
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.upstream.BandwidthMeter;
|
import com.google.android.exoplayer2.upstream.BandwidthMeter;
|
||||||
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Clock;
|
import com.google.android.exoplayer2.util.Clock;
|
||||||
import com.google.android.exoplayer2.util.Log;
|
import com.google.android.exoplayer2.util.Log;
|
||||||
|
import com.google.android.exoplayer2.util.PriorityTaskManager;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.android.exoplayer2.video.VideoFrameMetadataListener;
|
import com.google.android.exoplayer2.video.VideoFrameMetadataListener;
|
||||||
import com.google.android.exoplayer2.video.VideoRendererEventListener;
|
import com.google.android.exoplayer2.video.VideoRendererEventListener;
|
||||||
|
|
@ -113,6 +115,8 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
@Nullable private VideoFrameMetadataListener videoFrameMetadataListener;
|
@Nullable private VideoFrameMetadataListener videoFrameMetadataListener;
|
||||||
@Nullable private CameraMotionListener cameraMotionListener;
|
@Nullable private CameraMotionListener cameraMotionListener;
|
||||||
private boolean hasNotifiedFullWrongThreadWarning;
|
private boolean hasNotifiedFullWrongThreadWarning;
|
||||||
|
@Nullable private PriorityTaskManager priorityTaskManager;
|
||||||
|
private boolean isPriorityTaskManagerRegistered;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param context A {@link Context}.
|
* @param context A {@link Context}.
|
||||||
|
|
@ -233,6 +237,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
new ExoPlayerImpl(renderers, trackSelector, loadControl, bandwidthMeter, clock, looper);
|
new ExoPlayerImpl(renderers, trackSelector, loadControl, bandwidthMeter, clock, looper);
|
||||||
analyticsCollector = analyticsCollectorFactory.createAnalyticsCollector(player, clock);
|
analyticsCollector = analyticsCollectorFactory.createAnalyticsCollector(player, clock);
|
||||||
addListener(analyticsCollector);
|
addListener(analyticsCollector);
|
||||||
|
addListener(componentListener);
|
||||||
videoDebugListeners.add(analyticsCollector);
|
videoDebugListeners.add(analyticsCollector);
|
||||||
videoListeners.add(analyticsCollector);
|
videoListeners.add(analyticsCollector);
|
||||||
audioDebugListeners.add(analyticsCollector);
|
audioDebugListeners.add(analyticsCollector);
|
||||||
|
|
@ -538,6 +543,31 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
analyticsCollector.removeListener(listener);
|
analyticsCollector.removeListener(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a {@link PriorityTaskManager}, or null to clear a previously set priority task manager.
|
||||||
|
*
|
||||||
|
* <p>The priority {@link C#PRIORITY_PLAYBACK} will be set while the player is loading.
|
||||||
|
*
|
||||||
|
* @param priorityTaskManager The {@link PriorityTaskManager}, or null to clear a previously set
|
||||||
|
* priority task manager.
|
||||||
|
*/
|
||||||
|
public void setPriorityTaskManager(@Nullable PriorityTaskManager priorityTaskManager) {
|
||||||
|
verifyApplicationThread();
|
||||||
|
if (Util.areEqual(this.priorityTaskManager, priorityTaskManager)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isPriorityTaskManagerRegistered) {
|
||||||
|
Assertions.checkNotNull(this.priorityTaskManager).remove(C.PRIORITY_PLAYBACK);
|
||||||
|
}
|
||||||
|
if (priorityTaskManager != null && isLoading()) {
|
||||||
|
priorityTaskManager.add(C.PRIORITY_PLAYBACK);
|
||||||
|
isPriorityTaskManagerRegistered = true;
|
||||||
|
} else {
|
||||||
|
isPriorityTaskManagerRegistered = false;
|
||||||
|
}
|
||||||
|
this.priorityTaskManager = priorityTaskManager;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the {@link PlaybackParams} governing audio playback.
|
* Sets the {@link PlaybackParams} governing audio playback.
|
||||||
*
|
*
|
||||||
|
|
@ -994,6 +1024,10 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
mediaSource.removeEventListener(analyticsCollector);
|
mediaSource.removeEventListener(analyticsCollector);
|
||||||
mediaSource = null;
|
mediaSource = null;
|
||||||
}
|
}
|
||||||
|
if (isPriorityTaskManagerRegistered) {
|
||||||
|
Assertions.checkNotNull(priorityTaskManager).remove(C.PRIORITY_PLAYBACK);
|
||||||
|
isPriorityTaskManagerRegistered = false;
|
||||||
|
}
|
||||||
bandwidthMeter.removeEventListener(analyticsCollector);
|
bandwidthMeter.removeEventListener(analyticsCollector);
|
||||||
currentCues = Collections.emptyList();
|
currentCues = Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
@ -1211,7 +1245,8 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
MetadataOutput,
|
MetadataOutput,
|
||||||
SurfaceHolder.Callback,
|
SurfaceHolder.Callback,
|
||||||
TextureView.SurfaceTextureListener,
|
TextureView.SurfaceTextureListener,
|
||||||
AudioFocusManager.PlayerControl {
|
AudioFocusManager.PlayerControl,
|
||||||
|
Player.EventListener {
|
||||||
|
|
||||||
// VideoRendererEventListener implementation
|
// VideoRendererEventListener implementation
|
||||||
|
|
||||||
|
|
@ -1421,5 +1456,20 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
public void executePlayerCommand(@AudioFocusManager.PlayerCommand int playerCommand) {
|
public void executePlayerCommand(@AudioFocusManager.PlayerCommand int playerCommand) {
|
||||||
updatePlayWhenReady(getPlayWhenReady(), playerCommand);
|
updatePlayWhenReady(getPlayWhenReady(), playerCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Player.EventListener implementation.
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadingChanged(boolean isLoading) {
|
||||||
|
if (priorityTaskManager != null) {
|
||||||
|
if (isLoading && !isPriorityTaskManagerRegistered) {
|
||||||
|
priorityTaskManager.add(C.PRIORITY_PLAYBACK);
|
||||||
|
isPriorityTaskManagerRegistered = true;
|
||||||
|
} else if (!isLoading && isPriorityTaskManagerRegistered) {
|
||||||
|
priorityTaskManager.remove(C.PRIORITY_PLAYBACK);
|
||||||
|
isPriorityTaskManagerRegistered = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import com.google.android.exoplayer2.upstream.BandwidthMeter;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultAllocator;
|
import com.google.android.exoplayer2.upstream.DefaultAllocator;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Clock;
|
import com.google.android.exoplayer2.util.Clock;
|
||||||
import com.google.android.exoplayer2.util.PriorityTaskManager;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.checkerframework.checker.nullness.compatqual.NullableType;
|
import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||||
|
|
||||||
|
|
@ -112,7 +111,6 @@ public final class BufferSizeAdaptationBuilder {
|
||||||
private int hysteresisBufferMs;
|
private int hysteresisBufferMs;
|
||||||
private float startUpBandwidthFraction;
|
private float startUpBandwidthFraction;
|
||||||
private int startUpMinBufferForQualityIncreaseMs;
|
private int startUpMinBufferForQualityIncreaseMs;
|
||||||
@Nullable private PriorityTaskManager priorityTaskManager;
|
|
||||||
private DynamicFormatFilter dynamicFormatFilter;
|
private DynamicFormatFilter dynamicFormatFilter;
|
||||||
private boolean buildCalled;
|
private boolean buildCalled;
|
||||||
|
|
||||||
|
|
@ -219,20 +217,6 @@ public final class BufferSizeAdaptationBuilder {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the {@link PriorityTaskManager} to use.
|
|
||||||
*
|
|
||||||
* @param priorityTaskManager The {@link PriorityTaskManager}.
|
|
||||||
* @return This builder, for convenience.
|
|
||||||
* @throws IllegalStateException If {@link #buildPlayerComponents()} has already been called.
|
|
||||||
*/
|
|
||||||
public BufferSizeAdaptationBuilder setPriorityTaskManager(
|
|
||||||
PriorityTaskManager priorityTaskManager) {
|
|
||||||
Assertions.checkState(!buildCalled);
|
|
||||||
this.priorityTaskManager = priorityTaskManager;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the {@link DynamicFormatFilter} to use when updating the selected track.
|
* Sets the {@link DynamicFormatFilter} to use when updating the selected track.
|
||||||
*
|
*
|
||||||
|
|
@ -266,9 +250,6 @@ public final class BufferSizeAdaptationBuilder {
|
||||||
maxBufferMs,
|
maxBufferMs,
|
||||||
bufferForPlaybackMs,
|
bufferForPlaybackMs,
|
||||||
bufferForPlaybackAfterRebufferMs);
|
bufferForPlaybackAfterRebufferMs);
|
||||||
if (priorityTaskManager != null) {
|
|
||||||
loadControlBuilder.setPriorityTaskManager(priorityTaskManager);
|
|
||||||
}
|
|
||||||
if (allocator != null) {
|
if (allocator != null) {
|
||||||
loadControlBuilder.setAllocator(allocator);
|
loadControlBuilder.setAllocator(allocator);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue