Avoid create short lived object

PiperOrigin-RevId: 555204528
This commit is contained in:
claincly 2023-08-09 17:29:51 +00:00 committed by Tianyi Feng
parent 3351f0387f
commit 7e12d7619a

View file

@ -61,6 +61,7 @@ import org.checkerframework.dataflow.qual.Pure;
private static final String TAG = "VideoSampleExporter";
private final SingleInputVideoGraph singleInputVideoGraph;
private final EncoderWrapper encoderWrapper;
private final DecoderInputBuffer encoderOutputBuffer;
/**
* The timestamp of the last buffer processed before {@linkplain
@ -104,6 +105,9 @@ import org.checkerframework.dataflow.qual.Pure;
transformationRequest,
fallbackListener);
encoderOutputBuffer =
new DecoderInputBuffer(DecoderInputBuffer.BUFFER_REPLACEMENT_MODE_DISABLED);
boolean isMediaCodecToneMapping =
encoderWrapper.getHdrModeAfterFallback() == HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_MEDIACODEC
&& ColorInfo.isTransferHdr(decoderInputColor);
@ -193,8 +197,6 @@ import org.checkerframework.dataflow.qual.Pure;
@Override
@Nullable
protected DecoderInputBuffer getMuxerInputBuffer() throws ExportException {
DecoderInputBuffer encoderOutputBuffer =
new DecoderInputBuffer(DecoderInputBuffer.BUFFER_REPLACEMENT_MODE_DISABLED);
encoderOutputBuffer.data = encoderWrapper.getOutputBuffer();
if (encoderOutputBuffer.data == null) {
return null;