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
82d3e1e8
authored
Oct 22, 2019
by
samrobinson
Committed by
Oliver Woodman
Oct 30, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Rename format to mediaFormat for clarity.
PiperOrigin-RevId: 276036585
parent
10174693
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 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 @
82d3e1e8
...
...
@@ -1273,11 +1273,11 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
/**
* Called when the output format of the {@link MediaCodec} changes.
*
<p>
* The default implementation is a no-op.
*
*
<p>
The default implementation is a no-op.
*
* @param codec The {@link MediaCodec} instance.
* @param outputFormat The new output
f
ormat.
* @param outputFormat The new output
MediaF
ormat.
* @throws ExoPlaybackException Thrown if an error occurs handling the new output format.
*/
protected
void
onOutputFormatChanged
(
MediaCodec
codec
,
MediaFormat
outputFormat
)
...
...
@@ -1570,22 +1570,21 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
return
false
;
}
/**
* Processes a new output format.
*/
/** Processes a new output {@link MediaFormat}. */
private
void
processOutputFormat
()
throws
ExoPlaybackException
{
MediaFormat
f
ormat
=
codec
.
getOutputFormat
();
MediaFormat
mediaF
ormat
=
codec
.
getOutputFormat
();
if
(
codecAdaptationWorkaroundMode
!=
ADAPTATION_WORKAROUND_MODE_NEVER
&&
format
.
getInteger
(
MediaFormat
.
KEY_WIDTH
)
==
ADAPTATION_WORKAROUND_SLICE_WIDTH_HEIGHT
&&
format
.
getInteger
(
MediaFormat
.
KEY_HEIGHT
)
==
ADAPTATION_WORKAROUND_SLICE_WIDTH_HEIGHT
)
{
&&
mediaFormat
.
getInteger
(
MediaFormat
.
KEY_WIDTH
)
==
ADAPTATION_WORKAROUND_SLICE_WIDTH_HEIGHT
&&
mediaFormat
.
getInteger
(
MediaFormat
.
KEY_HEIGHT
)
==
ADAPTATION_WORKAROUND_SLICE_WIDTH_HEIGHT
)
{
// We assume this format changed event was caused by the adaptation workaround.
shouldSkipAdaptationWorkaroundOutputBuffer
=
true
;
return
;
}
if
(
codecNeedsMonoChannelCountWorkaround
)
{
f
ormat
.
setInteger
(
MediaFormat
.
KEY_CHANNEL_COUNT
,
1
);
mediaF
ormat
.
setInteger
(
MediaFormat
.
KEY_CHANNEL_COUNT
,
1
);
}
onOutputFormatChanged
(
codec
,
f
ormat
);
onOutputFormatChanged
(
codec
,
mediaF
ormat
);
}
/**
...
...
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