pull/696/head
Mattia Iavarone 6 years ago
parent 5005c1eb3c
commit a9beb8a7f8
  1. 6
      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() { public void onVideoRecordingEnd() {
super.onVideoRecordingEnd(); super.onVideoRecordingEnd();
// SnapshotRecorder will invoke this on its own thread which is risky, but if it was a // 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) && boolean needsIssue549Workaround = (mVideoRecorder instanceof Full2VideoRecorder) &&
(readCharacteristic(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL, -1) (readCharacteristic(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL, -1)
== CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY); == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY);
if (needsIssue549Workaround) { if (needsIssue549Workaround) {
LOG.w("Applying the Issue549 workaround.", Thread.currentThread()); LOG.w("Applying the Issue549 workaround.", Thread.currentThread());
maybeRestorePreviewTemplateAfterVideo(); 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!");
} }
} }

Loading…
Cancel
Save