0

I'm developing a camera app using the Android camera2 API, And I need the camera to have always the same configuration, like focus, white balance, exposure, etc.

I already disabled AF, AE and AWB, but it still seems to automatically set the white balance. I was wondering if is there some other automatic configuration I should disable.

I didn't find anything like it on Google.

Captain Obvlious
  • 19,754
  • 5
  • 44
  • 74
  • For AWB, did you use a mode like SHADE or TWILIGHT or did you set it to CONTROL_AWB_MODE_OFF? – BSMP Feb 01 '16 at 19:32
  • I did set it to CONTROL_AWB_MODE_OFF, all I did so far actually was to set CONTROL_AF_MODE_OFF, CONTROL_AE_MODE_OFF and CONTROL_AWB_MODE_OFF, is it necessary that I set an value to focus, exposure and white balance? – Gabriel Carraro Feb 01 '16 at 23:32
  • I wouldn't have thought so. I thought I had something for this but it looks like I don't. – BSMP Feb 02 '16 at 02:04
  • :/ thanks for trying anyway – Gabriel Carraro Feb 02 '16 at 02:47

1 Answers1

0

i just ran into the same issue... In my case it turned out, that there was a function in the template i was using, which reset the control mode to automatic.

protected void updatePreview() {
    if(null == cameraDevice) {
        Log.e(TAG, "updatePreview error, return");
    }
    captureRequestBuilder.set(CaptureRequest.CONTROL_MODE, CameraMetadata.CONTROL_MODE_AUTO);
    try {
        cameraCaptureSessions.setRepeatingRequest(captureRequestBuilder.build(), null, mBackgroundHandler);
    } catch (CameraAccessException e) {
        e.printStackTrace();
    }
}