Following camera2basic guide on Android L preview page, I am able to capture normal images, i.e. without flash or using auto-focus mechanism (I rely on passive focus)
However, I would like to take a flash image. The documentation states before taking flash image, I should call android.control.aePrecaptureTrigger to determine correct exposure.
My question:
- How can I call AE Precapture trigger, wait for it to complete and then take the image using capture(CaptureRequest, CameraCaptureSession.CaptureListener, Handler)?
Method I've already tried:
- After user clicks capture image button, I start a preview
- Set CONTROL_AE_PRECAPTURE_TRIGGER to CONTROL_AE_PRECAPTURE_TRIGGER_START
- Monitor AE_STATE result in CaptureListener's onCaptureCompleted method
- When AE_STATE converges, I set AE lock and take image using capture() method
However, the flash image is still over-exposed and sometimes, I get complete garbage image.
Has anyone able to get this working?
Once this is working, auto-focus mechanism can be used in similar fashion.
Thanks