Effect: Clarify flush behavior in javadoc

PiperOrigin-RevId: 576118064
This commit is contained in:
huangdarwin 2023-10-24 06:10:36 -07:00 committed by Copybara-Service
parent 1fc34676d9
commit a8a590c305
2 changed files with 5 additions and 0 deletions

View File

@ -554,10 +554,13 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
}
try {
videoFrameProcessingTaskExecutor.flush();
// Flush from the end of the GlShaderProgram pipeline up to the start.
CountDownLatch latch = new CountDownLatch(1);
inputSwitcher.activeTextureManager().setOnFlushCompleteListener(latch::countDown);
videoFrameProcessingTaskExecutor.submit(finalShaderProgramWrapper::flush);
latch.await();
inputSwitcher.activeTextureManager().setOnFlushCompleteListener(null);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();

View File

@ -78,6 +78,8 @@ public interface GlShaderProgram {
*
* <p>The implementation shall not assume the {@link GlShaderProgram} is {@linkplain
* #onReadyToAcceptInputFrame ready to accept another input frame} when this method is called.
* If the implementation manages a limited input capacity, it must clear all prior {@linkplain
* #onReadyToAcceptInputFrame input frame capacity}.
*/
default void onFlush() {}
}