I don't think that the camera2 library has such an API. However, you can calculate the difference between your ISO and exposure values, and the algorithmic ones.
Follow the below steps:
- While setting the preview, you put your custom capture callback :
this.previewCaptureSession.setRepeatingRequest(previewSession.build(),
customCaptureCallback, this.cameraHandler);
- In the custom call back you can enquire the ISO and exposure values that the algorithm calculates by looking at the current preview
CameraCaptureSession.CaptureCallback customCaptureCallback = new CameraCaptureSession.CaptureCallback() {
@Override
public void onCaptureCompleted(@NonNull CameraCaptureSession session,
@NonNull CaptureRequest request,
@NonNull TotalCaptureResult result) {
super.onCaptureCompleted(session, request, result);
//you can store the values of these two below variables however you want
final Long exposureValue = result.get(CaptureResult.SENSOR_EXPOSURE_TIME);
final Integer isoValue = result.get(CaptureResult.SENSOR_SENSITIVITY);
}
}
- You got the current ISO and exposure, now you can just compare it with the user given ISO and exposure value