Commit dd6a0c37 by huangdarwin Committed by Rohit Singh

Transformer: Update TODOs to use new bug link

PiperOrigin-RevId: 524349341
parent 46ebba38
...@@ -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)
......
...@@ -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;
......
...@@ -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/237674316): Move surface creation out of video sampleConsumer. Init decoder and // TODO(b/278259383): 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/237674316): Move surface creation out of video sampleConsumer. Init decoder and // TODO(b/278259383): 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;
} }
......
...@@ -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/237674316): Move surface creation out of sampleConsumer. Init decoder before // TODO(b/278259383): Move surface creation out of sampleConsumer. Init decoder before
// sampleConsumer. // sampleConsumer.
checkStateNotNull(sampleConsumer); checkStateNotNull(sampleConsumer);
boolean isDecoderToneMappingRequired = boolean isDecoderToneMappingRequired =
......
...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment