Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
02265430
authored
Dec 21, 2020
by
tonihei
Committed by
Oliver Woodman
Dec 23, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove experimental method to disable stuck buffering detection.
PiperOrigin-RevId: 348462189
parent
85d094a2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 additions
and
57 deletions
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayer.java
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayer.java
View file @
02265430
...
...
@@ -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
;
}
...
...
@@ -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.
*
* @param trackSelector A {@link TrackSelector}.
...
...
@@ -460,10 +445,6 @@ public interface ExoPlayer extends Player {
if
(
setForegroundModeTimeoutMs
>
0
)
{
player
.
experimentalSetForegroundModeTimeoutMs
(
setForegroundModeTimeoutMs
);
}
if
(!
throwWhenStuckBuffering
)
{
player
.
experimentalDisableThrowWhenStuckBuffering
();
}
return
player
;
}
}
...
...
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java
View file @
02265430
...
...
@@ -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
);
...
...
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java
View file @
02265430
...
...
@@ -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
...
...
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
View file @
02265430
...
...
@@ -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
;
}
...
...
@@ -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
* 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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment