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
dbe66775
authored
Aug 26, 2022
by
andrewlewis
Committed by
Marc Baechinger
Sep 30, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Log instead of throwing for transfer mismatch
PiperOrigin-RevId: 470354448
parent
91709831
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
libraries/transformer/src/main/java/androidx/media3/transformer/DefaultCodec.java
libraries/transformer/src/main/java/androidx/media3/transformer/DefaultCodec.java
View file @
dbe66775
...
...
@@ -36,6 +36,7 @@ import androidx.media3.common.C;
import
androidx.media3.common.ColorInfo
;
import
androidx.media3.common.Format
;
import
androidx.media3.common.MimeTypes
;
import
androidx.media3.common.util.Log
;
import
androidx.media3.common.util.MediaFormatUtil
;
import
androidx.media3.common.util.TraceUtil
;
import
androidx.media3.common.util.UnstableApi
;
...
...
@@ -51,6 +52,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/** A default {@link Codec} implementation that uses {@link MediaCodec}. */
@UnstableApi
public
final
class
DefaultCodec
implements
Codec
{
private
static
final
String
TAG
=
"DefaultCodec"
;
// MediaCodec decoders always output 16 bit PCM, unless configured to output PCM float.
// https://developer.android.com/reference/android/media/MediaCodec#raw-audio-buffers.
private
static
final
int
MEDIA_CODEC_PCM_ENCODING
=
C
.
ENCODING_PCM_16BIT
;
...
...
@@ -325,16 +329,15 @@ public final class DefaultCodec implements Codec {
ColorInfo
expectedColorInfo
=
isToneMappingEnabled
?
ColorInfo
.
SDR_BT709_LIMITED
:
configurationFormat
.
colorInfo
;
if
(!
areColorTransfersEqual
(
expectedColorInfo
,
outputFormat
.
colorInfo
))
{
// TODO(b/237674316): These exceptions throw when the container ColorInfo doesn't match
// the video ColorInfo. Instead of throwing when seeing unexpected ColorInfos, consider
// reconfiguring downstream components (ex. FrameProcessor and encoder) when different
// ColorInfo values are output.
throw
createTransformationException
(
new
IllegalStateException
(
"Codec output color format does not match configured color format. Expected: "
+
expectedColorInfo
+
". Actual: "
+
outputFormat
.
colorInfo
));
// TODO(b/237674316): The container ColorInfo's transfer doesn't match the decoder output
// MediaFormat, or we requested tone-mapping but it hasn't bee applied. We should
// reconfigure downstream components for this case instead.
Log
.
w
(
TAG
,
"Codec output color format does not match configured color format. Expected: "
+
expectedColorInfo
+
". Actual: "
+
outputFormat
.
colorInfo
);
}
}
return
false
;
...
...
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