Nexus 4 camera flash doesn't fire when focus mode is set to continuous-picture

爱⌒轻易说出口 提交于 2019-12-05 10:21:55

(For what it's worth just wrapping up my comment in an answer.)

The reason I suspect that continuous focus doesn't work on the Nexus 4 is that I have heard some rumblings from the Barcode Scanner user base about this (I'm the author). The Nexus 4 doesn't seem to work with, or without continuous focus enabled.

I haven't seen more detail to confirm/deny this, but, I have certainly seen this exact form of problem on other devices. In particular the Galaxy S2 seems to have some bad focus bugs.

It manifests as something slightly different: there is some third parameter you are setting which should be supported, or says it's supported, but actually causes the driver to barf. Then it doesn't honor the focus or torch setting. It may be that continuous focus, and torch, work. But a third setting is tripping it up.

Look into the logcat output. You should see debug messages from the driver. The exact nature depends a lot on the firmware. But in cases like this you will likely see errors in the driver. I usually see "unsupported parameter X" and cryptic numbers; sometimes it's much clearer about what it didn't like.

This may give you a lead, that it is in fact something like scene mode or metering area that are the problem. (And I have seen each of those cause this problem on at least one device.)

I also have a Galaxy Nexus and have never observed any problems of this form on it.

I'll also say that continuous focus can work nicely on some devices; it is worse on some devices like my old Desire HD, than the simple auto-focus mode. YMMV; I concluded it wasn't necessarily helpful so made regular auto focus the default in Barcode Scanner.

There are lot of issues on camera on Nexsus 4.

Firstly please try parameters.getSupportedFocusModes()

To restore continues autofocus, just call "cancelAutoFocus()" on the camera in your "AutoFocusCallback.java",

{
if (autoFocusHandler != null) {
  camera.cancelAutoFocus(); 
  ...
}

This call has no effect if the focus mode is "FOCUS_MODE_AUTO", because the the autofocus is finished anyway when onAutoFocus() gets called. But it restores the continuous autofocus when "FOCUS_MODE_CONTINUOUS_PICTURE" is used.

Hope it helps.I will work more and update.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!