HDR: Remove ColorInfo.SDR constant

The SDR constant also specified a color space and range, in addition to
C.COLOR_TRANSFER_SDR. However, it turns out that SDR videos may use different color
space and range values, so following prior ExoPlayer conventions to have `null`
mean "generic SDR" is preferable here.

PiperOrigin-RevId: 459296746
This commit is contained in:
huangdarwin 2022-07-06 18:11:11 +00:00 committed by Rohit Singh
parent 87adb88f57
commit 7078ce312d
2 changed files with 1 additions and 9 deletions

View File

@ -31,14 +31,6 @@ import org.checkerframework.dataflow.qual.Pure;
/** Stores color info. */ /** Stores color info. */
@UnstableApi @UnstableApi
public final class ColorInfo implements Bundleable { public final class ColorInfo implements Bundleable {
/** Standard Dynamic Range (SDR). */
public static final ColorInfo SDR =
new ColorInfo(
C.COLOR_SPACE_BT709,
C.COLOR_RANGE_LIMITED,
C.COLOR_TRANSFER_SDR,
/* hdrStaticInfo= */ null);
/** /**
* Returns the {@link C.ColorSpace} corresponding to the given ISO color primary code, as per * Returns the {@link C.ColorSpace} corresponding to the given ISO color primary code, as per
* table A.7.21.1 in Rec. ITU-T T.832 (03/2009), or {@link Format#NO_VALUE} if no mapping can be * table A.7.21.1 in Rec. ITU-T T.832 (03/2009), or {@link Format#NO_VALUE} if no mapping can be

View File

@ -387,7 +387,7 @@ import org.checkerframework.dataflow.qual.Pure;
transformationRequest.videoMimeType != null transformationRequest.videoMimeType != null
? transformationRequest.videoMimeType ? transformationRequest.videoMimeType
: inputFormat.sampleMimeType) : inputFormat.sampleMimeType)
.setColorInfo(fallbackToSdr ? ColorInfo.SDR : inputFormat.colorInfo) .setColorInfo(fallbackToSdr ? null : inputFormat.colorInfo)
.build(); .build();
encoder = encoder =