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
dd6a0c37
authored
Apr 14, 2023
by
huangdarwin
Committed by
Rohit Singh
Apr 17, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Transformer: Update TODOs to use new bug link
PiperOrigin-RevId: 524349341
parent
46ebba38
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
35 deletions
library/effect/src/main/java/com/google/android/exoplayer2/effect/DefaultVideoFrameProcessor.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultCodec.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoAssetLoaderBaseRenderer.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoAssetLoaderVideoRenderer.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/VideoSamplePipeline.java
library/effect/src/main/java/com/google/android/exoplayer2/effect/DefaultVideoFrameProcessor.java
View file @
dd6a0c37
...
@@ -453,8 +453,6 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
...
@@ -453,8 +453,6 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
throws
GlUtil
.
GlException
,
VideoFrameProcessingException
{
throws
GlUtil
.
GlException
,
VideoFrameProcessingException
{
checkState
(
Thread
.
currentThread
().
getName
().
equals
(
THREAD_NAME
));
checkState
(
Thread
.
currentThread
().
getName
().
equals
(
THREAD_NAME
));
// TODO(b/237674316): Delay initialization of things requiring the colorInfo, to
// configure based on the color info from the decoder output media format instead.
EGLDisplay
eglDisplay
=
GlUtil
.
createEglDisplay
();
EGLDisplay
eglDisplay
=
GlUtil
.
createEglDisplay
();
int
[]
configAttributes
=
int
[]
configAttributes
=
ColorInfo
.
isTransferHdr
(
outputColorInfo
)
ColorInfo
.
isTransferHdr
(
outputColorInfo
)
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultCodec.java
View file @
dd6a0c37
...
@@ -40,7 +40,6 @@ import com.google.android.exoplayer2.util.MediaFormatUtil;
...
@@ -40,7 +40,6 @@ import com.google.android.exoplayer2.util.MediaFormatUtil;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.TraceUtil
;
import
com.google.android.exoplayer2.util.TraceUtil
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.video.ColorInfo
;
import
com.google.common.collect.ImmutableList
;
import
com.google.common.collect.ImmutableList
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
...
@@ -340,21 +339,6 @@ public final class DefaultCodec implements Codec {
...
@@ -340,21 +339,6 @@ public final class DefaultCodec implements Codec {
if
(
outputBufferIndex
<
0
)
{
if
(
outputBufferIndex
<
0
)
{
if
(
outputBufferIndex
==
MediaCodec
.
INFO_OUTPUT_FORMAT_CHANGED
)
{
if
(
outputBufferIndex
==
MediaCodec
.
INFO_OUTPUT_FORMAT_CHANGED
)
{
outputFormat
=
convertToFormat
(
mediaCodec
.
getOutputFormat
(),
isDecoder
);
outputFormat
=
convertToFormat
(
mediaCodec
.
getOutputFormat
(),
isDecoder
);
ColorInfo
expectedColorInfo
=
isSdrToneMappingEnabled
(
configurationMediaFormat
)
?
ColorInfo
.
SDR_BT709_LIMITED
:
configurationFormat
.
colorInfo
;
if
(!
areColorTransfersEqual
(
expectedColorInfo
,
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 been 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
;
return
false
;
}
}
...
@@ -405,19 +389,6 @@ public final class DefaultCodec implements Codec {
...
@@ -405,19 +389,6 @@ public final class DefaultCodec implements Codec {
return
ExportException
.
createForCodec
(
cause
,
errorCode
,
isVideo
,
isDecoder
,
codecDetails
);
return
ExportException
.
createForCodec
(
cause
,
errorCode
,
isVideo
,
isDecoder
,
codecDetails
);
}
}
private
static
boolean
areColorTransfersEqual
(
@Nullable
ColorInfo
colorInfo1
,
@Nullable
ColorInfo
colorInfo2
)
{
@C
.
ColorTransfer
int
transfer1
=
C
.
COLOR_TRANSFER_SDR
;
if
(
colorInfo1
!=
null
&&
colorInfo1
.
colorTransfer
!=
Format
.
NO_VALUE
)
{
transfer1
=
colorInfo1
.
colorTransfer
;
}
@C
.
ColorTransfer
int
transfer2
=
C
.
COLOR_TRANSFER_SDR
;
if
(
colorInfo2
!=
null
&&
colorInfo2
.
colorTransfer
!=
Format
.
NO_VALUE
)
{
transfer2
=
colorInfo2
.
colorTransfer
;
}
return
transfer1
==
transfer2
;
}
private
static
Format
convertToFormat
(
MediaFormat
mediaFormat
,
boolean
isDecoder
)
{
private
static
Format
convertToFormat
(
MediaFormat
mediaFormat
,
boolean
isDecoder
)
{
ImmutableList
.
Builder
<
byte
[]>
csdBuffers
=
new
ImmutableList
.
Builder
<>();
ImmutableList
.
Builder
<
byte
[]>
csdBuffers
=
new
ImmutableList
.
Builder
<>();
int
csdIndex
=
0
;
int
csdIndex
=
0
;
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoAssetLoaderBaseRenderer.java
View file @
dd6a0c37
...
@@ -218,7 +218,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -218,7 +218,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
if
(
shouldInitDecoder
)
{
if
(
shouldInitDecoder
)
{
if
(
getProcessedTrackType
(
inputFormat
.
sampleMimeType
)
==
C
.
TRACK_TYPE_VIDEO
)
{
if
(
getProcessedTrackType
(
inputFormat
.
sampleMimeType
)
==
C
.
TRACK_TYPE_VIDEO
)
{
// TODO(b/2
37674316
): Move surface creation out of video sampleConsumer. Init decoder and
// TODO(b/2
78259383
): Move surface creation out of video sampleConsumer. Init decoder and
// get decoder output Format before init sampleConsumer.
// get decoder output Format before init sampleConsumer.
if
(!
ensureSampleConsumerInitialized
())
{
if
(!
ensureSampleConsumerInitialized
())
{
return
false
;
return
false
;
...
@@ -256,7 +256,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -256,7 +256,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
}
}
outputFormat
=
decoderOutputFormat
;
outputFormat
=
decoderOutputFormat
;
}
else
{
}
else
{
// TODO(b/2
37674316
): Move surface creation out of video sampleConsumer. Init decoder and
// TODO(b/2
78259383
): Move surface creation out of video sampleConsumer. Init decoder and
// get decoderOutput Format before init sampleConsumer.
// get decoderOutput Format before init sampleConsumer.
outputFormat
=
inputFormat
;
outputFormat
=
inputFormat
;
}
}
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoAssetLoaderVideoRenderer.java
View file @
dd6a0c37
...
@@ -77,7 +77,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -77,7 +77,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@Override
@Override
protected
void
initDecoder
(
Format
inputFormat
)
throws
ExportException
{
protected
void
initDecoder
(
Format
inputFormat
)
throws
ExportException
{
// TODO(b/2
37674316
): Move surface creation out of sampleConsumer. Init decoder before
// TODO(b/2
78259383
): Move surface creation out of sampleConsumer. Init decoder before
// sampleConsumer.
// sampleConsumer.
checkStateNotNull
(
sampleConsumer
);
checkStateNotNull
(
sampleConsumer
);
boolean
isDecoderToneMappingRequired
=
boolean
isDecoderToneMappingRequired
=
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/VideoSamplePipeline.java
View file @
dd6a0c37
...
@@ -88,6 +88,8 @@ import org.checkerframework.dataflow.qual.Pure;
...
@@ -88,6 +88,8 @@ import org.checkerframework.dataflow.qual.Pure;
DebugViewProvider
debugViewProvider
)
DebugViewProvider
debugViewProvider
)
throws
ExportException
{
throws
ExportException
{
// TODO(b/262693177) Add tests for input format change.
// TODO(b/262693177) Add tests for input format change.
// TODO(b/278259383) Consider delaying configuration of VideoSamplePipeline to use the decoder
// output format instead of the extractor output format, to match AudioSamplePipeline behavior.
super
(
firstInputFormat
,
muxerWrapper
);
super
(
firstInputFormat
,
muxerWrapper
);
mediaItemOffsetUs
=
new
AtomicLong
();
mediaItemOffsetUs
=
new
AtomicLong
();
...
@@ -384,7 +386,6 @@ import org.checkerframework.dataflow.qual.Pure;
...
@@ -384,7 +386,6 @@ import org.checkerframework.dataflow.qual.Pure;
if
(
isInputToneMapped
)
{
if
(
isInputToneMapped
)
{
// When tone-mapping HDR to SDR is enabled, assume we get BT.709 to avoid having the encoder
// When tone-mapping HDR to SDR is enabled, assume we get BT.709 to avoid having the encoder
// populate default color info, which depends on the resolution.
// populate default color info, which depends on the resolution.
// TODO(b/237674316): Get the color info from the decoder output media format instead.
return
ColorInfo
.
SDR_BT709_LIMITED
;
return
ColorInfo
.
SDR_BT709_LIMITED
;
}
}
if
(
inputFormat
.
colorInfo
==
null
)
{
if
(
inputFormat
.
colorInfo
==
null
)
{
...
...
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