In android.hardware.Camera
old, I use code below get current Exposure and get it for Camera
Camera.Parameters param = mCamera.getParameters();
currentExposure += param.getExposureCompensationStep();
param.setExposureCompensation((int) currentExposure);
Timber.d("exposure:" + currentExposure);
mCamera.setParameters(param);
How to use it for Camera2
API new. Please. Help me!
Try this for Camera Characteristics.
mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP);
Try this
Range<Long> range = mCameraCharacteristics.get(CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE);
In camera 2 api you have to define camera manger
private android.hardware.camera2.CameraManager manager;
//better to add inside constructor
manager = (android.hardware.camera2.CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
Next steps You can get camera characteristics like this
for (String cameraId : manager.getCameraIdList()) {
CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraId);
//get camera mode
Integer facing = characteristics.get(CameraCharacteristics.LENS_FACING);
//getting Stream configuration
StreamConfigurationMap map = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
}