diff options
author | Timothy Knight <tknight@google.com> | 2014-07-15 17:54:33 -0700 |
---|---|---|
committer | Timothy Knight <tknight@google.com> | 2014-07-15 17:54:33 -0700 |
commit | e0e93e2e6b9a4042bfb8e2914481b9514cdd81fe (patch) | |
tree | ceac92a067fb9908b30bed0e3d69591382fc45f4 /apps | |
parent | f5bf85348b5c20949426ef32050c48319b46efc4 (diff) | |
download | pdk-e0e93e2e6b9a4042bfb8e2914481b9514cdd81fe.tar.gz |
CameraITS: Fixed bug in 3A image size querying, and added extra logging
Change-Id: I8fedd7ff66ffc869ec849b501aebde8af90d6ba0
Diffstat (limited to 'apps')
-rw-r--r-- | apps/CameraITS/service/src/com/android/camera2/its/ItsService.java | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/apps/CameraITS/service/src/com/android/camera2/its/ItsService.java b/apps/CameraITS/service/src/com/android/camera2/its/ItsService.java index 0f1d34e..7328cf2 100644 --- a/apps/CameraITS/service/src/com/android/camera2/its/ItsService.java +++ b/apps/CameraITS/service/src/com/android/camera2/its/ItsService.java @@ -590,8 +590,7 @@ public class ItsService extends Service implements SensorEventListener { // Get the converged values for each "A", and package into JSON result for caller. // 3A happens on full-res frames. - Size sizes[] = mCameraCharacteristics.get( - CameraCharacteristics.SCALER_AVAILABLE_JPEG_SIZES); + Size sizes[] = ItsUtils.getYuvOutputSizes(mCameraCharacteristics); int widths[] = new int[1]; int heights[] = new int[1]; int formats[] = new int[1]; @@ -1024,24 +1023,31 @@ public class ItsService extends Service implements SensorEventListener { )); } - if (mConvergedAWB && result.get(CaptureResult.COLOR_CORRECTION_GAINS) != null - && result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM) != null) { - mSocketRunnableObj.sendResponse("awbResult", String.format( - "%f %f %f %f %f %f %f %f %f %f %f %f %f", - result.get(CaptureResult.COLOR_CORRECTION_GAINS).getRed(), - result.get(CaptureResult.COLOR_CORRECTION_GAINS).getGreenEven(), - result.get(CaptureResult.COLOR_CORRECTION_GAINS).getGreenOdd(), - result.get(CaptureResult.COLOR_CORRECTION_GAINS).getBlue(), - r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(0,0)), - r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(0,1)), - r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(0,2)), - r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(1,0)), - r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(1,1)), - r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(1,2)), - r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(2,0)), - r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(2,1)), - r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(2,2)) - )); + if (mConvergedAWB) { + if (result.get(CaptureResult.COLOR_CORRECTION_GAINS) != null + && result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM) != null) { + mSocketRunnableObj.sendResponse("awbResult", String.format( + "%f %f %f %f %f %f %f %f %f %f %f %f %f", + result.get(CaptureResult.COLOR_CORRECTION_GAINS).getRed(), + result.get(CaptureResult.COLOR_CORRECTION_GAINS).getGreenEven(), + result.get(CaptureResult.COLOR_CORRECTION_GAINS).getGreenOdd(), + result.get(CaptureResult.COLOR_CORRECTION_GAINS).getBlue(), + r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(0,0)), + r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(0,1)), + r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(0,2)), + r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(1,0)), + r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(1,1)), + r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(1,2)), + r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(2,0)), + r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(2,1)), + r2f(result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM).getElement(2,2)) + )); + } else { + Log.i(TAG, String.format( + "AWB converged but NULL color correction values, gains:%b, ccm:%b", + result.get(CaptureResult.COLOR_CORRECTION_GAINS) == null, + result.get(CaptureResult.COLOR_CORRECTION_TRANSFORM) == null)); + } } if (mIssuedRequest3A) { |