Reset the simple frame dropping logic on flush or EOS.
#minor-release PiperOrigin-RevId: 540633875
This commit is contained in:
parent
be9b057dda
commit
251fb013c3
@ -97,12 +97,13 @@ public class FrameDropTest {
|
||||
/* expectedFrameRate= */ 6, /* targetFrameRate= */ 2))
|
||||
.build();
|
||||
|
||||
videoFrameProcessorTestRunner.registerAndQueueInputBitmap(
|
||||
videoFrameProcessorTestRunner.registerInputStream(INPUT_TYPE_BITMAP);
|
||||
videoFrameProcessorTestRunner.queueInputBitmap(
|
||||
readBitmap(ORIGINAL_PNG_ASSET_PATH),
|
||||
/* durationUs= */ C.MICROS_PER_SECOND,
|
||||
/* offsetToAddUs= */ 0L,
|
||||
/* frameRate= */ 4);
|
||||
videoFrameProcessorTestRunner.registerAndQueueInputBitmap(
|
||||
videoFrameProcessorTestRunner.queueInputBitmap(
|
||||
readBitmap(SCALE_WIDE_PNG_ASSET_PATH),
|
||||
/* durationUs= */ C.MICROS_PER_SECOND,
|
||||
/* offsetToAddUs= */ C.MICROS_PER_SECOND,
|
||||
|
@ -63,4 +63,16 @@ import androidx.media3.common.VideoFrameProcessingException;
|
||||
inputListener.onReadyToAcceptInputFrame();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void signalEndOfCurrentInputStream() {
|
||||
super.signalEndOfCurrentInputStream();
|
||||
framesReceived = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() {
|
||||
super.flush();
|
||||
framesReceived = 0;
|
||||
}
|
||||
}
|
||||
|
@ -342,6 +342,20 @@ public final class VideoFrameProcessorTestRunner {
|
||||
endFrameProcessing();
|
||||
}
|
||||
|
||||
public void registerInputStream(@InputType int inputType) {
|
||||
videoFrameProcessor.registerInputStream(inputType, ImmutableList.of());
|
||||
}
|
||||
|
||||
public void queueInputBitmap(
|
||||
Bitmap inputBitmap, long durationUs, long offsetToAddUs, float frameRate) {
|
||||
videoFrameProcessor.setInputFrameInfo(
|
||||
new FrameInfo.Builder(inputBitmap.getWidth(), inputBitmap.getHeight())
|
||||
.setPixelWidthHeightRatio(pixelWidthHeightRatio)
|
||||
.setOffsetToAddUs(offsetToAddUs)
|
||||
.build());
|
||||
videoFrameProcessor.queueInputBitmap(inputBitmap, durationUs, frameRate);
|
||||
}
|
||||
|
||||
public void registerAndQueueInputBitmap(
|
||||
Bitmap inputBitmap, long durationUs, long offsetToAddUs, float frameRate) {
|
||||
videoFrameProcessor.setInputFrameInfo(
|
||||
|
Loading…
x
Reference in New Issue
Block a user