Change output color transfers when rendering Frame To Debug Surface

PiperOrigin-RevId: 522010318
This commit is contained in:
tofunmi 2023-04-05 12:00:06 +01:00 committed by Marc Baechinger
parent 502969a42b
commit d66dd50263

View file

@ -527,16 +527,12 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
.maybeRenderToSurfaceView( .maybeRenderToSurfaceView(
() -> { () -> {
GlUtil.clearOutputFrame(); GlUtil.clearOutputFrame();
if (enableColorTransfers) {
defaultShaderProgram.drawFrame(inputTexture.texId, presentationTimeUs);
} else {
@C.ColorTransfer @C.ColorTransfer
int configuredColorTransfer = defaultShaderProgram.getOutputColorTransfer(); int configuredColorTransfer = defaultShaderProgram.getOutputColorTransfer();
defaultShaderProgram.setOutputColorTransfer( defaultShaderProgram.setOutputColorTransfer(
debugSurfaceViewWrapper.outputColorTransfer); debugSurfaceViewWrapper.outputColorTransfer);
defaultShaderProgram.drawFrame(inputTexture.texId, presentationTimeUs); defaultShaderProgram.drawFrame(inputTexture.texId, presentationTimeUs);
defaultShaderProgram.setOutputColorTransfer(configuredColorTransfer); defaultShaderProgram.setOutputColorTransfer(configuredColorTransfer);
}
}, },
glObjectsProvider); glObjectsProvider);
} catch (VideoFrameProcessingException | GlUtil.GlException e) { } catch (VideoFrameProcessingException | GlUtil.GlException e) {