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))
|
/* expectedFrameRate= */ 6, /* targetFrameRate= */ 2))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
videoFrameProcessorTestRunner.registerAndQueueInputBitmap(
|
videoFrameProcessorTestRunner.registerInputStream(INPUT_TYPE_BITMAP);
|
||||||
|
videoFrameProcessorTestRunner.queueInputBitmap(
|
||||||
readBitmap(ORIGINAL_PNG_ASSET_PATH),
|
readBitmap(ORIGINAL_PNG_ASSET_PATH),
|
||||||
/* durationUs= */ C.MICROS_PER_SECOND,
|
/* durationUs= */ C.MICROS_PER_SECOND,
|
||||||
/* offsetToAddUs= */ 0L,
|
/* offsetToAddUs= */ 0L,
|
||||||
/* frameRate= */ 4);
|
/* frameRate= */ 4);
|
||||||
videoFrameProcessorTestRunner.registerAndQueueInputBitmap(
|
videoFrameProcessorTestRunner.queueInputBitmap(
|
||||||
readBitmap(SCALE_WIDE_PNG_ASSET_PATH),
|
readBitmap(SCALE_WIDE_PNG_ASSET_PATH),
|
||||||
/* durationUs= */ C.MICROS_PER_SECOND,
|
/* durationUs= */ C.MICROS_PER_SECOND,
|
||||||
/* offsetToAddUs= */ C.MICROS_PER_SECOND,
|
/* offsetToAddUs= */ C.MICROS_PER_SECOND,
|
||||||
|
@ -63,4 +63,16 @@ import androidx.media3.common.VideoFrameProcessingException;
|
|||||||
inputListener.onReadyToAcceptInputFrame();
|
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();
|
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(
|
public void registerAndQueueInputBitmap(
|
||||||
Bitmap inputBitmap, long durationUs, long offsetToAddUs, float frameRate) {
|
Bitmap inputBitmap, long durationUs, long offsetToAddUs, float frameRate) {
|
||||||
videoFrameProcessor.setInputFrameInfo(
|
videoFrameProcessor.setInputFrameInfo(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user