Skip to content Skip to sidebar Skip to footer

Why Does Flash Drives App In Stack? Control_ae_mode_on_always_flash Camera2api

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 o

Solution 1:

Eventually i found solution

As i said method

protectedfinalvoidsetAutoFlash(CaptureRequest.Builder requestBuilder){
    if (isFlashSupported) {
        requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);
    }
}

invoked in three different places in code.

  1. captureStillPicture()
  2. unlockFocus()
  3. onConfigured()

So i implemented this line requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH); locally in each method.

Finally that i get :

  1. unlockFocus() -> mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH);
  2. onConfigured() -> mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH);

and for this method remained auto settings

  1. captureStillPicture() -> captureBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);

But i don't know the reason why i got such issue... If someone know the reason please let me know.

Post a Comment for "Why Does Flash Drives App In Stack? Control_ae_mode_on_always_flash Camera2api"