There is weird situation. I took standard google sample camera2API
.
I need that flash is worked permanently, regardless of outside light.
In order to accomplish it i have changed one line of code:
private void setAutoFlash(CaptureRequest.Builder requestBuilder) {
if (mFlashSupported) {
// requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);
requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH);
}
}
It was CONTROL_AE_MODE_ON_AUTO_FLASH
i have changed it to CONTROL_AE_MODE_ON_ALWAYS_FLASH
.
And i have faced with issue, when i click Take picture button, camera is flashing and that is it. App goes to stack...
What am i doing wrong?
EDIT
I figure out next:
i have tryed tern on flash on three different device Meizu MX5
, Samsung S5
and Samsung S6
.
Two of them Meizu MX5
, Samsung S5
work correctly with code above and app doesn't drives in stack.
Problem occur with Samsung S6
, BUT ...
Method setAutoFlash()
invokes within code 3 times in different places
captureStillPicture()
unlockFocus()
onConfigured()
And trick is if i disable setAutoFlash()
in captureStillPicture()
for Samsung S6
it is stop stacking and flash begins to works but if i try this approach for Meizu MX5
, Samsung S5
flash doesn't works...