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
01b6061b
authored
Feb 05, 2021
by
olly
Committed by
Oliver Woodman
Feb 09, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Wire CodecException.isRecoverable to ExoPlaybackException
PiperOrigin-RevId: 355896218
parent
91c2f891
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletions
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java
View file @
01b6061b
...
@@ -359,6 +359,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
...
@@ -359,6 +359,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
private
boolean
enableAsynchronousBufferQueueing
;
private
boolean
enableAsynchronousBufferQueueing
;
private
boolean
forceAsyncQueueingSynchronizationWorkaround
;
private
boolean
forceAsyncQueueingSynchronizationWorkaround
;
private
boolean
enableSynchronizeCodecInteractionsWithQueueing
;
private
boolean
enableSynchronizeCodecInteractionsWithQueueing
;
private
boolean
enableRecoverableCodecExceptionRetries
;
@Nullable
private
ExoPlaybackException
pendingPlaybackException
;
@Nullable
private
ExoPlaybackException
pendingPlaybackException
;
protected
DecoderCounters
decoderCounters
;
protected
DecoderCounters
decoderCounters
;
private
long
outputStreamStartPositionUs
;
private
long
outputStreamStartPositionUs
;
...
@@ -465,6 +466,17 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
...
@@ -465,6 +466,17 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
enableSynchronizeCodecInteractionsWithQueueing
=
enabled
;
enableSynchronizeCodecInteractionsWithQueueing
=
enabled
;
}
}
/**
* Enable internal player retries for codec exceptions if the underlying platform indicates that
* they are recoverable.
*
* <p>This method is experimental, and will be renamed or removed in a future release. It should
* only be called before the renderer is used.
*/
public
void
experimentalSetRecoverableCodecExceptionRetriesEnabled
(
boolean
enabled
)
{
enableRecoverableCodecExceptionRetries
=
enabled
;
}
@Override
@Override
@AdaptiveSupport
@AdaptiveSupport
public
final
int
supportsMixedMimeTypeAdaptation
()
{
public
final
int
supportsMixedMimeTypeAdaptation
()
{
...
@@ -836,7 +848,15 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
...
@@ -836,7 +848,15 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
decoderCounters
.
ensureUpdated
();
decoderCounters
.
ensureUpdated
();
}
catch
(
IllegalStateException
e
)
{
}
catch
(
IllegalStateException
e
)
{
if
(
isMediaCodecException
(
e
))
{
if
(
isMediaCodecException
(
e
))
{
throw
createRendererException
(
createDecoderException
(
e
,
getCodecInfo
()),
inputFormat
);
boolean
isRecoverable
=
enableRecoverableCodecExceptionRetries
&&
Util
.
SDK_INT
>=
21
&&
isRecoverableMediaCodecExceptionV21
(
e
);
if
(
isRecoverable
)
{
releaseCodec
();
}
throw
createRendererException
(
createDecoderException
(
e
,
getCodecInfo
()),
inputFormat
,
isRecoverable
);
}
}
throw
e
;
throw
e
;
}
}
...
@@ -2263,6 +2283,14 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
...
@@ -2263,6 +2283,14 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
return
error
instanceof
MediaCodec
.
CodecException
;
return
error
instanceof
MediaCodec
.
CodecException
;
}
}
@RequiresApi
(
21
)
private
static
boolean
isRecoverableMediaCodecExceptionV21
(
IllegalStateException
error
)
{
if
(
error
instanceof
MediaCodec
.
CodecException
)
{
return
((
MediaCodec
.
CodecException
)
error
).
isRecoverable
();
}
return
false
;
}
/**
/**
* Returns whether the decoder is known to fail when flushed.
* Returns whether the decoder is known to fail when flushed.
* <p>
* <p>
...
...
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