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
ba33f604
authored
May 18, 2020
by
aquilescanta
Committed by
Oliver Woodman
May 18, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Deprecate LoadErrorHandlingPolicy methods without loadTaskId
Issue: #7309 PiperOrigin-RevId: 312115330
parent
cccb9e1a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
38 deletions
RELEASENOTES.md
library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/LoadErrorHandlingPolicy.java
RELEASENOTES.md
View file @
ba33f604
...
@@ -26,6 +26,11 @@
...
@@ -26,6 +26,11 @@
average video frame processing offset.
average video frame processing offset.
*
Add playlist API
*
Add playlist API
(
[
#6161
](
https://github.com/google/ExoPlayer/issues/6161
)
).
(
[
#6161
](
https://github.com/google/ExoPlayer/issues/6161
)
).
*
Attach an identifier and extra information to load error events passed
to
`LoadErrorHandlingPolicy`
.
`LoadErrorHandlingPolicy`
implementations
must migrate to overriding the non-deprecated methods of the interface
in preparation for deprecated methods' removal in a future ExoPlayer
version (
[
#7309
](
https://github.com/google/ExoPlayer/issues/7309
)
).
*
Add
`play`
and
`pause`
methods to
`Player`
.
*
Add
`play`
and
`pause`
methods to
`Player`
.
*
Add
`Player.getCurrentLiveOffset`
to conveniently return the live
*
Add
`Player.getCurrentLiveOffset`
to conveniently return the live
offset.
offset.
...
...
library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java
View file @
ba33f604
...
@@ -65,8 +65,8 @@ public class DefaultLoadErrorHandlingPolicy implements LoadErrorHandlingPolicy {
...
@@ -65,8 +65,8 @@ public class DefaultLoadErrorHandlingPolicy implements LoadErrorHandlingPolicy {
* code HTTP 404 or 410. The duration of the blacklisting is {@link #DEFAULT_TRACK_BLACKLIST_MS}.
* code HTTP 404 or 410. The duration of the blacklisting is {@link #DEFAULT_TRACK_BLACKLIST_MS}.
*/
*/
@Override
@Override
public
long
getBlacklistDurationMsFor
(
public
long
getBlacklistDurationMsFor
(
LoadErrorInfo
loadErrorInfo
)
{
int
dataType
,
long
loadDurationMs
,
IOException
exception
,
int
errorCount
)
{
IOException
exception
=
loadErrorInfo
.
exception
;
if
(
exception
instanceof
InvalidResponseCodeException
)
{
if
(
exception
instanceof
InvalidResponseCodeException
)
{
int
responseCode
=
((
InvalidResponseCodeException
)
exception
).
responseCode
;
int
responseCode
=
((
InvalidResponseCodeException
)
exception
).
responseCode
;
return
responseCode
==
404
// HTTP 404 Not Found.
return
responseCode
==
404
// HTTP 404 Not Found.
...
@@ -84,13 +84,13 @@ public class DefaultLoadErrorHandlingPolicy implements LoadErrorHandlingPolicy {
...
@@ -84,13 +84,13 @@ public class DefaultLoadErrorHandlingPolicy implements LoadErrorHandlingPolicy {
* {@code Math.min((errorCount - 1) * 1000, 5000)}.
* {@code Math.min((errorCount - 1) * 1000, 5000)}.
*/
*/
@Override
@Override
public
long
getRetryDelayMsFor
(
public
long
getRetryDelayMsFor
(
LoadErrorInfo
loadErrorInfo
)
{
int
dataType
,
long
loadDurationMs
,
IOException
exception
,
int
errorCount
)
{
IOException
exception
=
loadErrorInfo
.
exception
;
return
exception
instanceof
ParserException
return
exception
instanceof
ParserException
||
exception
instanceof
FileNotFoundException
||
exception
instanceof
FileNotFoundException
||
exception
instanceof
UnexpectedLoaderException
||
exception
instanceof
UnexpectedLoaderException
?
C
.
TIME_UNSET
?
C
.
TIME_UNSET
:
Math
.
min
((
errorCount
-
1
)
*
1000
,
5000
);
:
Math
.
min
((
loadErrorInfo
.
errorCount
-
1
)
*
1000
,
5000
);
}
}
/**
/**
...
...
library/core/src/main/java/com/google/android/exoplayer2/upstream/LoadErrorHandlingPolicy.java
View file @
ba33f604
...
@@ -65,21 +65,12 @@ public interface LoadErrorHandlingPolicy {
...
@@ -65,21 +65,12 @@ public interface LoadErrorHandlingPolicy {
}
}
}
}
/**
/** @deprecated Implement {@link #getBlacklistDurationMsFor(LoadErrorInfo)} instead. */
* Returns the number of milliseconds for which a resource associated to a provided load error
@Deprecated
* should be blacklisted, or {@link C#TIME_UNSET} if the resource should not be blacklisted.
default
long
getBlacklistDurationMsFor
(
*
int
dataType
,
long
loadDurationMs
,
IOException
exception
,
int
errorCount
)
{
* @param dataType One of the {@link C C.DATA_TYPE_*} constants indicating the type of data to
throw
new
UnsupportedOperationException
();
* load.
}
* @param loadDurationMs The duration in milliseconds of the load from the start of the first load
* attempt up to the point at which the error occurred.
* @param exception The load error.
* @param errorCount The number of errors this load has encountered, including this one.
* @return The blacklist duration in milliseconds, or {@link C#TIME_UNSET} if the resource should
* not be blacklisted.
*/
long
getBlacklistDurationMsFor
(
int
dataType
,
long
loadDurationMs
,
IOException
exception
,
int
errorCount
);
/**
/**
* Returns the number of milliseconds for which a resource associated to a provided load error
* Returns the number of milliseconds for which a resource associated to a provided load error
...
@@ -89,6 +80,7 @@ public interface LoadErrorHandlingPolicy {
...
@@ -89,6 +80,7 @@ public interface LoadErrorHandlingPolicy {
* @return The blacklist duration in milliseconds, or {@link C#TIME_UNSET} if the resource should
* @return The blacklist duration in milliseconds, or {@link C#TIME_UNSET} if the resource should
* not be blacklisted.
* not be blacklisted.
*/
*/
@SuppressWarnings
(
"deprecation"
)
default
long
getBlacklistDurationMsFor
(
LoadErrorInfo
loadErrorInfo
)
{
default
long
getBlacklistDurationMsFor
(
LoadErrorInfo
loadErrorInfo
)
{
return
getBlacklistDurationMsFor
(
return
getBlacklistDurationMsFor
(
loadErrorInfo
.
mediaLoadData
.
dataType
,
loadErrorInfo
.
mediaLoadData
.
dataType
,
...
@@ -97,24 +89,12 @@ public interface LoadErrorHandlingPolicy {
...
@@ -97,24 +89,12 @@ public interface LoadErrorHandlingPolicy {
loadErrorInfo
.
errorCount
);
loadErrorInfo
.
errorCount
);
}
}
/**
/** @deprecated Implement {@link #getRetryDelayMsFor(LoadErrorInfo)} instead. */
* Returns the number of milliseconds to wait before attempting the load again, or {@link
@Deprecated
* C#TIME_UNSET} if the error is fatal and should not be retried.
default
long
getRetryDelayMsFor
(
*
int
dataType
,
long
loadDurationMs
,
IOException
exception
,
int
errorCount
)
{
* <p>{@link Loader} clients may ignore the retry delay returned by this method in order to wait
throw
new
UnsupportedOperationException
();
* for a specific event before retrying. However, the load is retried if and only if this method
}
* does not return {@link C#TIME_UNSET}.
*
* @param dataType One of the {@link C C.DATA_TYPE_*} constants indicating the type of data to
* load.
* @param loadDurationMs The duration in milliseconds of the load from the start of the first load
* attempt up to the point at which the error occurred.
* @param exception The load error.
* @param errorCount The number of errors this load has encountered, including this one.
* @return The number of milliseconds to wait before attempting the load again, or {@link
* C#TIME_UNSET} if the error is fatal and should not be retried.
*/
long
getRetryDelayMsFor
(
int
dataType
,
long
loadDurationMs
,
IOException
exception
,
int
errorCount
);
/**
/**
* Returns the number of milliseconds to wait before attempting the load again, or {@link
* Returns the number of milliseconds to wait before attempting the load again, or {@link
...
@@ -128,6 +108,7 @@ public interface LoadErrorHandlingPolicy {
...
@@ -128,6 +108,7 @@ public interface LoadErrorHandlingPolicy {
* @return The number of milliseconds to wait before attempting the load again, or {@link
* @return The number of milliseconds to wait before attempting the load again, or {@link
* C#TIME_UNSET} if the error is fatal and should not be retried.
* C#TIME_UNSET} if the error is fatal and should not be retried.
*/
*/
@SuppressWarnings
(
"deprecation"
)
default
long
getRetryDelayMsFor
(
LoadErrorInfo
loadErrorInfo
)
{
default
long
getRetryDelayMsFor
(
LoadErrorInfo
loadErrorInfo
)
{
return
getRetryDelayMsFor
(
return
getRetryDelayMsFor
(
loadErrorInfo
.
mediaLoadData
.
dataType
,
loadErrorInfo
.
mediaLoadData
.
dataType
,
...
...
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