summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-03-25 13:02:27 +0100
committerMichael Bestas <mikeioannina@gmail.com>2017-01-04 22:00:39 +0200
commitcd438ce7c0379a84d8f453c5bf5e458a0bb69dd9 (patch)
tree82aaabc2c3af2a2e2db1a5fb103c4a913df4be12
parent60c675810105f384952aad682243265a189f38d9 (diff)
downloadandroid_packages_apps_Snap-cd438ce7c0379a84d8f453c5bf5e458a0bb69dd9.zip
android_packages_apps_Snap-cd438ce7c0379a84d8f453c5bf5e458a0bb69dd9.tar.gz
android_packages_apps_Snap-cd438ce7c0379a84d8f453c5bf5e458a0bb69dd9.tar.bz2
Protect against multiple shutter callbacks per frame in longshot mode.
Some devices send multiple shutter callbacks for one captured frame in longshot mode. As this causes mismatch between the calculated number of captured frames and the calculated number of JPEGs received for those, which in turn leads to longshot mode never being ended properly, protect against that scenario by discarding all but the first callback. Change-Id: I0c3a270f664a0cd16354fb0a13c5941a52001650
-rwxr-xr-xsrc/com/android/camera/PhotoModule.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index e46c323..ab0dd83 100755
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1060,6 +1060,11 @@ public class PhotoModule
private final class LongshotShutterCallback
implements CameraShutterCallback {
+ private int mExpectedLongshotSnapNum;
+
+ public LongshotShutterCallback() {
+ mExpectedLongshotSnapNum = mLongshotSnapNum;
+ }
@Override
public void onShutter(CameraProxy camera) {
@@ -1067,6 +1072,9 @@ public class PhotoModule
mShutterLag = mShutterCallbackTime - mCaptureStartTime;
Log.e(TAG, "[KPI Perf] PROFILE_SHUTTER_LAG mShutterLag = " + mShutterLag + "ms");
synchronized(mCameraDevice) {
+ if (mExpectedLongshotSnapNum != mLongshotSnapNum) {
+ return;
+ }
if (++mLongshotSnapNum >= mLongShotMaxSnap &&
(mLongShotMaxSnap != -1)) {