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
f500110c
authored
Mar 30, 2020
by
aquilescanta
Committed by
Oliver Woodman
Mar 30, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use MediaLoadData and LoadEventInfo in LoadErrorInfo
PiperOrigin-RevId: 303717642
parent
c7164a30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
library/core/src/main/java/com/google/android/exoplayer2/upstream/LoadErrorHandlingPolicy.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/LoadErrorHandlingPolicy.java
View file @
f500110c
...
...
@@ -16,6 +16,8 @@
package
com
.
google
.
android
.
exoplayer2
.
upstream
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.source.LoadEventInfo
;
import
com.google.android.exoplayer2.source.MediaLoadData
;
import
com.google.android.exoplayer2.upstream.Loader.Callback
;
import
com.google.android.exoplayer2.upstream.Loader.Loadable
;
import
java.io.IOException
;
...
...
@@ -41,22 +43,23 @@ public interface LoadErrorHandlingPolicy {
/** Holds information about a load task error. */
final
class
LoadErrorInfo
{
/** One of the {@link C C.DATA_TYPE_*} constants indicating the type of data to load. */
public
final
int
dataType
;
/**
* The duration in milliseconds of the load from the start of the first load attempt up to the
* point at which the error occurred.
*/
public
final
long
loadDurationMs
;
/** The {@link LoadEventInfo} associated with the load that encountered an error. */
public
final
LoadEventInfo
loadEventInfo
;
/** {@link MediaLoadData} associated with the load that encountered an error. */
public
final
MediaLoadData
mediaLoadData
;
/** The exception associated to the load error. */
public
final
IOException
exception
;
/** The number of errors this load task has encountered, including this one. */
public
final
int
errorCount
;
/** Creates an instance with the given values. */
public
LoadErrorInfo
(
int
dataType
,
long
loadDurationMs
,
IOException
exception
,
int
errorCount
)
{
this
.
dataType
=
dataType
;
this
.
loadDurationMs
=
loadDurationMs
;
public
LoadErrorInfo
(
LoadEventInfo
loadEventInfo
,
MediaLoadData
mediaLoadData
,
IOException
exception
,
int
errorCount
)
{
this
.
loadEventInfo
=
loadEventInfo
;
this
.
mediaLoadData
=
mediaLoadData
;
this
.
exception
=
exception
;
this
.
errorCount
=
errorCount
;
}
...
...
@@ -88,8 +91,8 @@ public interface LoadErrorHandlingPolicy {
*/
default
long
getBlacklistDurationMsFor
(
LoadErrorInfo
loadErrorInfo
)
{
return
getBlacklistDurationMsFor
(
loadErrorInfo
.
dataType
,
loadErrorInfo
.
loadDurationMs
,
loadErrorInfo
.
mediaLoadData
.
dataType
,
loadErrorInfo
.
load
EventInfo
.
load
DurationMs
,
loadErrorInfo
.
exception
,
loadErrorInfo
.
errorCount
);
}
...
...
@@ -127,8 +130,8 @@ public interface LoadErrorHandlingPolicy {
*/
default
long
getRetryDelayMsFor
(
LoadErrorInfo
loadErrorInfo
)
{
return
getRetryDelayMsFor
(
loadErrorInfo
.
dataType
,
loadErrorInfo
.
loadDurationMs
,
loadErrorInfo
.
mediaLoadData
.
dataType
,
loadErrorInfo
.
load
EventInfo
.
load
DurationMs
,
loadErrorInfo
.
exception
,
loadErrorInfo
.
errorCount
);
}
...
...
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