From a9beb8a7f8b5d75f4baede26d2fb8a3939834a2c Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Mon, 9 Dec 2019 12:52:48 +0100 Subject: [PATCH] Test --- .../com/otaliastudios/cameraview/engine/Camera2Engine.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java b/cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java index 8d30a8d9..fd88cda7 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java @@ -876,14 +876,16 @@ public class Camera2Engine extends CameraEngine implements ImageReader.OnImageAv public void onVideoRecordingEnd() { super.onVideoRecordingEnd(); // SnapshotRecorder will invoke this on its own thread which is risky, but if it was a - // snapshot, this function returns early so its safe. + // snapshot, this function does nothing so it's safe. boolean needsIssue549Workaround = (mVideoRecorder instanceof Full2VideoRecorder) && (readCharacteristic(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL, -1) == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY); if (needsIssue549Workaround) { LOG.w("Applying the Issue549 workaround.", Thread.currentThread()); maybeRestorePreviewTemplateAfterVideo(); - LOG.w("Applied the Issue549 workaround.", Thread.currentThread()); + LOG.w("Applied the Issue549 workaround. Sleeping..."); + try { Thread.sleep(600); } catch (InterruptedException ignore) {} + LOG.w("Applied the Issue549 workaround. Slept!"); } }