-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BarcodeDetector.Builder.setAutoFocusEnabled(true) not working on Nexus 4 #48
Comments
Use the |
There's no setFocusMode(String mode) method in official CameraSource.Builder according to this link: https://developers.google.com/android/reference/com/google/android/gms/vision/CameraSource.Builder |
Yes. The official API provides setAutoFocusEnabled instead, which sets the focus mode to FOCUS_MODE_CONTINUOUS_VIDEO. |
And that's the problem. Should be FOCUS_MODE_CONTINUOUS_PICTURE instead or new API version should have methods like in visionSamples. |
I am seeing the same freaking problem, if I use the VisionSamples which is outdated compare to the latest API version, it works just fine but per the new API it doesn't work. Someone at google please talk to us or update your documentation on how to make the Focus and Flash work with new version of this Barcode API, please.... ??? |
I'm seeing this same error, did anybody find a solution or a workaround for this? |
Anybody got the solution for this, pls share. |
I've been having this issue with a number of phones. Some focus just fine, others don't focus at all. I was able to work around this by manipulating the properties of the underlying camera manually after vision has started.
setFocus is called after everything else has been loaded, and the camera has started looking for barcodes. The postDelayed is because some devices don't seem to set the focus mode if it's too soon after initialization. Anyway, the above isn't a great solution, but it makes vision usable again on my older test devices. Vision works fine as-is on a Pixel, but not so great on a 5 year old Samsung. |
In Google Play Services 8.3 CameraSource class you use Camera.setFocusMode("continuous-video").
This mode is invalid for most of the devices on the market (including Nexus 4). It doesn't work in preview mode - ONLY when taking video.
Use Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE or give us an option to set focus mode just like in: https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/ui/camera/CameraSource.java
The text was updated successfully, but these errors were encountered: