|
|
@ -418,7 +418,7 @@ public class IntegrationTest extends BaseTest { |
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testEndVideo_withMaxSize() { |
|
|
|
public void testEndVideo_withMaxSize() { |
|
|
|
camera.setMode(Mode.VIDEO); |
|
|
|
camera.setMode(Mode.VIDEO); |
|
|
|
camera.setVideoMaxSize(500*1000); // 0.5 mb
|
|
|
|
camera.setVideoMaxSize(3000*1000); // Less is risky
|
|
|
|
waitForOpen(true); |
|
|
|
waitForOpen(true); |
|
|
|
waitForVideoStart(); |
|
|
|
waitForVideoStart(); |
|
|
|
waitForVideoEnd(true); |
|
|
|
waitForVideoEnd(true); |
|
|
@ -605,12 +605,7 @@ public class IntegrationTest extends BaseTest { |
|
|
|
// Ensure that freeze/release cycles do not cause OOMs.
|
|
|
|
// Ensure that freeze/release cycles do not cause OOMs.
|
|
|
|
// There was a bug doing this and it might resurface for any improper
|
|
|
|
// There was a bug doing this and it might resurface for any improper
|
|
|
|
// disposal of the frames.
|
|
|
|
// disposal of the frames.
|
|
|
|
FrameProcessor source = new FrameProcessor() { |
|
|
|
FrameProcessor source = new FreezeReleaseFrameProcessor(); |
|
|
|
@Override |
|
|
|
|
|
|
|
public void process(@NonNull Frame frame) { |
|
|
|
|
|
|
|
frame.freeze().release(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
FrameProcessor processor = spy(source); |
|
|
|
FrameProcessor processor = spy(source); |
|
|
|
camera.addFrameProcessor(processor); |
|
|
|
camera.addFrameProcessor(processor); |
|
|
|
waitForOpen(true); |
|
|
|
waitForOpen(true); |
|
|
@ -618,5 +613,12 @@ public class IntegrationTest extends BaseTest { |
|
|
|
assert30Frames(processor); |
|
|
|
assert30Frames(processor); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class FreezeReleaseFrameProcessor implements FrameProcessor { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void process(@NonNull Frame frame) { |
|
|
|
|
|
|
|
frame.freeze().release(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//endregion
|
|
|
|
//endregion
|
|
|
|
} |
|
|
|
} |
|
|
|