Fix FrameProcessorChain method ordering.

signalEndOfInputStream makes more sense before isEnded and
getPendingInputFrameCount is related to registerInputFrame.

PiperOrigin-RevId: 441134418
This commit is contained in:
hschlueter 2022-04-12 11:26:49 +01:00 committed by Ian Baker
parent 0a16813f1c
commit 9b4aba33a3

View File

@ -323,6 +323,14 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
pendingFrameCount.incrementAndGet();
}
/**
* Returns the number of input frames that have been {@linkplain #registerInputFrame() registered}
* but not completely processed yet.
*/
public int getPendingFrameCount() {
return pendingFrameCount.get();
}
/**
* Checks whether any exceptions occurred during asynchronous frame processing and rethrows the
* first exception encountered.
@ -345,12 +353,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
}
}
/**
* Returns the number of input frames that have been {@linkplain #registerInputFrame() registered}
* but not completely processed yet.
*/
public int getPendingFrameCount() {
return pendingFrameCount.get();
/** Informs the {@code FrameProcessorChain} that no further input frames should be accepted. */
public void signalEndOfInputStream() {
inputStreamEnded = true;
}
/** Returns whether all frames have been processed. */
@ -358,11 +363,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
return inputStreamEnded && getPendingFrameCount() == 0;
}
/** Informs the {@code FrameProcessorChain} that no further input frames should be accepted. */
public void signalEndOfInputStream() {
inputStreamEnded = true;
}
/**
* Releases all resources.
*