summaryrefslogtreecommitdiffstats
path: root/camera2/utils/src/com
diff options
context:
space:
mode:
authorSol Boucher <solb@google.com>2014-08-25 11:42:50 -0700
committerSol Boucher <solb@google.com>2014-08-26 18:27:59 -0700
commit984a086412a94ebea1bd9af8cd8bbf4afab38034 (patch)
tree2f79b7886436c56a4ba619654ddfb4eba38493eb /camera2/utils/src/com
parentf27e71f979e803a3ac00f4057eb909886d957a3e (diff)
downloadandroid_frameworks_ex-984a086412a94ebea1bd9af8cd8bbf4afab38034.tar.gz
android_frameworks_ex-984a086412a94ebea1bd9af8cd8bbf4afab38034.tar.bz2
android_frameworks_ex-984a086412a94ebea1bd9af8cd8bbf4afab38034.zip
camera2-portability: Optimize out some camera2 AE precaptures
If it's already converged and the flash isn't being forced on, there's no need to force the precapture routine, which would delay our capture significantly. Also use onCaptureProgressed() instead of onCaptureCompleted() when possible. Change-Id: I0bb7956498b0070382cd5b39b7ccdc0cc0765913
Diffstat (limited to 'camera2/utils/src/com')
-rw-r--r--camera2/utils/src/com/android/ex/camera2/utils/Camera2RequestSettingsSet.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/camera2/utils/src/com/android/ex/camera2/utils/Camera2RequestSettingsSet.java b/camera2/utils/src/com/android/ex/camera2/utils/Camera2RequestSettingsSet.java
index fac8f1a..6e1d825 100644
--- a/camera2/utils/src/com/android/ex/camera2/utils/Camera2RequestSettingsSet.java
+++ b/camera2/utils/src/com/android/ex/camera2/utils/Camera2RequestSettingsSet.java
@@ -146,7 +146,7 @@ public class Camera2RequestSettingsSet {
* to its default value or simply unset. While {@link #get} will return
* {@code null} in both these cases, this method will return {@code true}
* and {@code false}, respectively.</p>
-
+ *
* @param key Which setting to look for.
* @return Whether that setting has a value that will propagate with unions.
*
@@ -160,8 +160,23 @@ public class Camera2RequestSettingsSet {
}
/**
+ * Check whether the value of the specified setting matches the given one.
+ *
+ * <p>This method uses the {@code T} type's {@code equals} method, but is
+ * {@code null}-tolerant.</p>
+ *
+ * @param key Which of this class's settings to check.
+ * @param value Value to test for equality against.
+ * @return Whether they are the same.
+ */
+ public <T> boolean matches(Key<T> key, T value) {
+ return Objects.equals(get(key), value);
+ }
+
+ /**
* Get this set of settings's revision identifier, which can be compared
* against cached past values to determine whether it has been modified.
+ *
* <p>Distinct revisions across the same object do not necessarily indicate
* that the object's key/value pairs have changed at all, but the same
* revision on the same object does imply that they've stayed the same.</p>