mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
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 028b3a7312)
This commit is contained in:
parent
a5031a688b
commit
6abc1a7155
1 changed files with 8 additions and 8 deletions
|
|
@ -63,16 +63,16 @@ import java.util.Queue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
long presentationTimeUs = pendingFrame.second;
|
videoFrameProcessingTaskExecutor.submit(
|
||||||
if (presentationTimeUs == C.TIME_END_OF_SOURCE) {
|
() ->
|
||||||
consumingGlShaderProgramInputCapacity++;
|
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(
|
videoFrameProcessingTaskExecutor.submit(
|
||||||
consumingGlShaderProgram::signalEndOfCurrentInputStream);
|
consumingGlShaderProgram::signalEndOfCurrentInputStream);
|
||||||
} else {
|
availableFrames.remove();
|
||||||
videoFrameProcessingTaskExecutor.submit(
|
|
||||||
() ->
|
|
||||||
consumingGlShaderProgram.queueInputFrame(
|
|
||||||
/* inputTexture= */ pendingFrame.first, presentationTimeUs));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue