Fix auto focus callback

pull/524/head
Mattia Iavarone 6 years ago
parent 70db8763c4
commit 22afd5efed
  1. 4
      cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java

@ -1255,8 +1255,8 @@ public class Camera2Engine extends CameraEngine implements ImageReader.OnImageAv
private void onAutoFocusCapture(@NonNull CaptureResult result) { private void onAutoFocusCapture(@NonNull CaptureResult result) {
Integer afState = result.get(CaptureResult.CONTROL_AF_STATE); Integer afState = result.get(CaptureResult.CONTROL_AF_STATE);
if (afState == null) { if (afState == null) {
LOG.e("onAutoFocusCapture", "afState is null! Assuming AF failed."); LOG.i("onAutoFocusCapture", "afState is null! This can happen for partial results. Waiting.");
afState = CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED; return;
} }
switch (afState) { switch (afState) {
case CaptureRequest.CONTROL_AF_STATE_FOCUSED_LOCKED: { case CaptureRequest.CONTROL_AF_STATE_FOCUSED_LOCKED: {

Loading…
Cancel
Save