Fix image up-side-down in when playing a Composition

When playing a Composition, the color transfer of an image is incorrectly
passed down to be SMPTE170M, but it should be SRGB.

PiperOrigin-RevId: 626425396
This commit is contained in:
claincly 2024-04-19 11:34:46 -07:00 committed by Copybara-Service
parent fb037b9847
commit 716aedd019

View File

@ -541,9 +541,11 @@ public final class CompositingVideoSinkProvider
}
private static ColorInfo getAdjustedInputColorInfo(@Nullable ColorInfo inputColorInfo) {
return inputColorInfo != null && ColorInfo.isTransferHdr(inputColorInfo)
? inputColorInfo
: ColorInfo.SDR_BT709_LIMITED;
if (inputColorInfo == null || !inputColorInfo.isDataSpaceValid()) {
return ColorInfo.SDR_BT709_LIMITED;
}
return inputColorInfo;
}
/** Receives input from an ExoPlayer renderer and forwards it to the video graph. */