summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-07-20 17:13:40 -0700
committerSteve Kondik <steve@cyngn.com>2016-08-21 18:46:32 -0700
commit3e6915220f73e5884d7306baf1ad80dc8ab18f5b (patch)
tree5d13582120be6a948d334be9d3f3e6fa8d100f77
parentc0a0f6e79d08b0eb53e14b6eb0f5c2781bb9e67c (diff)
downloadandroid_packages_apps_Snap-3e6915220f73e5884d7306baf1ad80dc8ab18f5b.zip
android_packages_apps_Snap-3e6915220f73e5884d7306baf1ad80dc8ab18f5b.tar.gz
android_packages_apps_Snap-3e6915220f73e5884d7306baf1ad80dc8ab18f5b.tar.bz2
SnapdragonCamera: Update API call for clearsight lib upgrade.
Update processImage API call to coincide with lib upgrade. CRs-Fixed: 993611 Change-Id: Ie3be9b1a586dcc1e50da626f49349cab617ce27e
-rw-r--r--src/org/codeaurora/snapcam/filter/ClearSightNativeEngine.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/org/codeaurora/snapcam/filter/ClearSightNativeEngine.java b/src/org/codeaurora/snapcam/filter/ClearSightNativeEngine.java
index f2793c8..18e7671 100644
--- a/src/org/codeaurora/snapcam/filter/ClearSightNativeEngine.java
+++ b/src/org/codeaurora/snapcam/filter/ClearSightNativeEngine.java
@@ -35,6 +35,7 @@ import java.util.ArrayList;
import java.util.List;
import android.graphics.Rect;
+import android.hardware.camera2.CaptureResult;
import android.hardware.camera2.TotalCaptureResult;
import android.media.Image;
import android.media.Image.Plane;
@@ -256,13 +257,20 @@ public class ClearSightNativeEngine {
Log.d(TAG, "processImage - dst size - y: "
+ dstY.capacity() + " vu: " + dstVU.capacity());
+ int iso = mRefMonoResult.get(CaptureResult.SENSOR_SENSITIVITY);
+ long exposure = mRefMonoResult.get(CaptureResult.SENSOR_EXPOSURE_TIME);
+ // capture result stores exposure time in NS and we need MS.
+ exposure /= 100000;
+
+ Log.d(TAG, "processImage - iso: " + iso + " exposure ms: " + exposure);
boolean result = nativeClearSightProcess(numImages, srcColorY, srcColorVU,
metadataColor, mRefColorImage.getWidth(),
mRefColorImage.getHeight(),
colorPlanes[Y_PLANE].getRowStride(),
colorPlanes[VU_PLANE].getRowStride(), srcMonoY, metadataMono,
mRefMonoImage.getWidth(), mRefMonoImage.getHeight(),
- monoPlanes[Y_PLANE].getRowStride(), mOtpCalibData, dstY, dstVU,
+ monoPlanes[Y_PLANE].getRowStride(), mOtpCalibData,
+ (int)exposure, iso, dstY, dstVU,
colorPlanes[Y_PLANE].getRowStride(),
colorPlanes[VU_PLANE].getRowStride(), roiRect);
@@ -287,8 +295,8 @@ public class ClearSightNativeEngine {
int[][] metadataColor, int srcColorWidth, int srcColorHeight,
int srcColorStrideY, int srcColorStrideVU, ByteBuffer[] srcMonoY,
int[][] metadataMono, int srcMonoWidth, int srcMonoHeight,
- int srcMonoStrideY, byte[] otp, ByteBuffer dstY, ByteBuffer dstVU,
- int dstStrideY, int dstStrideVU, int[] roiRect);
+ int srcMonoStrideY, byte[] otp, int exposureMs, int iso,
+ ByteBuffer dstY, ByteBuffer dstVU, int dstStrideY, int dstStrideVU, int[] roiRect);
private class SourceImage {
ByteBuffer mY;