google / cameraview

[DEPRECATED] Easily integrate Camera features into your Android app
Apache License 2.0
4.74k stars 1.03k forks source link

PictureCaptureCallback waits for focus but it never happens #40

Open skywall opened 7 years ago

skywall commented 7 years ago

Version: d0b508a5ea Affected device: HTC One M9 API: 23

Hi, I'm having some issues with taking picture on device mentioned above. The problem occurs when picture is taken and camera is not auto-focused. process() method of PictureCaptureCallback class is called as expected, but condition

if (af == CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED ||
     af == CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED) {
   //...   
}

is never satisfied. capture() request is set as expected with CONTROL_AF_TRIGGER flag. If i turn autofocus off via setAutoFocus(false), everything works fine.

I think this is Camera2 API issue but maybe there is something I'm missing.

yaraki commented 7 years ago

Thank you for the report. I don't have that device with me, but I try to see if I can reproduce the issue on other devices.