mirror of
https://github.com/samsonjs/media.git
synced 2026-04-05 11:15:46 +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;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue