Switch flash in Camera2 API

烈酒焚心 提交于 2019-12-01 19:08:16

You want to update the flash mode in your preview request as well; generally the camera device wants to know your desired flash mode when you trigger the precapture sequence (with AE_PRECAPTURE_TRIGGER), so that it knows if it should turn on the precapture flash, which it needs to determine the final flash power.

The usual sequence of events is:

  1. Set preview flash mode to desired mode
  2. Wait for user to hit the shutter button
  3. Issue single preview request with precapture trigger set (but keep preview request on repeat otherwise).
  4. Wait for AE_STATE_PRECAPTURE to stop being the AE state in your capture results
  5. Issue the final capture request (keep the same flash mode)
  6. Get final JPEG in your ImageReader

(This ignores ensuring focus is good, which generally is done before/in parallel to starting the precapture sequence)

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