diff options
author | Camera Software Integration <camswint@localhost> | 2016-12-11 04:22:04 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-12-11 04:22:04 -0800 |
commit | 48e03108084542ced798bf02be3543dbd9cacd6c (patch) | |
tree | 261b9521f199c0f8d68105fd3fc3a6d952d5f841 /src/org/codeaurora/snapcam | |
parent | 226050b27d2c7355993a8fff493e17084278d1ea (diff) | |
parent | f750280d42f4ad3a530874461d341d52778bec7f (diff) | |
download | android_packages_apps_Snap-48e03108084542ced798bf02be3543dbd9cacd6c.tar.gz android_packages_apps_Snap-48e03108084542ced798bf02be3543dbd9cacd6c.tar.bz2 android_packages_apps_Snap-48e03108084542ced798bf02be3543dbd9cacd6c.zip |
Merge "napdragonCamera:Modify Clear-sight match rules" into camera.lnx.1.0-dev.1.0
Diffstat (limited to 'src/org/codeaurora/snapcam')
-rwxr-xr-x | src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java index f1a082f75..bd54dc76a 100755 --- a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java +++ b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java @@ -52,6 +52,7 @@ import android.hardware.camera2.CameraDevice; import android.hardware.camera2.CameraManager; import android.hardware.camera2.CaptureFailure; import android.hardware.camera2.CaptureRequest; +import android.hardware.camera2.CaptureResult; import android.hardware.camera2.TotalCaptureResult; import android.hardware.camera2.params.InputConfiguration; import android.hardware.camera2.params.StreamConfigurationMap; @@ -623,18 +624,26 @@ public class ClearSightImageProcessor { ReprocessableImage bayer = mBayerFrames.peek(); ReprocessableImage mono = mMonoFrames.peek(); + long bayerTsSOF = bayer.mCaptureResult.get(CaptureResult.SENSOR_TIMESTAMP); + long bayerTsEOF = bayerTsSOF + bayer.mCaptureResult.get( + CaptureResult.SENSOR_EXPOSURE_TIME); + long monoTsSOF = mono.mCaptureResult.get(CaptureResult.SENSOR_TIMESTAMP); + long monoTsEOF = monoTsSOF + mono.mCaptureResult.get( + CaptureResult.SENSOR_EXPOSURE_TIME); + + Log.d(TAG, - "checkForValidFramePair - bayer ts: " - + bayer.mImage.getTimestamp() + " mono ts: " - + mono.mImage.getTimestamp()); + "checkForValidFramePair - bayer ts SOF: " + + bayerTsSOF + ", EOF: " + bayerTsEOF + + ", mono ts SOF: " + monoTsSOF + ", EOF: " + monoTsEOF); Log.d(TAG, - "checkForValidFramePair - difference: " - + Math.abs(bayer.mImage.getTimestamp() - - mono.mImage.getTimestamp())); + "checkForValidFramePair - difference SOF: " + + Math.abs(bayerTsSOF - monoTsSOF) + + ", EOF: " + Math.abs(bayerTsEOF - monoTsEOF)); // if timestamps are within threshold, keep frames - if (Math.abs(bayer.mImage.getTimestamp() - - mono.mImage.getTimestamp()) > mTimestampThresholdNs) { - if(bayer.mImage.getTimestamp() > mono.mImage.getTimestamp()) { + if ((Math.abs(bayerTsSOF - monoTsSOF) > mTimestampThresholdNs) && + (Math.abs(bayerTsEOF - monoTsEOF) > mTimestampThresholdNs)) { + if(bayerTsSOF > monoTsSOF) { Log.d(TAG, "checkForValidFramePair - toss mono"); // no match, toss mono = mMonoFrames.poll(); |