Commit 8a8c5d5f by kimvde Committed by Tofunmi Adigun-Hameed

Simplify FrameConsumptionManager onReadyToAcceptInputFrame logic

Propagate the "end of current stream" signal directly after queueing the
last frame, instead of waiting for the next onReadyToAcceptInputFrame()
call.

PiperOrigin-RevId: 532739462
(cherry picked from commit 410debdc69150c30807e96da13ae83342817b126)
parent 74e2d870
......@@ -63,16 +63,16 @@ import java.util.Queue;
return;
}
long presentationTimeUs = pendingFrame.second;
if (presentationTimeUs == C.TIME_END_OF_SOURCE) {
consumingGlShaderProgramInputCapacity++;
videoFrameProcessingTaskExecutor.submit(
() ->
consumingGlShaderProgram.queueInputFrame(
/* inputTexture= */ pendingFrame.first,
/* presentationTimeUs= */ pendingFrame.second));
@Nullable Pair<GlTextureInfo, Long> nextPendingFrame = availableFrames.peek();
if (nextPendingFrame != null && nextPendingFrame.second == C.TIME_END_OF_SOURCE) {
videoFrameProcessingTaskExecutor.submit(
consumingGlShaderProgram::signalEndOfCurrentInputStream);
} else {
videoFrameProcessingTaskExecutor.submit(
() ->
consumingGlShaderProgram.queueInputFrame(
/* inputTexture= */ pendingFrame.first, presentationTimeUs));
availableFrames.remove();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment