summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjunjiez <junjiez@codeaurora.org>2016-12-02 10:10:43 +0800
committerjunjiez <junjiez@codeaurora.org>2016-12-02 11:01:47 +0800
commitf750280d42f4ad3a530874461d341d52778bec7f (patch)
tree6b74040ad745822221d913b3857f7ecb5c6adeb4
parenteba671dc09fd92c345868655f7a20571b09d1e95 (diff)
downloadandroid_packages_apps_Snap-f750280d42f4ad3a530874461d341d52778bec7f.tar.gz
android_packages_apps_Snap-f750280d42f4ad3a530874461d341d52778bec7f.tar.bz2
android_packages_apps_Snap-f750280d42f4ad3a530874461d341d52778bec7f.zip
napdragonCamera:Modify Clear-sight match rules
In some scenarios, exposure time will be longer and cause the timestamps not matched.Compare both SOF and EOF, discard the image pair when both the differences are bigger than defined Change-Id: I8b67bea5836df42226d9f0a70ea4937d01e0a26b CRs-Fixed: 1084329
-rwxr-xr-x[-rw-r--r--]src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java27
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 595df8122..6058403ce 100644..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();