mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove experimental method to disable stuck buffering detection.
PiperOrigin-RevId: 348462189
This commit is contained in:
parent
85d094a2b6
commit
0226543090
@ -162,7 +162,6 @@ public interface ExoPlayer extends Player {
|
||||
private LivePlaybackSpeedControl livePlaybackSpeedControl;
|
||||
private boolean buildCalled;
|
||||
|
||||
private boolean throwWhenStuckBuffering;
|
||||
private long setForegroundModeTimeoutMs;
|
||||
|
||||
/**
|
||||
@ -228,7 +227,6 @@ public interface ExoPlayer extends Player {
|
||||
seekParameters = SeekParameters.DEFAULT;
|
||||
livePlaybackSpeedControl = new DefaultLivePlaybackSpeedControl.Builder().build();
|
||||
clock = Clock.DEFAULT;
|
||||
throwWhenStuckBuffering = true;
|
||||
releaseTimeoutMs = DEFAULT_RELEASE_TIMEOUT_MS;
|
||||
}
|
||||
|
||||
@ -246,19 +244,6 @@ public interface ExoPlayer extends Player {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the player should throw when it detects it's stuck buffering.
|
||||
*
|
||||
* <p>This method is experimental, and will be renamed or removed in a future release.
|
||||
*
|
||||
* @param throwWhenStuckBuffering Whether to throw when the player detects it's stuck buffering.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder experimentalSetThrowWhenStuckBuffering(boolean throwWhenStuckBuffering) {
|
||||
this.throwWhenStuckBuffering = throwWhenStuckBuffering;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link TrackSelector} that will be used by the player.
|
||||
*
|
||||
@ -460,10 +445,6 @@ public interface ExoPlayer extends Player {
|
||||
if (setForegroundModeTimeoutMs > 0) {
|
||||
player.experimentalSetForegroundModeTimeoutMs(setForegroundModeTimeoutMs);
|
||||
}
|
||||
if (!throwWhenStuckBuffering) {
|
||||
player.experimentalDisableThrowWhenStuckBuffering();
|
||||
}
|
||||
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
@ -210,16 +210,6 @@ import java.util.concurrent.TimeoutException;
|
||||
internalPlayer.experimentalSetForegroundModeTimeoutMs(timeoutMs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures the player to not throw when it detects it's stuck buffering.
|
||||
*
|
||||
* <p>This method is experimental, and will be renamed or removed in a future release. It should
|
||||
* only be called before the player is used.
|
||||
*/
|
||||
public void experimentalDisableThrowWhenStuckBuffering() {
|
||||
internalPlayer.experimentalDisableThrowWhenStuckBuffering();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void experimentalSetOffloadSchedulingEnabled(boolean offloadSchedulingEnabled) {
|
||||
internalPlayer.experimentalSetOffloadSchedulingEnabled(offloadSchedulingEnabled);
|
||||
|
@ -205,7 +205,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
private boolean deliverPendingMessageAtStartPositionRequired;
|
||||
@Nullable private ExoPlaybackException pendingRecoverableError;
|
||||
|
||||
private boolean throwWhenStuckBuffering;
|
||||
private long setForegroundModeTimeoutMs;
|
||||
|
||||
public ExoPlayerImplInternal(
|
||||
@ -239,7 +238,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
this.pauseAtEndOfWindow = pauseAtEndOfWindow;
|
||||
this.clock = clock;
|
||||
|
||||
throwWhenStuckBuffering = true;
|
||||
backBufferDurationUs = loadControl.getBackBufferDurationUs();
|
||||
retainBackBufferFromKeyframe = loadControl.retainBackBufferFromKeyframe();
|
||||
|
||||
@ -274,10 +272,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
this.setForegroundModeTimeoutMs = setForegroundModeTimeoutMs;
|
||||
}
|
||||
|
||||
public void experimentalDisableThrowWhenStuckBuffering() {
|
||||
throwWhenStuckBuffering = false;
|
||||
}
|
||||
|
||||
public void experimentalSetOffloadSchedulingEnabled(boolean offloadSchedulingEnabled) {
|
||||
handler
|
||||
.obtainMessage(
|
||||
@ -1012,8 +1006,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
renderers[i].maybeThrowStreamError();
|
||||
}
|
||||
}
|
||||
if (throwWhenStuckBuffering
|
||||
&& !playbackInfo.isLoading
|
||||
if (!playbackInfo.isLoading
|
||||
&& playbackInfo.totalBufferedDurationUs < 500_000
|
||||
&& isLoadingPossible()) {
|
||||
// Throw if the LoadControl prevents loading even if the buffer is empty or almost empty. We
|
||||
|
@ -119,7 +119,6 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
private long releaseTimeoutMs;
|
||||
private long detachSurfaceTimeoutMs;
|
||||
private boolean pauseAtEndOfMediaItems;
|
||||
private boolean throwWhenStuckBuffering;
|
||||
private boolean buildCalled;
|
||||
|
||||
/**
|
||||
@ -251,7 +250,6 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
seekParameters = SeekParameters.DEFAULT;
|
||||
livePlaybackSpeedControl = new DefaultLivePlaybackSpeedControl.Builder().build();
|
||||
clock = Clock.DEFAULT;
|
||||
throwWhenStuckBuffering = true;
|
||||
releaseTimeoutMs = ExoPlayer.DEFAULT_RELEASE_TIMEOUT_MS;
|
||||
detachSurfaceTimeoutMs = DEFAULT_DETACH_SURFACE_TIMEOUT_MS;
|
||||
}
|
||||
@ -536,21 +534,6 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the player should throw when it detects it's stuck buffering.
|
||||
*
|
||||
* <p>This method is experimental, and will be renamed or removed in a future release.
|
||||
*
|
||||
* @param throwWhenStuckBuffering Whether to throw when the player detects it's stuck buffering.
|
||||
* @return This builder.
|
||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||
*/
|
||||
public Builder experimentalSetThrowWhenStuckBuffering(boolean throwWhenStuckBuffering) {
|
||||
Assertions.checkState(!buildCalled);
|
||||
this.throwWhenStuckBuffering = throwWhenStuckBuffering;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link Clock} that will be used by the player. Should only be set for testing
|
||||
* purposes.
|
||||
@ -722,9 +705,6 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
wifiLockManager = new WifiLockManager(builder.context);
|
||||
wifiLockManager.setEnabled(builder.wakeMode == C.WAKE_MODE_NETWORK);
|
||||
deviceInfo = createDeviceInfo(streamVolumeManager);
|
||||
if (!builder.throwWhenStuckBuffering) {
|
||||
player.experimentalDisableThrowWhenStuckBuffering();
|
||||
}
|
||||
|
||||
sendRendererMessage(C.TRACK_TYPE_AUDIO, Renderer.MSG_SET_AUDIO_ATTRIBUTES, audioAttributes);
|
||||
sendRendererMessage(C.TRACK_TYPE_VIDEO, Renderer.MSG_SET_SCALING_MODE, videoScalingMode);
|
||||
|
Loading…
x
Reference in New Issue
Block a user