From 46cd92ac1d80b2e651aa0ac2403e6d52d9c1d767 Mon Sep 17 00:00:00 2001 From: hschlueter Date: Tue, 12 Jul 2022 11:09:46 +0000 Subject: [PATCH] Set ColorInfo in decoder configuration format. Pass the color info and HDR static metadata when configuring the decoder using MediaFormatUtil.maybeSetColorInfo. PiperOrigin-RevId: 460424985 --- .../android/exoplayer2/transformer/DefaultDecoderFactory.java | 1 + 1 file changed, 1 insertion(+) diff --git a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultDecoderFactory.java b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultDecoderFactory.java index 2ed1faaec6..bf107017d0 100644 --- a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultDecoderFactory.java +++ b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultDecoderFactory.java @@ -79,6 +79,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; MediaFormatUtil.maybeSetInteger( mediaFormat, MediaFormat.KEY_MAX_INPUT_SIZE, format.maxInputSize); MediaFormatUtil.setCsdBuffers(mediaFormat, format.initializationData); + MediaFormatUtil.maybeSetColorInfo(mediaFormat, format.colorInfo); if (decoderSupportsKeyAllowFrameDrop) { // This key ensures no frame dropping when the decoder's output surface is full. This allows // transformer to decode as many frames as possible in one render cycle.