diff --git a/libraries/effect/src/main/java/androidx/media3/effect/DefaultVideoFrameProcessor.java b/libraries/effect/src/main/java/androidx/media3/effect/DefaultVideoFrameProcessor.java index d8361e9706..8f7352542d 100644 --- a/libraries/effect/src/main/java/androidx/media3/effect/DefaultVideoFrameProcessor.java +++ b/libraries/effect/src/main/java/androidx/media3/effect/DefaultVideoFrameProcessor.java @@ -455,8 +455,6 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor { throws GlUtil.GlException, VideoFrameProcessingException { 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(); int[] configAttributes = ColorInfo.isTransferHdr(outputColorInfo) diff --git a/libraries/transformer/src/main/java/androidx/media3/transformer/DefaultCodec.java b/libraries/transformer/src/main/java/androidx/media3/transformer/DefaultCodec.java index ea3da47883..ee42c9156a 100644 --- a/libraries/transformer/src/main/java/androidx/media3/transformer/DefaultCodec.java +++ b/libraries/transformer/src/main/java/androidx/media3/transformer/DefaultCodec.java @@ -33,7 +33,6 @@ import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.annotation.VisibleForTesting; 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; @@ -342,21 +341,6 @@ public final class DefaultCodec implements Codec { if (outputBufferIndex < 0) { if (outputBufferIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) { 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; } @@ -407,19 +391,6 @@ public final class DefaultCodec implements Codec { 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) { ImmutableList.Builder csdBuffers = new ImmutableList.Builder<>(); int csdIndex = 0; diff --git a/libraries/transformer/src/main/java/androidx/media3/transformer/ExoAssetLoaderBaseRenderer.java b/libraries/transformer/src/main/java/androidx/media3/transformer/ExoAssetLoaderBaseRenderer.java index 97bd6eb4df..920884aa8d 100644 --- a/libraries/transformer/src/main/java/androidx/media3/transformer/ExoAssetLoaderBaseRenderer.java +++ b/libraries/transformer/src/main/java/androidx/media3/transformer/ExoAssetLoaderBaseRenderer.java @@ -218,7 +218,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; if (shouldInitDecoder) { 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. if (!ensureSampleConsumerInitialized()) { return false; @@ -256,7 +256,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; } outputFormat = decoderOutputFormat; } 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. outputFormat = inputFormat; } diff --git a/libraries/transformer/src/main/java/androidx/media3/transformer/ExoAssetLoaderVideoRenderer.java b/libraries/transformer/src/main/java/androidx/media3/transformer/ExoAssetLoaderVideoRenderer.java index 35d33ad060..117d0be6b6 100644 --- a/libraries/transformer/src/main/java/androidx/media3/transformer/ExoAssetLoaderVideoRenderer.java +++ b/libraries/transformer/src/main/java/androidx/media3/transformer/ExoAssetLoaderVideoRenderer.java @@ -77,7 +77,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; @Override 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. checkStateNotNull(sampleConsumer); boolean isDecoderToneMappingRequired = diff --git a/libraries/transformer/src/main/java/androidx/media3/transformer/VideoSamplePipeline.java b/libraries/transformer/src/main/java/androidx/media3/transformer/VideoSamplePipeline.java index 67e8dbee5e..f1774ad7fa 100644 --- a/libraries/transformer/src/main/java/androidx/media3/transformer/VideoSamplePipeline.java +++ b/libraries/transformer/src/main/java/androidx/media3/transformer/VideoSamplePipeline.java @@ -88,6 +88,8 @@ import org.checkerframework.dataflow.qual.Pure; DebugViewProvider debugViewProvider) throws ExportException { // 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); mediaItemOffsetUs = new AtomicLong(); @@ -384,7 +386,6 @@ import org.checkerframework.dataflow.qual.Pure; if (isInputToneMapped) { // 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. - // TODO(b/237674316): Get the color info from the decoder output media format instead. return ColorInfo.SDR_BT709_LIMITED; } if (inputFormat.colorInfo == null) {