Switch Flash In Camera2 Api
My problem is when I switch between different flashmodes and then want to capture an image, my captureBuilder won't set the chosen flashmode. It only works when i close and reopen
Solution 1:
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:
- Set preview flash mode to desired mode
- Wait for user to hit the shutter button
- Issue single preview request with precapture trigger set (but keep preview request on repeat otherwise).
- Wait for AE_STATE_PRECAPTURE to stop being the AE state in your capture results
- Issue the final capture request (keep the same flash mode)
- Get final JPEG in your ImageReader
(This ignores ensuring focus is good, which generally is done before/in parallel to starting the precapture sequence)
Post a Comment for "Switch Flash In Camera2 Api"