Commit 02265430 by tonihei Committed by Oliver Woodman

Remove experimental method to disable stuck buffering detection.

PiperOrigin-RevId: 348462189
parent 85d094a2
...@@ -162,7 +162,6 @@ public interface ExoPlayer extends Player { ...@@ -162,7 +162,6 @@ public interface ExoPlayer extends Player {
private LivePlaybackSpeedControl livePlaybackSpeedControl; private LivePlaybackSpeedControl livePlaybackSpeedControl;
private boolean buildCalled; private boolean buildCalled;
private boolean throwWhenStuckBuffering;
private long setForegroundModeTimeoutMs; private long setForegroundModeTimeoutMs;
/** /**
...@@ -228,7 +227,6 @@ public interface ExoPlayer extends Player { ...@@ -228,7 +227,6 @@ public interface ExoPlayer extends Player {
seekParameters = SeekParameters.DEFAULT; seekParameters = SeekParameters.DEFAULT;
livePlaybackSpeedControl = new DefaultLivePlaybackSpeedControl.Builder().build(); livePlaybackSpeedControl = new DefaultLivePlaybackSpeedControl.Builder().build();
clock = Clock.DEFAULT; clock = Clock.DEFAULT;
throwWhenStuckBuffering = true;
releaseTimeoutMs = DEFAULT_RELEASE_TIMEOUT_MS; releaseTimeoutMs = DEFAULT_RELEASE_TIMEOUT_MS;
} }
...@@ -247,19 +245,6 @@ public interface ExoPlayer extends Player { ...@@ -247,19 +245,6 @@ public interface ExoPlayer extends Player {
} }
/** /**
* 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. * Sets the {@link TrackSelector} that will be used by the player.
* *
* @param trackSelector A {@link TrackSelector}. * @param trackSelector A {@link TrackSelector}.
...@@ -460,10 +445,6 @@ public interface ExoPlayer extends Player { ...@@ -460,10 +445,6 @@ public interface ExoPlayer extends Player {
if (setForegroundModeTimeoutMs > 0) { if (setForegroundModeTimeoutMs > 0) {
player.experimentalSetForegroundModeTimeoutMs(setForegroundModeTimeoutMs); player.experimentalSetForegroundModeTimeoutMs(setForegroundModeTimeoutMs);
} }
if (!throwWhenStuckBuffering) {
player.experimentalDisableThrowWhenStuckBuffering();
}
return player; return player;
} }
} }
......
...@@ -210,16 +210,6 @@ import java.util.concurrent.TimeoutException; ...@@ -210,16 +210,6 @@ import java.util.concurrent.TimeoutException;
internalPlayer.experimentalSetForegroundModeTimeoutMs(timeoutMs); 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 @Override
public void experimentalSetOffloadSchedulingEnabled(boolean offloadSchedulingEnabled) { public void experimentalSetOffloadSchedulingEnabled(boolean offloadSchedulingEnabled) {
internalPlayer.experimentalSetOffloadSchedulingEnabled(offloadSchedulingEnabled); internalPlayer.experimentalSetOffloadSchedulingEnabled(offloadSchedulingEnabled);
......
...@@ -205,7 +205,6 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -205,7 +205,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
private boolean deliverPendingMessageAtStartPositionRequired; private boolean deliverPendingMessageAtStartPositionRequired;
@Nullable private ExoPlaybackException pendingRecoverableError; @Nullable private ExoPlaybackException pendingRecoverableError;
private boolean throwWhenStuckBuffering;
private long setForegroundModeTimeoutMs; private long setForegroundModeTimeoutMs;
public ExoPlayerImplInternal( public ExoPlayerImplInternal(
...@@ -239,7 +238,6 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -239,7 +238,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
this.pauseAtEndOfWindow = pauseAtEndOfWindow; this.pauseAtEndOfWindow = pauseAtEndOfWindow;
this.clock = clock; this.clock = clock;
throwWhenStuckBuffering = true;
backBufferDurationUs = loadControl.getBackBufferDurationUs(); backBufferDurationUs = loadControl.getBackBufferDurationUs();
retainBackBufferFromKeyframe = loadControl.retainBackBufferFromKeyframe(); retainBackBufferFromKeyframe = loadControl.retainBackBufferFromKeyframe();
...@@ -274,10 +272,6 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -274,10 +272,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
this.setForegroundModeTimeoutMs = setForegroundModeTimeoutMs; this.setForegroundModeTimeoutMs = setForegroundModeTimeoutMs;
} }
public void experimentalDisableThrowWhenStuckBuffering() {
throwWhenStuckBuffering = false;
}
public void experimentalSetOffloadSchedulingEnabled(boolean offloadSchedulingEnabled) { public void experimentalSetOffloadSchedulingEnabled(boolean offloadSchedulingEnabled) {
handler handler
.obtainMessage( .obtainMessage(
...@@ -1012,8 +1006,7 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -1012,8 +1006,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
renderers[i].maybeThrowStreamError(); renderers[i].maybeThrowStreamError();
} }
} }
if (throwWhenStuckBuffering if (!playbackInfo.isLoading
&& !playbackInfo.isLoading
&& playbackInfo.totalBufferedDurationUs < 500_000 && playbackInfo.totalBufferedDurationUs < 500_000
&& isLoadingPossible()) { && isLoadingPossible()) {
// Throw if the LoadControl prevents loading even if the buffer is empty or almost empty. We // 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 ...@@ -119,7 +119,6 @@ public class SimpleExoPlayer extends BasePlayer
private long releaseTimeoutMs; private long releaseTimeoutMs;
private long detachSurfaceTimeoutMs; private long detachSurfaceTimeoutMs;
private boolean pauseAtEndOfMediaItems; private boolean pauseAtEndOfMediaItems;
private boolean throwWhenStuckBuffering;
private boolean buildCalled; private boolean buildCalled;
/** /**
...@@ -251,7 +250,6 @@ public class SimpleExoPlayer extends BasePlayer ...@@ -251,7 +250,6 @@ public class SimpleExoPlayer extends BasePlayer
seekParameters = SeekParameters.DEFAULT; seekParameters = SeekParameters.DEFAULT;
livePlaybackSpeedControl = new DefaultLivePlaybackSpeedControl.Builder().build(); livePlaybackSpeedControl = new DefaultLivePlaybackSpeedControl.Builder().build();
clock = Clock.DEFAULT; clock = Clock.DEFAULT;
throwWhenStuckBuffering = true;
releaseTimeoutMs = ExoPlayer.DEFAULT_RELEASE_TIMEOUT_MS; releaseTimeoutMs = ExoPlayer.DEFAULT_RELEASE_TIMEOUT_MS;
detachSurfaceTimeoutMs = DEFAULT_DETACH_SURFACE_TIMEOUT_MS; detachSurfaceTimeoutMs = DEFAULT_DETACH_SURFACE_TIMEOUT_MS;
} }
...@@ -537,21 +535,6 @@ public class SimpleExoPlayer extends BasePlayer ...@@ -537,21 +535,6 @@ public class SimpleExoPlayer extends BasePlayer
} }
/** /**
* 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 * Sets the {@link Clock} that will be used by the player. Should only be set for testing
* purposes. * purposes.
* *
...@@ -722,9 +705,6 @@ public class SimpleExoPlayer extends BasePlayer ...@@ -722,9 +705,6 @@ public class SimpleExoPlayer extends BasePlayer
wifiLockManager = new WifiLockManager(builder.context); wifiLockManager = new WifiLockManager(builder.context);
wifiLockManager.setEnabled(builder.wakeMode == C.WAKE_MODE_NETWORK); wifiLockManager.setEnabled(builder.wakeMode == C.WAKE_MODE_NETWORK);
deviceInfo = createDeviceInfo(streamVolumeManager); deviceInfo = createDeviceInfo(streamVolumeManager);
if (!builder.throwWhenStuckBuffering) {
player.experimentalDisableThrowWhenStuckBuffering();
}
sendRendererMessage(C.TRACK_TYPE_AUDIO, Renderer.MSG_SET_AUDIO_ATTRIBUTES, audioAttributes); sendRendererMessage(C.TRACK_TYPE_AUDIO, Renderer.MSG_SET_AUDIO_ATTRIBUTES, audioAttributes);
sendRendererMessage(C.TRACK_TYPE_VIDEO, Renderer.MSG_SET_SCALING_MODE, videoScalingMode); sendRendererMessage(C.TRACK_TYPE_VIDEO, Renderer.MSG_SET_SCALING_MODE, videoScalingMode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment