Skip to content

Commit

Permalink
HDR: Remove ColorInfo.SDR constant
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dway123 authored and rohitjoins committed Jul 7, 2022
1 parent 9521807 commit 4230ea9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Expand Up @@ -32,14 +32,6 @@

/** Stores color info. */
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
* table A.7.21.1 in Rec. ITU-T T.832 (03/2009), or {@link Format#NO_VALUE} if no mapping can be
Expand Down
Expand Up @@ -387,7 +387,7 @@ public SurfaceInfo getSurfaceInfo(int requestedWidth, int requestedHeight)
transformationRequest.videoMimeType != null
? transformationRequest.videoMimeType
: inputFormat.sampleMimeType)
.setColorInfo(fallbackToSdr ? ColorInfo.SDR : inputFormat.colorInfo)
.setColorInfo(fallbackToSdr ? null : inputFormat.colorInfo)
.build();

encoder =
Expand Down

0 comments on commit 4230ea9

Please sign in to comment.