Chromium Code Reviews| Index: media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java |
| diff --git a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java b/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java |
| index ce5785ea0935c16bfa79b480360bddc2efb460ea..77ce4f25fa2cd27e218d02bb4a8a105fd3359523 100644 |
| --- a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java |
| +++ b/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java |
| @@ -367,7 +367,7 @@ public abstract class VideoCaptureCamera |
| if (parameters.isZoomSupported()) { |
| // The Max zoom is returned as x100 by the API to avoid using floating point. |
|
Reilly Grant (use Gerrit)
2016/11/09 21:16:55
Comment is out of date.
mcasas
2016/11/09 22:44:14
Oops done, thanks.
|
| maxZoom = parameters.getZoomRatios().get(parameters.getMaxZoom()); |
| - currentZoom = 100 + 100 * parameters.getZoom(); |
| + currentZoom = parameters.getZoomRatios().get(parameters.getZoom()); |
| minZoom = parameters.getZoomRatios().get(0); |
| if (parameters.getZoomRatios().size() > 1) { |
| stepZoom = parameters.getZoomRatios().get(1) - parameters.getZoomRatios().get(0); |
| @@ -407,13 +407,10 @@ public abstract class VideoCaptureCamera |
| builder.setExposureMode(jniExposureMode); |
| final float step = parameters.getExposureCompensationStep(); |
| - builder.setMinExposureCompensation( |
| - Math.round(parameters.getMinExposureCompensation() * step * 100)); |
| - builder.setMaxExposureCompensation( |
| - Math.round(parameters.getMaxExposureCompensation() * step * 100)); |
| - builder.setCurrentExposureCompensation( |
| - Math.round(parameters.getExposureCompensation() * step * 100)); |
| - builder.setStepExposureCompensation(Math.round(step * 100)); |
| + builder.setStepExposureCompensation(step); |
| + builder.setMinExposureCompensation(parameters.getMinExposureCompensation() * step); |
| + builder.setMaxExposureCompensation(parameters.getMaxExposureCompensation() * step); |
| + builder.setCurrentExposureCompensation(parameters.getExposureCompensation() * step); |
| int jniWhiteBalanceMode = AndroidMeteringMode.NONE; |
| if (parameters.isAutoWhiteBalanceLockSupported() |
| @@ -462,10 +459,11 @@ public abstract class VideoCaptureCamera |
| } |
| @Override |
| - public void setPhotoOptions(int zoom, int focusMode, int exposureMode, int width, int height, |
| - float[] pointsOfInterest2D, boolean hasExposureCompensation, int exposureCompensation, |
| - int whiteBalanceMode, int iso, boolean hasRedEyeReduction, boolean redEyeReduction, |
| - int fillLightMode, int colorTemperature) { |
| + public void setPhotoOptions(double zoom, int focusMode, int exposureMode, double width, |
| + double height, float[] pointsOfInterest2D, boolean hasExposureCompensation, |
| + double exposureCompensation, int whiteBalanceMode, double iso, |
| + boolean hasRedEyeReduction, boolean redEyeReduction, int fillLightMode, |
| + double colorTemperature) { |
| android.hardware.Camera.Parameters parameters = getCameraParameters(mCamera); |
| if (parameters.isZoomSupported() && zoom > 0) { |
| @@ -496,8 +494,8 @@ public abstract class VideoCaptureCamera |
| parameters.setAutoExposureLock(false); |
| } |
| } |
| - if (width > 0) mPhotoWidth = width; |
| - if (height > 0) mPhotoHeight = height; |
| + if (width > 0) mPhotoWidth = (int) Math.round(width); |
| + if (height > 0) mPhotoHeight = (int) Math.round(height); |
| // Upon new |zoom| configuration, clear up the previous |mAreaOfInterest| if any. |
| if (mAreaOfInterest != null && !mAreaOfInterest.rect.isEmpty() && zoom > 0) { |
| @@ -537,8 +535,8 @@ public abstract class VideoCaptureCamera |
| } |
| if (hasExposureCompensation) { |
| - final int unnormalizedExposureCompensation = Math.round( |
| - exposureCompensation / 100.0f / parameters.getExposureCompensationStep()); |
| + final int unnormalizedExposureCompensation = (int) Math.round( |
| + exposureCompensation / parameters.getExposureCompensationStep()); |
| parameters.setExposureCompensation(unnormalizedExposureCompensation); |
| } |
| @@ -553,8 +551,8 @@ public abstract class VideoCaptureCamera |
| } else if (whiteBalanceMode == AndroidMeteringMode.FIXED |
| && parameters.isAutoWhiteBalanceLockSupported()) { |
| parameters.setAutoWhiteBalanceLock(true); |
| - if (colorTemperature > 0) { |
| - final String closestSetting = getClosestWhiteBalance(colorTemperature); |
| + if (colorTemperature > 0.0) { |
| + final String closestSetting = getClosestWhiteBalance((int) colorTemperature); |
| if (closestSetting != null) parameters.setWhiteBalance(closestSetting); |
| } |
| } |