Reputation: 5
So basically I want to get the focus distance of lens when the focus mode is AUTO.
Currently I am working like this:
Assuming CONTROL_AF_MODE
is set to CONTROL_AF_MODE_AUTO
by default.
Trying to get CaptureRequest.LENS_FOCUS_DISTANCE
which returns 0.0
on NEXUS 5 virtual device and null
on Redmi Note 3.
Is it the correct logic?
Upvotes: 0
Views: 492
Reputation: 6532
Generally the logic is correct. Just check a few details:
CONTROL_AF_STATE
is at least not CONTROL_AF_STATE_INACTIVE
. Most likely you need to wait until it's actually focused.Also note the type of this value is different on different devices. Check LENS_INFO_FOCUS_DISTANCE_CALIBRATION to find out if it's a real distance or just some synthetic value.
Upvotes: 1