mirror of
https://github.com/androidx/media.git
synced 2025-05-17 12:39:52 +08:00
Ensure the exception thrown in the constructor is reported
PiperOrigin-RevId: 579776559
This commit is contained in:
parent
920d588575
commit
98e9022c0e
@ -196,6 +196,7 @@ public class FrameDropTest {
|
|||||||
@Override
|
@Override
|
||||||
public void onError(VideoFrameProcessingException exception) {
|
public void onError(VideoFrameProcessingException exception) {
|
||||||
videoFrameProcessingExceptionReference.set(exception);
|
videoFrameProcessingExceptionReference.set(exception);
|
||||||
|
videoFrameProcessorReadyCountDownLatch.countDown();
|
||||||
videoFrameProcessingEndedCountDownLatch.countDown();
|
videoFrameProcessingEndedCountDownLatch.countDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,14 +243,22 @@ public class FrameDropTest {
|
|||||||
frameDropEffect),
|
frameDropEffect),
|
||||||
new FrameInfo.Builder(BLANK_FRAME_WIDTH, BLANK_FRAME_HEIGHT).build());
|
new FrameInfo.Builder(BLANK_FRAME_WIDTH, BLANK_FRAME_HEIGHT).build());
|
||||||
videoFrameProcessorReadyCountDownLatch.await();
|
videoFrameProcessorReadyCountDownLatch.await();
|
||||||
|
checkNoVideoFrameProcessingExceptionIsThrown(videoFrameProcessingExceptionReference);
|
||||||
blankFrameProducer.produceBlankFrames(inputPresentationTimesUs);
|
blankFrameProducer.produceBlankFrames(inputPresentationTimesUs);
|
||||||
defaultVideoFrameProcessor.signalEndOfInput();
|
defaultVideoFrameProcessor.signalEndOfInput();
|
||||||
videoFrameProcessingEndedCountDownLatch.await();
|
videoFrameProcessingEndedCountDownLatch.await();
|
||||||
|
checkNoVideoFrameProcessingExceptionIsThrown(videoFrameProcessingExceptionReference);
|
||||||
|
return actualPresentationTimesUs.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void checkNoVideoFrameProcessingExceptionIsThrown(
|
||||||
|
AtomicReference<@NullableType VideoFrameProcessingException>
|
||||||
|
videoFrameProcessingExceptionReference)
|
||||||
|
throws Exception {
|
||||||
@Nullable
|
@Nullable
|
||||||
Exception videoFrameProcessingException = videoFrameProcessingExceptionReference.get();
|
Exception videoFrameProcessingException = videoFrameProcessingExceptionReference.get();
|
||||||
if (videoFrameProcessingException != null) {
|
if (videoFrameProcessingException != null) {
|
||||||
throw videoFrameProcessingException;
|
throw videoFrameProcessingException;
|
||||||
}
|
}
|
||||||
return actualPresentationTimesUs.build();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user