Manual exposure change for Android Camera2 API

According to the google team's official statement, on Android 5.1, the CONTROL_AE_EXPOSURE_COMPENSATION change is broken. I've been looking for a workaround for a few days now and the only one I've found is related to SENSOR_INFO_SENSITIVITY_RANGE. However, I found some difficulty in using it. My code looks like this:

if(!modeDisabled){
                    mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_OFF);
                    modeDisabled=true;
                }
                range1 = characteristics.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE);
                minmin = range1.getLower();
                maxmax = range1.getUpper();
                int iso = ((i * (maxmax - minmin)) / 100 + minmin);
                mPreviewRequestBuilder.set(CaptureRequest.SENSOR_SENSITIVITY, iso);


mCaptureSession.setRepeatingRequest(mPreviewRequestBuilder.build(), null, mBackgroundHandler);

      

Of course the "i" value is the progress value taken from the search bar and each close is closed by the OnProgressChanged function.

The problem is there is no visible change when manipulating the search bar. I would be very grateful for any help.

+3


source to share


1 answer


CONTROL_AE_EXPOSURE_COMPENSATION is not broken in Android 5.1 in general, it was only disabled on Nexus 6 (and will be enabled again in a future update).

If you disable auto exposure, you also need to set the exposure time in addition to the sensitivity. You would also prefer to set the frame duration, although the defaults for both are probably 1 / 30s, which is reasonable. You can also copy the latest values ​​for those who received the most recent capture result that you automatically exposed.



However, you should still see some changes. Is it possible that you are rewriting your grab request elsewhere immediately after setting it as a re-request? You can check the returned capture results to see what is the sensitivity setting that the camera device accepts.

+1


source







All Articles