blob: e405ba6932e435387bc8cee1dc9ee28cd19ee025 [file] [log] [blame]
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Eino-Ville Talvala2f1a2e42013-07-25 17:12:05 -070017package android.hardware.camera2;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080018
Eino-Ville Talvala8b905572015-05-14 15:43:01 -070019import android.annotation.NonNull;
20import android.annotation.Nullable;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070021import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkin6c76f582014-07-15 17:19:49 -070022import android.hardware.camera2.impl.PublicKey;
23import android.hardware.camera2.impl.SyntheticKey;
Ruben Brunk5776aaf2014-06-19 13:42:40 -070024import android.hardware.camera2.utils.HashCodeHelpers;
Igor Murashkind6d65152014-05-19 16:31:02 -070025import android.hardware.camera2.utils.TypeReference;
Igor Murashkin70725502013-06-25 20:27:06 +000026import android.os.Parcel;
27import android.os.Parcelable;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080028import android.view.Surface;
29
Ruben Brunkfeb50af2014-05-09 19:58:49 -070030import java.util.Collection;
31import java.util.Collections;
Igor Murashkin70725502013-06-25 20:27:06 +000032import java.util.HashSet;
Igor Murashkind6d65152014-05-19 16:31:02 -070033import java.util.List;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -070034import java.util.Objects;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080035
36
37/**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070038 * <p>An immutable package of settings and outputs needed to capture a single
39 * image from the camera device.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080040 *
41 * <p>Contains the configuration for the capture hardware (sensor, lens, flash),
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070042 * the processing pipeline, the control algorithms, and the output buffers. Also
43 * contains the list of target Surfaces to send image data to for this
44 * capture.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080045 *
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070046 * <p>CaptureRequests can be created by using a {@link Builder} instance,
47 * obtained by calling {@link CameraDevice#createCaptureRequest}</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080048 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -070049 * <p>CaptureRequests are given to {@link CameraCaptureSession#capture} or
50 * {@link CameraCaptureSession#setRepeatingRequest} to capture images from a camera.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080051 *
52 * <p>Each request can specify a different subset of target Surfaces for the
53 * camera to send the captured data to. All the surfaces used in a request must
54 * be part of the surface list given to the last call to
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -070055 * {@link CameraDevice#createCaptureSession}, when the request is submitted to the
56 * session.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080057 *
58 * <p>For example, a request meant for repeating preview might only include the
59 * Surface for the preview SurfaceView or SurfaceTexture, while a
60 * high-resolution still capture would also include a Surface from a ImageReader
61 * configured for high-resolution JPEG images.</p>
62 *
Eino-Ville Talvala0aa2bde2015-05-19 17:25:54 -070063 * <p>A reprocess capture request allows a previously-captured image from the camera device to be
64 * sent back to the device for further processing. It can be created with
Eino-Ville Talvalabd7f34f2015-05-21 11:10:51 -070065 * {@link CameraDevice#createReprocessCaptureRequest}, and used with a reprocessable capture session
Eino-Ville Talvala0aa2bde2015-05-19 17:25:54 -070066 * created with {@link CameraDevice#createReprocessableCaptureSession}.</p>
67 *
68 * @see CameraCaptureSession#capture
69 * @see CameraCaptureSession#setRepeatingRequest
70 * @see CameraCaptureSession#captureBurst
71 * @see CameraCaptureSession#setRepeatingBurst
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070072 * @see CameraDevice#createCaptureRequest
Eino-Ville Talvala0aa2bde2015-05-19 17:25:54 -070073 * @see CameraDevice#createReprocessCaptureRequest
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080074 */
Igor Murashkind6d65152014-05-19 16:31:02 -070075public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
76 implements Parcelable {
77
78 /**
79 * A {@code Key} is used to do capture request field lookups with
80 * {@link CaptureResult#get} or to set fields with
81 * {@link CaptureRequest.Builder#set(Key, Object)}.
82 *
83 * <p>For example, to set the crop rectangle for the next capture:
84 * <code><pre>
85 * Rect cropRectangle = new Rect(0, 0, 640, 480);
86 * captureRequestBuilder.set(SCALER_CROP_REGION, cropRectangle);
87 * </pre></code>
88 * </p>
89 *
90 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
91 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
92 *
93 * @see CaptureResult#get
94 * @see CameraCharacteristics#getAvailableCaptureResultKeys
95 */
96 public final static class Key<T> {
97 private final CameraMetadataNative.Key<T> mKey;
98
99 /**
100 * Visible for testing and vendor extensions only.
101 *
102 * @hide
103 */
104 public Key(String name, Class<T> type) {
105 mKey = new CameraMetadataNative.Key<T>(name, type);
106 }
107
108 /**
109 * Visible for testing and vendor extensions only.
110 *
111 * @hide
112 */
113 public Key(String name, TypeReference<T> typeReference) {
114 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
115 }
116
117 /**
118 * Return a camelCase, period separated name formatted like:
119 * {@code "root.section[.subsections].name"}.
120 *
121 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
122 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
123 *
124 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
125 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
126 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
127 *
128 * @return String representation of the key name
129 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700130 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700131 public String getName() {
132 return mKey.getName();
133 }
134
135 /**
136 * {@inheritDoc}
137 */
138 @Override
139 public final int hashCode() {
140 return mKey.hashCode();
141 }
142
143 /**
144 * {@inheritDoc}
145 */
146 @SuppressWarnings("unchecked")
147 @Override
148 public final boolean equals(Object o) {
149 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
150 }
151
152 /**
153 * Visible for CameraMetadataNative implementation only; do not use.
154 *
155 * TODO: Make this private or remove it altogether.
156 *
157 * @hide
158 */
159 public CameraMetadataNative.Key<T> getNativeKey() {
160 return mKey;
161 }
162
163 @SuppressWarnings({ "unchecked" })
164 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
165 mKey = (CameraMetadataNative.Key<T>) nativeKey;
166 }
167 }
Igor Murashkin70725502013-06-25 20:27:06 +0000168
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700169 private final HashSet<Surface> mSurfaceSet;
170 private final CameraMetadataNative mSettings;
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700171 private boolean mIsReprocess;
Zhijun Hea7677722015-06-01 16:36:06 -0700172 // If this request is part of constrained high speed request list that was created by
173 // {@link CameraDevice#createConstrainedHighSpeedRequestList}.
174 private boolean mIsPartOfCHSRequestList = false;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700175 // Each reprocess request must be tied to a reprocessable session ID.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700176 // Valid only for reprocess requests (mIsReprocess == true).
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700177 private int mReprocessableSessionId;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700178
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700179 private Object mUserTag;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800180
181 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700182 * Construct empty request.
183 *
184 * Used by Binder to unparcel this object only.
Igor Murashkin70725502013-06-25 20:27:06 +0000185 */
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700186 private CaptureRequest() {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700187 mSettings = new CameraMetadataNative();
188 mSurfaceSet = new HashSet<Surface>();
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700189 mIsReprocess = false;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700190 mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800191 }
192
193 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700194 * Clone from source capture request.
195 *
196 * Used by the Builder to create an immutable copy.
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800197 */
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700198 @SuppressWarnings("unchecked")
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700199 private CaptureRequest(CaptureRequest source) {
200 mSettings = new CameraMetadataNative(source.mSettings);
201 mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone();
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700202 mIsReprocess = source.mIsReprocess;
Zhijun Hea7677722015-06-01 16:36:06 -0700203 mIsPartOfCHSRequestList = source.mIsPartOfCHSRequestList;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700204 mReprocessableSessionId = source.mReprocessableSessionId;
Eino-Ville Talvala7b01c5c2013-10-08 19:34:29 -0700205 mUserTag = source.mUserTag;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800206 }
207
208 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700209 * Take ownership of passed-in settings.
210 *
211 * Used by the Builder to create a mutable CaptureRequest.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700212 *
213 * @param settings Settings for this capture request.
214 * @param isReprocess Indicates whether to create a reprocess capture request. {@code true}
215 * to create a reprocess capture request. {@code false} to create a regular
216 * capture request.
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700217 * @param reprocessableSessionId The ID of the camera capture session this capture is created
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700218 * for. This is used to validate if the application submits a
219 * reprocess capture request to the same session where
220 * the {@link TotalCaptureResult}, used to create the reprocess
221 * capture, came from.
222 *
223 * @throws IllegalArgumentException If creating a reprocess capture request with an invalid
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700224 * reprocessableSessionId.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700225 *
226 * @see CameraDevice#createReprocessCaptureRequest
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800227 */
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700228 private CaptureRequest(CameraMetadataNative settings, boolean isReprocess,
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700229 int reprocessableSessionId) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700230 mSettings = CameraMetadataNative.move(settings);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700231 mSurfaceSet = new HashSet<Surface>();
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700232 mIsReprocess = isReprocess;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700233 if (isReprocess) {
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700234 if (reprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) {
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700235 throw new IllegalArgumentException("Create a reprocess capture request with an " +
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700236 "invalid session ID: " + reprocessableSessionId);
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700237 }
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700238 mReprocessableSessionId = reprocessableSessionId;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700239 } else {
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700240 mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700241 }
Igor Murashkin70725502013-06-25 20:27:06 +0000242 }
243
Igor Murashkind6d65152014-05-19 16:31:02 -0700244 /**
245 * Get a capture request field value.
246 *
247 * <p>The field definitions can be found in {@link CaptureRequest}.</p>
248 *
249 * <p>Querying the value for the same key more than once will return a value
250 * which is equal to the previous queried value.</p>
251 *
252 * @throws IllegalArgumentException if the key was not valid
253 *
254 * @param key The result field to read.
255 * @return The value of that key, or {@code null} if the field is not set.
256 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700257 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700258 public <T> T get(Key<T> key) {
259 return mSettings.get(key);
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700260 }
261
262 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700263 * {@inheritDoc}
264 * @hide
265 */
266 @SuppressWarnings("unchecked")
267 @Override
268 protected <T> T getProtected(Key<?> key) {
269 return (T) mSettings.get(key);
270 }
271
272 /**
273 * {@inheritDoc}
274 * @hide
275 */
276 @SuppressWarnings("unchecked")
277 @Override
278 protected Class<Key<?>> getKeyClass() {
279 Object thisClass = Key.class;
280 return (Class<Key<?>>)thisClass;
281 }
282
283 /**
284 * {@inheritDoc}
285 */
286 @Override
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700287 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700288 public List<Key<?>> getKeys() {
289 // Force the javadoc for this function to show up on the CaptureRequest page
290 return super.getKeys();
291 }
292
293 /**
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700294 * Retrieve the tag for this request, if any.
295 *
296 * <p>This tag is not used for anything by the camera device, but can be
297 * used by an application to easily identify a CaptureRequest when it is
298 * returned by
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700299 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700300 * </p>
301 *
302 * @return the last tag Object set on this request, or {@code null} if
303 * no tag has been set.
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700304 * @see Builder#setTag
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700305 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700306 @Nullable
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700307 public Object getTag() {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700308 return mUserTag;
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700309 }
310
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700311 /**
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700312 * Determine if this is a reprocess capture request.
313 *
314 * <p>A reprocess capture request produces output images from an input buffer from the
315 * {@link CameraCaptureSession}'s input {@link Surface}. A reprocess capture request can be
316 * created by {@link CameraDevice#createReprocessCaptureRequest}.</p>
317 *
318 * @return {@code true} if this is a reprocess capture request. {@code false} if this is not a
319 * reprocess capture request.
320 *
321 * @see CameraDevice#createReprocessCaptureRequest
322 */
323 public boolean isReprocess() {
324 return mIsReprocess;
325 }
326
327 /**
Zhijun Hea7677722015-06-01 16:36:06 -0700328 * <p>Determine if this request is part of a constrained high speed request list that was
329 * created by {@link CameraDevice#createConstrainedHighSpeedRequestList}. A constrained high
330 * speed request list contains some constrained high speed capture requests with certain
331 * interleaved pattern that is suitable for high speed preview/video streaming. An active
332 * constrained high speed capture session only accepts constrained high speed request lists.
333 * This method can be used to do the sanity check when a constrained high speed capture session
334 * receives a request list via {@link CameraCaptureSession#setRepeatingBurst} or
335 * {@link CameraCaptureSession#captureBurst}.
336 * </p>
337 *
338 *
339 * @return {@code true} if this request is part of a constrained high speed request list,
340 * {@code false} otherwise.
341 *
342 * @hide
343 */
344 public boolean isPartOfCRequestList() {
345 return mIsPartOfCHSRequestList;
346 }
347
348 /**
349 * Returns a copy of the underlying {@link CameraMetadataNative}.
350 * @hide
351 */
352 public CameraMetadataNative getNativeCopy() {
353 return new CameraMetadataNative(mSettings);
354 }
355
356 /**
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700357 * Get the reprocessable session ID this reprocess capture request is associated with.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700358 *
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700359 * @return the reprocessable session ID this reprocess capture request is associated with
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700360 *
361 * @throws IllegalStateException if this capture request is not a reprocess capture request.
362 * @hide
363 */
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700364 public int getReprocessableSessionId() {
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700365 if (mIsReprocess == false ||
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700366 mReprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) {
367 throw new IllegalStateException("Getting the reprocessable session ID for a "+
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700368 "non-reprocess capture request is illegal.");
369 }
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700370 return mReprocessableSessionId;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700371 }
372
373 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700374 * Determine whether this CaptureRequest is equal to another CaptureRequest.
375 *
376 * <p>A request is considered equal to another is if it's set of key/values is equal, it's
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700377 * list of output surfaces is equal, the user tag is equal, and the return values of
378 * isReprocess() are equal.</p>
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700379 *
380 * @param other Another instance of CaptureRequest.
381 *
382 * @return True if the requests are the same, false otherwise.
383 */
384 @Override
385 public boolean equals(Object other) {
386 return other instanceof CaptureRequest
387 && equals((CaptureRequest)other);
388 }
389
390 private boolean equals(CaptureRequest other) {
391 return other != null
392 && Objects.equals(mUserTag, other.mUserTag)
393 && mSurfaceSet.equals(other.mSurfaceSet)
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700394 && mSettings.equals(other.mSettings)
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700395 && mIsReprocess == other.mIsReprocess
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700396 && mReprocessableSessionId == other.mReprocessableSessionId;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700397 }
398
399 @Override
400 public int hashCode() {
Eino-Ville Talvala0819c752015-06-17 11:34:41 -0700401 return HashCodeHelpers.hashCodeGeneric(mSettings, mSurfaceSet, mUserTag);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700402 }
403
Igor Murashkin70725502013-06-25 20:27:06 +0000404 public static final Parcelable.Creator<CaptureRequest> CREATOR =
405 new Parcelable.Creator<CaptureRequest>() {
406 @Override
407 public CaptureRequest createFromParcel(Parcel in) {
408 CaptureRequest request = new CaptureRequest();
409 request.readFromParcel(in);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700410
Igor Murashkin70725502013-06-25 20:27:06 +0000411 return request;
412 }
413
414 @Override
415 public CaptureRequest[] newArray(int size) {
416 return new CaptureRequest[size];
417 }
418 };
419
420 /**
421 * Expand this object from a Parcel.
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700422 * Hidden since this breaks the immutability of CaptureRequest, but is
423 * needed to receive CaptureRequests with aidl.
424 *
Igor Murashkin70725502013-06-25 20:27:06 +0000425 * @param in The parcel from which the object should be read
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700426 * @hide
Igor Murashkin70725502013-06-25 20:27:06 +0000427 */
Igor Murashkin72f9f0a2014-05-14 15:46:10 -0700428 private void readFromParcel(Parcel in) {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700429 mSettings.readFromParcel(in);
Igor Murashkin70725502013-06-25 20:27:06 +0000430
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700431 mSurfaceSet.clear();
Igor Murashkin70725502013-06-25 20:27:06 +0000432
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700433 Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader());
Igor Murashkin70725502013-06-25 20:27:06 +0000434
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700435 if (parcelableArray == null) {
436 return;
437 }
Igor Murashkin70725502013-06-25 20:27:06 +0000438
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700439 for (Parcelable p : parcelableArray) {
440 Surface s = (Surface) p;
441 mSurfaceSet.add(s);
Igor Murashkin70725502013-06-25 20:27:06 +0000442 }
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700443
444 mIsReprocess = (in.readInt() == 0) ? false : true;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700445 mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
Igor Murashkin70725502013-06-25 20:27:06 +0000446 }
447
448 @Override
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700449 public int describeContents() {
450 return 0;
451 }
Igor Murashkin70725502013-06-25 20:27:06 +0000452
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700453 @Override
454 public void writeToParcel(Parcel dest, int flags) {
455 mSettings.writeToParcel(dest, flags);
456 dest.writeParcelableArray(mSurfaceSet.toArray(new Surface[mSurfaceSet.size()]), flags);
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700457 dest.writeInt(mIsReprocess ? 1 : 0);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700458 }
459
460 /**
Ruben Brunkfeb50af2014-05-09 19:58:49 -0700461 * @hide
462 */
463 public boolean containsTarget(Surface surface) {
464 return mSurfaceSet.contains(surface);
465 }
466
467 /**
468 * @hide
469 */
470 public Collection<Surface> getTargets() {
471 return Collections.unmodifiableCollection(mSurfaceSet);
472 }
473
474 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700475 * A builder for capture requests.
476 *
477 * <p>To obtain a builder instance, use the
478 * {@link CameraDevice#createCaptureRequest} method, which initializes the
479 * request fields to one of the templates defined in {@link CameraDevice}.
480 *
481 * @see CameraDevice#createCaptureRequest
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700482 * @see CameraDevice#TEMPLATE_PREVIEW
483 * @see CameraDevice#TEMPLATE_RECORD
484 * @see CameraDevice#TEMPLATE_STILL_CAPTURE
485 * @see CameraDevice#TEMPLATE_VIDEO_SNAPSHOT
486 * @see CameraDevice#TEMPLATE_MANUAL
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700487 */
488 public final static class Builder {
489
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700490 private final CaptureRequest mRequest;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700491
492 /**
493 * Initialize the builder using the template; the request takes
494 * ownership of the template.
495 *
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700496 * @param template Template settings for this capture request.
497 * @param reprocess Indicates whether to create a reprocess capture request. {@code true}
498 * to create a reprocess capture request. {@code false} to create a regular
499 * capture request.
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700500 * @param reprocessableSessionId The ID of the camera capture session this capture is
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700501 * created for. This is used to validate if the application
502 * submits a reprocess capture request to the same session
503 * where the {@link TotalCaptureResult}, used to create the
504 * reprocess capture, came from.
505 *
506 * @throws IllegalArgumentException If creating a reprocess capture request with an invalid
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700507 * reprocessableSessionId.
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700508 * @hide
509 */
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700510 public Builder(CameraMetadataNative template, boolean reprocess,
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700511 int reprocessableSessionId) {
512 mRequest = new CaptureRequest(template, reprocess, reprocessableSessionId);
Igor Murashkin70725502013-06-25 20:27:06 +0000513 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700514
515 /**
516 * <p>Add a surface to the list of targets for this request</p>
517 *
518 * <p>The Surface added must be one of the surfaces included in the most
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700519 * recent call to {@link CameraDevice#createCaptureSession}, when the
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700520 * request is given to the camera device.</p>
521 *
522 * <p>Adding a target more than once has no effect.</p>
523 *
524 * @param outputTarget Surface to use as an output target for this request
525 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700526 public void addTarget(@NonNull Surface outputTarget) {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700527 mRequest.mSurfaceSet.add(outputTarget);
528 }
529
530 /**
531 * <p>Remove a surface from the list of targets for this request.</p>
532 *
533 * <p>Removing a target that is not currently added has no effect.</p>
534 *
535 * @param outputTarget Surface to use as an output target for this request
536 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700537 public void removeTarget(@NonNull Surface outputTarget) {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700538 mRequest.mSurfaceSet.remove(outputTarget);
539 }
540
541 /**
542 * Set a capture request field to a value. The field definitions can be
543 * found in {@link CaptureRequest}.
544 *
545 * @param key The metadata field to write.
546 * @param value The value to set the field to, which must be of a matching
547 * type to the key.
548 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700549 public <T> void set(@NonNull Key<T> key, T value) {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700550 mRequest.mSettings.set(key, value);
551 }
552
553 /**
554 * Get a capture request field value. The field definitions can be
555 * found in {@link CaptureRequest}.
556 *
557 * @throws IllegalArgumentException if the key was not valid
558 *
559 * @param key The metadata field to read.
560 * @return The value of that key, or {@code null} if the field is not set.
561 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700562 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700563 public <T> T get(Key<T> key) {
564 return mRequest.mSettings.get(key);
565 }
566
567 /**
568 * Set a tag for this request.
569 *
570 * <p>This tag is not used for anything by the camera device, but can be
571 * used by an application to easily identify a CaptureRequest when it is
572 * returned by
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700573 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700574 *
575 * @param tag an arbitrary Object to store with this request
576 * @see CaptureRequest#getTag
577 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700578 public void setTag(@Nullable Object tag) {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700579 mRequest.mUserTag = tag;
580 }
581
582 /**
Zhijun Hea7677722015-06-01 16:36:06 -0700583 * <p>Mark this request as part of a constrained high speed request list created by
584 * {@link CameraDevice#createConstrainedHighSpeedRequestList}. A constrained high speed
585 * request list contains some constrained high speed capture requests with certain
586 * interleaved pattern that is suitable for high speed preview/video streaming.</p>
587 *
588 * @hide
589 */
590 public void setPartOfCHSRequestList(boolean partOfCHSList) {
591 mRequest.mIsPartOfCHSRequestList = partOfCHSList;
592 }
593
594 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700595 * Build a request using the current target Surfaces and settings.
Sol Boucheredeab402014-07-09 18:36:28 -0700596 * <p>Note that, although it is possible to create a {@code CaptureRequest} with no target
597 * {@link Surface}s, passing such a request into {@link CameraCaptureSession#capture},
598 * {@link CameraCaptureSession#captureBurst},
599 * {@link CameraCaptureSession#setRepeatingBurst}, or
600 * {@link CameraCaptureSession#setRepeatingRequest} will cause that method to throw an
601 * {@link IllegalArgumentException}.</p>
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700602 *
603 * @return A new capture request instance, ready for submission to the
604 * camera device.
605 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700606 @NonNull
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700607 public CaptureRequest build() {
608 return new CaptureRequest(mRequest);
609 }
610
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700611 /**
612 * @hide
613 */
614 public boolean isEmpty() {
615 return mRequest.mSettings.isEmpty();
616 }
617
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800618 }
619
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700620 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
621 * The key entries below this point are generated from metadata
622 * definitions in /system/media/camera/docs. Do not modify by hand or
623 * modify the comment blocks at the start or end.
624 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
625
626 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800627 * <p>The mode control selects how the image data is converted from the
628 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700629 * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800630 * control is overridden by the AWB routine. When AWB is disabled, the
631 * application controls how the color mapping is performed.</p>
632 * <p>We define the expected processing pipeline below. For consistency
633 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
634 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
635 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
636 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
637 * camera device (in the results) and be roughly correct.</p>
638 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
639 * FAST or HIGH_QUALITY will yield a picture with the same white point
640 * as what was produced by the camera device in the earlier frame.</p>
641 * <p>The expected processing pipeline is as follows:</p>
642 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
643 * <p>The white balance is encoded by two values, a 4-channel white-balance
644 * gain vector (applied in the Bayer domain), and a 3x3 color transform
645 * matrix (applied after demosaic).</p>
646 * <p>The 4-channel white-balance gains are defined as:</p>
647 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
648 * </code></pre>
649 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
650 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
651 * These may be identical for a given camera device implementation; if
652 * the camera device does not support a separate gain for even/odd green
653 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
654 * <code>G_even</code> in the output result metadata.</p>
655 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
656 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
657 * </code></pre>
658 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
659 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
660 * <p>with colors as follows:</p>
661 * <pre><code>r' = I0r + I1g + I2b
662 * g' = I3r + I4g + I5b
663 * b' = I6r + I7g + I8b
664 * </code></pre>
665 * <p>Both the input and output value ranges must match. Overflow/underflow
666 * values are clipped to fit within the range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700667 * <p><b>Possible values:</b>
668 * <ul>
669 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
670 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
671 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
672 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700673 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
674 * <p><b>Full capability</b> -
675 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
676 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800677 *
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800678 * @see CaptureRequest#COLOR_CORRECTION_GAINS
679 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800680 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700681 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700682 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
683 * @see #COLOR_CORRECTION_MODE_FAST
684 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
685 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700686 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700687 public static final Key<Integer> COLOR_CORRECTION_MODE =
688 new Key<Integer>("android.colorCorrection.mode", int.class);
689
690 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800691 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700692 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800693 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800694 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700695 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800696 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800697 * <p>In the latter case, the camera device may round the matrix to account
698 * for precision issues; the final rounded matrix should be reported back
699 * in this matrix result metadata. The transform should keep the magnitude
700 * of the output color values within <code>[0, 1.0]</code> (assuming input color
701 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800702 * <p>The valid range of each matrix element varies on different devices, but
703 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700704 * <p><b>Units</b>: Unitless scale factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700705 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
706 * <p><b>Full capability</b> -
707 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
708 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800709 *
710 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700711 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700712 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700713 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700714 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
715 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700716
717 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800718 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800719 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700720 * <p>These per-channel gains are either set by the camera device
721 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
722 * TRANSFORM_MATRIX, or directly by the application in the
723 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
724 * TRANSFORM_MATRIX.</p>
725 * <p>The gains in the result metadata are the gains actually
726 * applied by the camera device to the current frame.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800727 * <p>The valid range of gains varies on different devices, but gains
728 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
729 * device allows gains below 1.0, this is usually not recommended because
730 * this can create color artifacts.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700731 * <p><b>Units</b>: Unitless gain factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700732 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
733 * <p><b>Full capability</b> -
734 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
735 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800736 *
737 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700738 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700739 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700740 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700741 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
742 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700743
744 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700745 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700746 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
747 * can not focus on the same point after exiting from the lens. This metadata defines
748 * the high level control of chromatic aberration correction algorithm, which aims to
749 * minimize the chromatic artifacts that may occur along the object boundaries in an
750 * image.</p>
751 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
752 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
753 * use the highest-quality aberration correction algorithms, even if it slows down
754 * capture rate. FAST means the camera device will not slow down capture rate when
755 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700756 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700757 * <p><b>Possible values:</b>
758 * <ul>
759 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
760 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
761 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
762 * </ul></p>
763 * <p><b>Available values for this device:</b><br>
764 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700765 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700766 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700767 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
768 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
769 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
770 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700771 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700772 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700773 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
774 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700775
776 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800777 * <p>The desired setting for the camera device's auto-exposure
778 * algorithm's antibanding compensation.</p>
779 * <p>Some kinds of lighting fixtures, such as some fluorescent
780 * lights, flicker at the rate of the power supply frequency
781 * (60Hz or 50Hz, depending on country). While this is
782 * typically not noticeable to a person, it can be visible to
783 * a camera device. If a camera sets its exposure time to the
784 * wrong value, the flicker may become visible in the
785 * viewfinder as flicker or in a final captured image, as a
786 * set of variable-brightness bands across the image.</p>
787 * <p>Therefore, the auto-exposure routines of camera devices
788 * include antibanding routines that ensure that the chosen
789 * exposure value will not cause such banding. The choice of
790 * exposure time depends on the rate of flicker, which the
791 * camera device can detect automatically, or the expected
792 * rate can be selected by the application using this
793 * control.</p>
794 * <p>A given camera device may not support all of the possible
795 * options for the antibanding mode. The
796 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
797 * the available modes for a given camera device.</p>
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800798 * <p>AUTO mode is the default if it is available on given
799 * camera device. When AUTO mode is not available, the
800 * default will be either 50HZ or 60HZ, and both 50HZ
801 * and 60HZ will be available.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800802 * <p>If manual exposure control is enabled (by setting
803 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
804 * then this setting has no effect, and the application must
805 * ensure it selects exposure times that do not cause banding
806 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
807 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700808 * <p><b>Possible values:</b>
809 * <ul>
810 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
811 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
812 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
813 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
814 * </ul></p>
815 * <p><b>Available values for this device:</b><br></p>
816 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700817 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800818 *
Zhijun He5f2a47f2014-01-16 15:44:41 -0800819 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
Zhijun He399f05d2014-01-15 11:31:30 -0800820 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800821 * @see CaptureRequest#CONTROL_MODE
822 * @see CaptureResult#STATISTICS_SCENE_FLICKER
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700823 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
824 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
825 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
826 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
827 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700828 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700829 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
830 new Key<Integer>("android.control.aeAntibandingMode", int.class);
831
832 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700833 * <p>Adjustment to auto-exposure (AE) target image
834 * brightness.</p>
835 * <p>The adjustment is measured as a count of steps, with the
836 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
837 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
838 * <p>For example, if the exposure value (EV) step is 0.333, '6'
839 * will mean an exposure compensation of +2 EV; -3 will mean an
840 * exposure compensation of -1 EV. One EV represents a doubling
841 * of image brightness. Note that this control will only be
842 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
843 * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700844 * <p>In the event of exposure compensation value being changed, camera device
845 * may take several frames to reach the newly requested exposure target.
846 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
847 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
848 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
849 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700850 * <p><b>Units</b>: Compensation steps</p>
851 * <p><b>Range of valid values:</b><br>
852 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700853 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700854 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700855 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
856 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700857 * @see CaptureRequest#CONTROL_AE_LOCK
858 * @see CaptureRequest#CONTROL_AE_MODE
859 * @see CaptureResult#CONTROL_AE_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700860 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700861 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700862 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
863 new Key<Integer>("android.control.aeExposureCompensation", int.class);
864
865 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700866 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He49a3ca92014-02-05 13:48:09 -0800867 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700868 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
869 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
870 * <p>Note that even when AE is locked, the flash may be fired if
871 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
872 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700873 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
874 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800875 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
876 * when AE is already locked, the camera device will not change the exposure time
877 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800878 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
Zhijun He49a3ca92014-02-05 13:48:09 -0800879 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
Zhijun Hefa95b042015-02-09 10:40:49 -0800880 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
881 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
882 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
883 * the AE if AE is locked by the camera device internally during precapture metering
884 * sequence In other words, submitting requests with AE unlock has no effect for an
885 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
886 * will never succeed in a sequence of preview requests where AE lock is always set
887 * to <code>false</code>.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700888 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
889 * get locked do not necessarily correspond to the settings that were present in the
890 * latest capture result received from the camera device, since additional captures
891 * and AE updates may have occurred even before the result was sent out. If an
892 * application is switching between automatic and manual control and wishes to eliminate
893 * any flicker during the switch, the following procedure is recommended:</p>
894 * <ol>
895 * <li>Starting in auto-AE mode:</li>
896 * <li>Lock AE</li>
897 * <li>Wait for the first result to be output that has the AE locked</li>
898 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
899 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
900 * </ol>
Zhijun He49a3ca92014-02-05 13:48:09 -0800901 * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700902 * <p>This key is available on all devices.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800903 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700904 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He49a3ca92014-02-05 13:48:09 -0800905 * @see CaptureRequest#CONTROL_AE_MODE
906 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
907 * @see CaptureResult#CONTROL_AE_STATE
908 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
909 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700910 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700911 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700912 public static final Key<Boolean> CONTROL_AE_LOCK =
913 new Key<Boolean>("android.control.aeLock", boolean.class);
914
915 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800916 * <p>The desired mode for the camera device's
917 * auto-exposure routine.</p>
918 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
919 * AUTO.</p>
920 * <p>When set to any of the ON modes, the camera device's
921 * auto-exposure routine is enabled, overriding the
922 * application's selected exposure time, sensor sensitivity,
923 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
924 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
925 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
926 * is selected, the camera device's flash unit controls are
927 * also overridden.</p>
928 * <p>The FLASH modes are only available if the camera device
929 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
930 * <p>If flash TORCH mode is desired, this field must be set to
931 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
932 * <p>When set to any of the ON modes, the values chosen by the
933 * camera device auto-exposure routine for the overridden
934 * fields for a given capture will be available in its
935 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700936 * <p><b>Possible values:</b>
937 * <ul>
938 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
939 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
940 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
941 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
942 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
943 * </ul></p>
944 * <p><b>Available values for this device:</b><br>
945 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700946 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800947 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700948 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -0800949 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800950 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
951 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800952 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
953 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800954 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700955 * @see #CONTROL_AE_MODE_OFF
956 * @see #CONTROL_AE_MODE_ON
957 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
958 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
959 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
960 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700961 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700962 public static final Key<Integer> CONTROL_AE_MODE =
963 new Key<Integer>("android.control.aeMode", int.class);
964
965 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700966 * <p>List of metering areas to use for auto-exposure adjustment.</p>
967 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700968 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700969 * <p>The maximum number of regions supported by the device is determined by the value
970 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800971 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700972 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800973 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
974 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700975 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700976 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700977 * for every pixel in the area. This means that a large metering area
978 * with the same weight as a smaller area will have more effect in
979 * the metering result. Metering areas can partially overlap and the
980 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700981 * <p>The weights are relative to weights of other exposure metering regions, so if only one
982 * region is used, all non-zero weights will have the same effect. A region with 0
983 * weight is ignored.</p>
984 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
985 * camera device.</p>
986 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
987 * capture result metadata, the camera device will ignore the sections outside the crop
988 * region and output only the intersection rectangle as the metering region in the result
989 * metadata. If the region is entirely outside the crop region, it will be ignored and
990 * not reported in the result metadata.</p>
991 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
992 * <p><b>Range of valid values:</b><br>
993 * Coordinates must be between <code>[(0,0), (width, height))</code> of
994 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700995 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800996 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700997 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800998 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800999 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001000 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001001 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001002 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
1003 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001004
1005 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001006 * <p>Range over which the auto-exposure routine can
1007 * adjust the capture frame rate to maintain good
1008 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001009 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001010 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
1011 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
1012 * <p><b>Units</b>: Frames per second (FPS)</p>
1013 * <p><b>Range of valid values:</b><br>
1014 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
1015 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001016 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001017 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001018 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001019 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001020 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001021 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001022 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
1023 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001024
1025 /**
Zhijun He228f4f92014-01-16 17:22:05 -08001026 * <p>Whether the camera device will trigger a precapture
1027 * metering sequence when it processes this request.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001028 * <p>This entry is normally set to IDLE, or is not
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001029 * included at all in the request settings. When included and
Zhijun Hedd72be52015-02-06 13:49:51 -08001030 * set to START, the camera device will trigger the auto-exposure (AE)
Igor Murashkinace5bf02013-12-10 17:36:40 -08001031 * precapture metering sequence.</p>
Zhijun Hefa95b042015-02-09 10:40:49 -08001032 * <p>When set to CANCEL, the camera device will cancel any active
1033 * precapture metering trigger, and return to its initial AE state.
1034 * If a precapture metering sequence is already completed, and the camera
1035 * device has implicitly locked the AE for subsequent still capture, the
1036 * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -08001037 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001038 * high-quality still capture for final metering decisions to
1039 * be made, and for firing pre-capture flash pulses to estimate
1040 * scene brightness and required final capture flash power, when
1041 * the flash is enabled.</p>
1042 * <p>Normally, this entry should be set to START for only a
1043 * single request, and the application should wait until the
1044 * sequence completes before starting a new one.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -08001045 * <p>When a precapture metering sequence is finished, the camera device
1046 * may lock the auto-exposure routine internally to be able to accurately expose the
1047 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
1048 * For this case, the AE may not resume normal scan if no subsequent still capture is
1049 * submitted. To ensure that the AE routine restarts normal scan, the application should
1050 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
1051 * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a
Zhijun Hefa95b042015-02-09 10:40:49 -08001052 * still capture request after the precapture sequence completes. Alternatively, for
1053 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
1054 * internally locked AE if the application doesn't submit a still capture request after
1055 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
1056 * be used in devices that have earlier API levels.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001057 * <p>The exact effect of auto-exposure (AE) precapture trigger
1058 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001059 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
1060 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001061 * <p>On LEGACY-level devices, the precapture trigger is not supported;
1062 * capturing a high-resolution JPEG image will automatically trigger a
1063 * precapture sequence before the high-resolution capture, including
1064 * potentially firing a pre-capture flash.</p>
1065 * <p><b>Possible values:</b>
1066 * <ul>
1067 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
1068 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
Zhijun Hefa95b042015-02-09 10:40:49 -08001069 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001070 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001071 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1072 * <p><b>Limited capability</b> -
1073 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1074 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001075 *
Zhijun Hedd72be52015-02-06 13:49:51 -08001076 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He228f4f92014-01-16 17:22:05 -08001077 * @see CaptureResult#CONTROL_AE_STATE
Zhijun Hedd72be52015-02-06 13:49:51 -08001078 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001079 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001080 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
1081 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
Zhijun Hefa95b042015-02-09 10:40:49 -08001082 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001083 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001084 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001085 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
1086 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
1087
1088 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001089 * <p>Whether auto-focus (AF) is currently enabled, and what
1090 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001091 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001092 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1093 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1094 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1095 * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p>
Zhijun He78146ec2014-01-14 18:12:13 -08001096 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001097 * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001098 * in result metadata.</p>
1099 * <p><b>Possible values:</b>
1100 * <ul>
1101 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1102 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1103 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1104 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1105 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1106 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1107 * </ul></p>
1108 * <p><b>Available values for this device:</b><br>
1109 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1110 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001111 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001112 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001113 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001114 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001115 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001116 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001117 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001118 * @see #CONTROL_AF_MODE_OFF
1119 * @see #CONTROL_AF_MODE_AUTO
1120 * @see #CONTROL_AF_MODE_MACRO
1121 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1122 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1123 * @see #CONTROL_AF_MODE_EDOF
1124 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001125 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001126 public static final Key<Integer> CONTROL_AF_MODE =
1127 new Key<Integer>("android.control.afMode", int.class);
1128
1129 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001130 * <p>List of metering areas to use for auto-focus.</p>
1131 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001132 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001133 * <p>The maximum number of focus areas supported by the device is determined by the value
1134 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001135 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001136 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001137 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1138 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001139 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001140 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001141 * for every pixel in the area. This means that a large metering area
1142 * with the same weight as a smaller area will have more effect in
1143 * the metering result. Metering areas can partially overlap and the
1144 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001145 * <p>The weights are relative to weights of other metering regions, so if only one region
1146 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1147 * ignored.</p>
1148 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1149 * camera device.</p>
1150 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1151 * capture result metadata, the camera device will ignore the sections outside the crop
1152 * region and output only the intersection rectangle as the metering region in the result
1153 * metadata. If the region is entirely outside the crop region, it will be ignored and
1154 * not reported in the result metadata.</p>
1155 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1156 * <p><b>Range of valid values:</b><br>
1157 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1158 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001159 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001160 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001161 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001162 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001163 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001164 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001165 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001166 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1167 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001168
1169 /**
Zhijun He228f4f92014-01-16 17:22:05 -08001170 * <p>Whether the camera device will trigger autofocus for this request.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001171 * <p>This entry is normally set to IDLE, or is not
1172 * included at all in the request settings.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001173 * <p>When included and set to START, the camera device will trigger the
1174 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1175 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1176 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001177 * <p>Generally, applications should set this entry to START or CANCEL for only a
1178 * single capture, and then return it to IDLE (or not set at all). Specifying
1179 * START for multiple captures in a row means restarting the AF operation over
1180 * and over again.</p>
1181 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001182 * <p><b>Possible values:</b>
1183 * <ul>
1184 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1185 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1186 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1187 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001188 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001189 *
1190 * @see CaptureResult#CONTROL_AF_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001191 * @see #CONTROL_AF_TRIGGER_IDLE
1192 * @see #CONTROL_AF_TRIGGER_START
1193 * @see #CONTROL_AF_TRIGGER_CANCEL
1194 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001195 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001196 public static final Key<Integer> CONTROL_AF_TRIGGER =
1197 new Key<Integer>("android.control.afTrigger", int.class);
1198
1199 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001200 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He2d5e8972014-02-07 16:13:46 -08001201 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001202 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1203 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1204 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1205 * get locked do not necessarily correspond to the settings that were present in the
1206 * latest capture result received from the camera device, since additional captures
1207 * and AWB updates may have occurred even before the result was sent out. If an
1208 * application is switching between automatic and manual control and wishes to eliminate
1209 * any flicker during the switch, the following procedure is recommended:</p>
1210 * <ol>
1211 * <li>Starting in auto-AWB mode:</li>
1212 * <li>Lock AWB</li>
1213 * <li>Wait for the first result to be output that has the AWB locked</li>
1214 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1215 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1216 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001217 * <p>Note that AWB lock is only meaningful when
1218 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1219 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001220 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1221 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001222 *
1223 * @see CaptureRequest#CONTROL_AWB_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001224 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001225 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001226 public static final Key<Boolean> CONTROL_AWB_LOCK =
1227 new Key<Boolean>("android.control.awbLock", boolean.class);
1228
1229 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001230 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001231 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001232 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001233 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001234 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001235 * routine is enabled, overriding the application's selected
1236 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001237 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1238 * is OFF, the behavior of AWB is device dependent. It is recommened to
1239 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1240 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001241 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001242 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001243 * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}
Zhijun He399f05d2014-01-15 11:31:30 -08001244 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001245 * <p>When set to any other modes, the camera device's auto-white
1246 * balance routine is disabled. The camera device uses each
1247 * particular illumination target for white balance
1248 * adjustment. The application's values for
1249 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1250 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1251 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001252 * <p><b>Possible values:</b>
1253 * <ul>
1254 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1255 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1256 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1257 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1258 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1259 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1260 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1261 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1262 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1263 * </ul></p>
1264 * <p><b>Available values for this device:</b><br>
1265 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001266 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001267 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001268 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001269 * @see CaptureRequest#COLOR_CORRECTION_MODE
1270 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001271 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001272 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001273 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001274 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001275 * @see #CONTROL_AWB_MODE_OFF
1276 * @see #CONTROL_AWB_MODE_AUTO
1277 * @see #CONTROL_AWB_MODE_INCANDESCENT
1278 * @see #CONTROL_AWB_MODE_FLUORESCENT
1279 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1280 * @see #CONTROL_AWB_MODE_DAYLIGHT
1281 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1282 * @see #CONTROL_AWB_MODE_TWILIGHT
1283 * @see #CONTROL_AWB_MODE_SHADE
1284 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001285 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001286 public static final Key<Integer> CONTROL_AWB_MODE =
1287 new Key<Integer>("android.control.awbMode", int.class);
1288
1289 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001290 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001291 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001292 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001293 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001294 * <p>The maximum number of regions supported by the device is determined by the value
1295 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001296 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001297 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001298 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1299 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001300 * bottom-right pixel in the active pixel array.</p>
1301 * <p>The weight must range from 0 to 1000, and represents a weight
1302 * for every pixel in the area. This means that a large metering area
1303 * with the same weight as a smaller area will have more effect in
1304 * the metering result. Metering areas can partially overlap and the
1305 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001306 * <p>The weights are relative to weights of other white balance metering regions, so if
1307 * only one region is used, all non-zero weights will have the same effect. A region with
1308 * 0 weight is ignored.</p>
1309 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1310 * camera device.</p>
1311 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1312 * capture result metadata, the camera device will ignore the sections outside the crop
1313 * region and output only the intersection rectangle as the metering region in the result
1314 * metadata. If the region is entirely outside the crop region, it will be ignored and
1315 * not reported in the result metadata.</p>
1316 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1317 * <p><b>Range of valid values:</b><br>
1318 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1319 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001320 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001321 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001322 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001323 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001324 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001325 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001326 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001327 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1328 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001329
1330 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001331 * <p>Information to the camera device 3A (auto-exposure,
1332 * auto-focus, auto-white balance) routines about the purpose
1333 * of this capture, to help the camera device to decide optimal 3A
1334 * strategy.</p>
Zhijun Hee30adb72014-04-09 19:04:31 -07001335 * <p>This control (except for MANUAL) is only effective if
1336 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001337 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001338 * contains PRIVATE_REPROCESSING or YUV_REPROCESSING. MANUAL will be supported if
Zhijun He513f7c32015-04-24 18:23:54 -07001339 * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR. Other intent values are
1340 * always supported.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001341 * <p><b>Possible values:</b>
1342 * <ul>
1343 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1344 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1345 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1346 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1347 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1348 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1349 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
1350 * </ul></p>
1351 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001352 *
1353 * @see CaptureRequest#CONTROL_MODE
Zhijun Hee30adb72014-04-09 19:04:31 -07001354 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001355 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1356 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1357 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1358 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1359 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1360 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
Zhijun Hee30adb72014-04-09 19:04:31 -07001361 * @see #CONTROL_CAPTURE_INTENT_MANUAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001362 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001363 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001364 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1365 new Key<Integer>("android.control.captureIntent", int.class);
1366
1367 /**
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -08001368 * <p>A special color effect to apply.</p>
1369 * <p>When this mode is set, a color effect will be applied
1370 * to images produced by the camera device. The interpretation
1371 * and implementation of these color effects is left to the
1372 * implementor of the camera device, and should not be
1373 * depended on to be consistent (or present) across all
1374 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001375 * <p><b>Possible values:</b>
1376 * <ul>
1377 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1378 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1379 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1380 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1381 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1382 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1383 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1384 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1385 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1386 * </ul></p>
1387 * <p><b>Available values for this device:</b><br>
1388 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001389 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001390 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001391 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001392 * @see #CONTROL_EFFECT_MODE_OFF
1393 * @see #CONTROL_EFFECT_MODE_MONO
1394 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1395 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1396 * @see #CONTROL_EFFECT_MODE_SEPIA
1397 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1398 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1399 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1400 * @see #CONTROL_EFFECT_MODE_AQUA
1401 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001402 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001403 public static final Key<Integer> CONTROL_EFFECT_MODE =
1404 new Key<Integer>("android.control.effectMode", int.class);
1405
1406 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001407 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001408 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001409 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001410 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001411 * capture parameters itself.</p>
1412 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001413 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001414 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001415 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001416 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001417 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun He527d5222015-05-14 15:36:04 -07001418 * {@link android.hardware.camera2.CaptureResult capture results}.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001419 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1420 * is that this frame will not be used by camera device background 3A statistics
1421 * update, as if this frame is never captured. This mode can be used in the scenario
1422 * where the application doesn't want a 3A manual control capture to affect
1423 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001424 * <p><b>Possible values:</b>
1425 * <ul>
1426 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
1427 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1428 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1429 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1430 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001431 * <p><b>Available values for this device:</b><br>
1432 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001433 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001434 *
1435 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001436 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001437 * @see #CONTROL_MODE_OFF
1438 * @see #CONTROL_MODE_AUTO
1439 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001440 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001441 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001442 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001443 public static final Key<Integer> CONTROL_MODE =
1444 new Key<Integer>("android.control.mode", int.class);
1445
1446 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001447 * <p>Control for which scene mode is currently active.</p>
1448 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1449 * capture settings.</p>
Ruben Brunke6679362014-01-17 17:05:54 -08001450 * <p>This is the mode that that is active when
Zhijun Heee2ebde2015-06-16 19:58:11 -07001451 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
1452 * disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}
1453 * while in use.</p>
Ruben Brunke6679362014-01-17 17:05:54 -08001454 * <p>The interpretation and implementation of these scene modes is left
1455 * to the implementor of the camera device. Their behavior will not be
1456 * consistent across all devices, and any given device may only implement
1457 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001458 * <p><b>Possible values:</b>
1459 * <ul>
1460 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1461 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1462 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1463 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1464 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1465 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1466 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1467 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1468 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1469 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1470 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1471 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1472 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1473 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1474 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1475 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1476 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1477 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001478 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001479 * </ul></p>
1480 * <p><b>Available values for this device:</b><br>
1481 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001482 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001483 *
Ruben Brunke6679362014-01-17 17:05:54 -08001484 * @see CaptureRequest#CONTROL_AE_MODE
1485 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001486 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Ruben Brunke6679362014-01-17 17:05:54 -08001487 * @see CaptureRequest#CONTROL_AWB_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001488 * @see CaptureRequest#CONTROL_MODE
Ruben Brunke6679362014-01-17 17:05:54 -08001489 * @see #CONTROL_SCENE_MODE_DISABLED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001490 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1491 * @see #CONTROL_SCENE_MODE_ACTION
1492 * @see #CONTROL_SCENE_MODE_PORTRAIT
1493 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1494 * @see #CONTROL_SCENE_MODE_NIGHT
1495 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1496 * @see #CONTROL_SCENE_MODE_THEATRE
1497 * @see #CONTROL_SCENE_MODE_BEACH
1498 * @see #CONTROL_SCENE_MODE_SNOW
1499 * @see #CONTROL_SCENE_MODE_SUNSET
1500 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1501 * @see #CONTROL_SCENE_MODE_FIREWORKS
1502 * @see #CONTROL_SCENE_MODE_SPORTS
1503 * @see #CONTROL_SCENE_MODE_PARTY
1504 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1505 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07001506 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001507 * @see #CONTROL_SCENE_MODE_HDR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001508 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001509 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001510 public static final Key<Integer> CONTROL_SCENE_MODE =
1511 new Key<Integer>("android.control.sceneMode", int.class);
1512
1513 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001514 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001515 * active.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001516 * <p>Video stabilization automatically translates and scales images from
1517 * the camera in order to stabilize motion between consecutive frames.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001518 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07001519 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001520 * <p>Switching between different video stabilization modes may take several
1521 * frames to initialize, the camera device will report the current mode
1522 * in capture result metadata. For example, When "ON" mode is requested,
1523 * the video stabilization modes in the first several capture results may
1524 * still be "OFF", and it will become "ON" when the initialization is
1525 * done.</p>
1526 * <p>If a camera device supports both this mode and OIS
1527 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
1528 * produce undesirable interaction, so it is recommended not to enable
1529 * both at the same time.</p>
1530 * <p><b>Possible values:</b>
1531 * <ul>
1532 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
1533 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
1534 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001535 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001536 *
Zhijun He45fa43a12014-06-13 18:29:37 -07001537 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001538 * @see CaptureRequest#SCALER_CROP_REGION
Zhijun He4793af52014-05-05 10:39:12 -07001539 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1540 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001541 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001542 @PublicKey
Zhijun He4793af52014-05-05 10:39:12 -07001543 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1544 new Key<Integer>("android.control.videoStabilizationMode", int.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001545
1546 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001547 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001548 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001549 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
1550 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001551 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001552 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001553 * camera device will use the highest-quality enhancement algorithms,
1554 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08001555 * not slow down capture rate when applying edge enhancement.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08001556 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
1557 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
1558 * The camera device may adjust its internal noise reduction parameters for best
1559 * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001560 * <p><b>Possible values:</b>
1561 * <ul>
1562 * <li>{@link #EDGE_MODE_OFF OFF}</li>
1563 * <li>{@link #EDGE_MODE_FAST FAST}</li>
1564 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
1565 * </ul></p>
1566 * <p><b>Available values for this device:</b><br>
1567 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001568 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1569 * <p><b>Full capability</b> -
1570 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1571 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001572 *
1573 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001574 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08001575 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001576 * @see #EDGE_MODE_OFF
1577 * @see #EDGE_MODE_FAST
1578 * @see #EDGE_MODE_HIGH_QUALITY
1579 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001580 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001581 public static final Key<Integer> EDGE_MODE =
1582 new Key<Integer>("android.edge.mode", int.class);
1583
1584 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001585 * <p>The desired mode for for the camera device's flash control.</p>
1586 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08001587 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001588 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
1589 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
1590 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
1591 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
1592 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
1593 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001594 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08001595 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
1596 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
1597 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001598 * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001599 * <p><b>Possible values:</b>
1600 * <ul>
1601 * <li>{@link #FLASH_MODE_OFF OFF}</li>
1602 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
1603 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
1604 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001605 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001606 *
1607 * @see CaptureRequest#CONTROL_AE_MODE
1608 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1609 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08001610 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001611 * @see #FLASH_MODE_OFF
1612 * @see #FLASH_MODE_SINGLE
1613 * @see #FLASH_MODE_TORCH
1614 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001615 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001616 public static final Key<Integer> FLASH_MODE =
1617 new Key<Integer>("android.flash.mode", int.class);
1618
1619 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001620 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001621 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001622 * that do not accurately measure the incoming light (i.e. pixels that
1623 * are stuck at an arbitrary value or are oversensitive).</p>
1624 * <p><b>Possible values:</b>
1625 * <ul>
1626 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
1627 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
1628 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
1629 * </ul></p>
1630 * <p><b>Available values for this device:</b><br>
1631 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001632 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001633 *
1634 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001635 * @see #HOT_PIXEL_MODE_OFF
1636 * @see #HOT_PIXEL_MODE_FAST
1637 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
1638 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001639 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001640 public static final Key<Integer> HOT_PIXEL_MODE =
1641 new Key<Integer>("android.hotPixel.mode", int.class);
1642
1643 /**
Ruben Brunk57493682014-05-27 18:58:08 -07001644 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001645 * <p>Setting a location object in a request will include the GPS coordinates of the location
1646 * into any JPEG images captured based on the request. These coordinates can then be
1647 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001648 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001649 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001650 @PublicKey
1651 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07001652 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
1653 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
1654
1655 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001656 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001657 * EXIF.</p>
1658 * <p><b>Range of valid values:</b><br>
1659 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001660 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001661 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001662 */
1663 public static final Key<double[]> JPEG_GPS_COORDINATES =
1664 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
1665
1666 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001667 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001668 * include in EXIF.</p>
1669 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001670 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001671 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001672 */
1673 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
1674 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
1675
1676 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001677 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001678 * EXIF.</p>
1679 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001680 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07001681 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001682 */
1683 public static final Key<Long> JPEG_GPS_TIMESTAMP =
1684 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
1685
1686 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001687 * <p>The orientation for a JPEG image.</p>
1688 * <p>The clockwise rotation angle in degrees, relative to the orientation
1689 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
1690 * upright.</p>
1691 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
Yin-Chia Yehd49ebcc2015-03-27 13:54:04 -07001692 * rotate the image data to match this orientation. When the image data is rotated,
1693 * the thumbnail data will also be rotated.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001694 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
1695 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
1696 * <p>To translate from the device orientation given by the Android sensor APIs, the following
1697 * sample code may be used:</p>
1698 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
1699 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
1700 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
1701 *
1702 * // Round device orientation to a multiple of 90
1703 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
1704 *
1705 * // Reverse device orientation for front-facing cameras
1706 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
1707 * if (facingFront) deviceOrientation = -deviceOrientation;
1708 *
1709 * // Calculate desired JPEG orientation relative to camera orientation to make
1710 * // the image upright relative to the device orientation
1711 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
1712 *
1713 * return jpegOrientation;
1714 * }
1715 * </code></pre>
1716 * <p><b>Units</b>: Degrees in multiples of 90</p>
1717 * <p><b>Range of valid values:</b><br>
1718 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001719 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001720 *
1721 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001722 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001723 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001724 public static final Key<Integer> JPEG_ORIENTATION =
1725 new Key<Integer>("android.jpeg.orientation", int.class);
1726
1727 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001728 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001729 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001730 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001731 * <p><b>Range of valid values:</b><br>
1732 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001733 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001734 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001735 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001736 public static final Key<Byte> JPEG_QUALITY =
1737 new Key<Byte>("android.jpeg.quality", byte.class);
1738
1739 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001740 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001741 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001742 * <p><b>Range of valid values:</b><br>
1743 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001744 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001745 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001746 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001747 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
1748 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
1749
1750 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001751 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001752 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
1753 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001754 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
1755 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07001756 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
1757 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
1758 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
1759 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
1760 * generate the thumbnail image. The thumbnail image will always have a smaller Field
1761 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001762 * <p><b>Range of valid values:</b><br>
1763 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001764 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001765 *
1766 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001767 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001768 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001769 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
1770 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001771
1772 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001773 * <p>The desired lens aperture size, as a ratio of lens focal length to the
1774 * effective aperture diameter.</p>
1775 * <p>Setting this value is only supported on the camera devices that have a variable
1776 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08001777 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
1778 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001779 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08001780 * to achieve manual exposure control.</p>
1781 * <p>The requested aperture value may take several frames to reach the
1782 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08001783 * aperture size in capture result metadata while the aperture is changing.
1784 * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08001785 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1786 * the ON modes, this will be overridden by the camera device
1787 * auto-exposure algorithm, the overridden values are then provided
1788 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001789 * <p><b>Units</b>: The f-number (f/N)</p>
1790 * <p><b>Range of valid values:</b><br>
1791 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001792 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1793 * <p><b>Full capability</b> -
1794 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1795 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08001796 *
Zhijun He399f05d2014-01-15 11:31:30 -08001797 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001798 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001799 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001800 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001801 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001802 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001803 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001804 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001805 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001806 public static final Key<Float> LENS_APERTURE =
1807 new Key<Float>("android.lens.aperture", float.class);
1808
1809 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001810 * <p>The desired setting for the lens neutral density filter(s).</p>
1811 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001812 * <p>Lens filters are typically used to lower the amount of light the
1813 * sensor is exposed to (measured in steps of EV). As used here, an EV
1814 * step is the standard logarithmic representation, which are
1815 * non-negative, and inversely proportional to the amount of light
1816 * hitting the sensor. For example, setting this to 0 would result
1817 * in no reduction of the incoming light, and setting this to 2 would
1818 * mean that the filter is set to reduce incoming light by two stops
1819 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001820 * <p>It may take several frames before the lens filter density changes
1821 * to the requested value. While the filter density is still changing,
1822 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001823 * <p><b>Units</b>: Exposure Value (EV)</p>
1824 * <p><b>Range of valid values:</b><br>
1825 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001826 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1827 * <p><b>Full capability</b> -
1828 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1829 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001830 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001831 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08001832 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001833 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001834 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001835 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001836 public static final Key<Float> LENS_FILTER_DENSITY =
1837 new Key<Float>("android.lens.filterDensity", float.class);
1838
1839 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001840 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08001841 * <p>This setting controls the physical focal length of the camera
1842 * device's lens. Changing the focal length changes the field of
1843 * view of the camera device, and is usually used for optical zoom.</p>
1844 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1845 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08001846 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08001847 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
1848 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001849 * <p>Optical zoom will not be supported on most devices.</p>
1850 * <p><b>Units</b>: Millimeters</p>
1851 * <p><b>Range of valid values:</b><br>
1852 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001853 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08001854 *
1855 * @see CaptureRequest#LENS_APERTURE
1856 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001857 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08001858 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001859 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001860 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001861 public static final Key<Float> LENS_FOCAL_LENGTH =
1862 new Key<Float>("android.lens.focalLength", float.class);
1863
1864 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001865 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001866 * measured from frontmost surface of the lens.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001867 * <p>This control can be used for setting manual focus, on devices that support
1868 * the MANUAL_SENSOR capability and have a variable-focus lens (see
1869 * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}).</p>
1870 * <p>A value of <code>0.0f</code> means infinity focus. The value set will be clamped to
1871 * <code>[0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code>.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001872 * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied
1873 * instantaneously, and it may take several frames before the lens
1874 * can move to the requested focus distance. While the lens is still moving,
1875 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001876 * <p>LEGACY devices support at most setting this to <code>0.0f</code>
1877 * for infinity focus.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001878 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1879 * <p><b>Range of valid values:</b><br>
1880 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001881 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1882 * <p><b>Full capability</b> -
1883 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1884 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001885 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001886 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08001887 * @see CaptureRequest#LENS_FOCAL_LENGTH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001888 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Zhijun Heca1b73a2014-02-03 12:39:53 -08001889 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1890 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001891 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001892 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001893 public static final Key<Float> LENS_FOCUS_DISTANCE =
1894 new Key<Float>("android.lens.focusDistance", float.class);
1895
1896 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08001897 * <p>Sets whether the camera device uses optical image stabilization (OIS)
1898 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001899 * <p>OIS is used to compensate for motion blur due to small
1900 * movements of the camera during capture. Unlike digital image
1901 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
1902 * makes use of mechanical elements to stabilize the camera
1903 * sensor, and thus allows for longer exposure times before
1904 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07001905 * <p>Switching between different optical stabilization modes may take several
1906 * frames to initialize, the camera device will report the current mode in
1907 * capture result metadata. For example, When "ON" mode is requested, the
1908 * optical stabilization modes in the first several capture results may still
1909 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001910 * <p>If a camera device supports both OIS and digital image stabilization
1911 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
1912 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001913 * <p>Not all devices will support OIS; see
1914 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
1915 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001916 * <p><b>Possible values:</b>
1917 * <ul>
1918 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
1919 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
1920 * </ul></p>
1921 * <p><b>Available values for this device:</b><br>
1922 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001923 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1924 * <p><b>Limited capability</b> -
1925 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1926 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001927 *
1928 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001929 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001930 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001931 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
1932 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
1933 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001934 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001935 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
1936 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
1937
1938 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001939 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001940 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08001941 * excessive noise added by the capture process, especially in dark conditions.</p>
1942 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
1943 * YUV domain.</p>
1944 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
1945 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
1946 * This mode is optional, may not be support by all devices. The application should check
1947 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001948 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
1949 * will be applied. HIGH_QUALITY mode indicates that the camera device
1950 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001951 * even if it slows down capture rate. FAST means the camera device will not
Zhijun He28079362013-12-17 10:35:40 -08001952 * slow down capture rate when applying noise filtering.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08001953 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
1954 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
1955 * may adjust the noise reduction parameters for best image quality based on the
1956 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001957 * <p><b>Possible values:</b>
1958 * <ul>
1959 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
1960 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
1961 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08001962 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001963 * </ul></p>
1964 * <p><b>Available values for this device:</b><br>
1965 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001966 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1967 * <p><b>Full capability</b> -
1968 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1969 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001970 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001971 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001972 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08001973 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001974 * @see #NOISE_REDUCTION_MODE_OFF
1975 * @see #NOISE_REDUCTION_MODE_FAST
1976 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08001977 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001978 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001979 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001980 public static final Key<Integer> NOISE_REDUCTION_MODE =
1981 new Key<Integer>("android.noiseReduction.mode", int.class);
1982
1983 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001984 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001985 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08001986 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001987 * <p><b>Units</b>: arbitrary integer assigned by application</p>
1988 * <p><b>Range of valid values:</b><br>
1989 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001990 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001991 * @hide
1992 */
1993 public static final Key<Integer> REQUEST_ID =
1994 new Key<Integer>("android.request.id", int.class);
1995
1996 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001997 * <p>The desired region of the sensor to read out for this capture.</p>
1998 * <p>This control can be used to implement digital zoom.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001999 * <p>The crop region coordinate system is based off
2000 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2001 * top-left corner of the sensor active array.</p>
2002 * <p>Output streams use this rectangle to produce their output,
2003 * cropping to a smaller region if necessary to maintain the
2004 * stream's aspect ratio, then scaling the sensor input to
2005 * match the output's configured resolution.</p>
2006 * <p>The crop region is applied after the RAW to other color
2007 * space (e.g. YUV) conversion. Since raw streams
2008 * (e.g. RAW16) don't have the conversion stage, they are not
2009 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002010 * <p>For non-raw streams, any additional per-stream cropping will
2011 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002012 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002013 * ratio, then 4:3 streams will use the exact crop
2014 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002015 * (letterbox).</p>
2016 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002017 * outputs will crop horizontally (pillarbox), and 16:9
2018 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002019 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002020 * <p>The width and height of the crop region cannot
2021 * be set to be smaller than
2022 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2023 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2024 * <p>The camera device may adjust the crop region to account
2025 * for rounding and other hardware requirements; the final
2026 * crop region used will be included in the output capture
2027 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002028 * <p><b>Units</b>: Pixel coordinates relative to
2029 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002030 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002031 *
2032 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002033 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002034 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002035 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002036 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2037 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2038
2039 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002040 * <p>Duration each pixel is exposed to
2041 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002042 * <p>If the sensor can't expose this exact duration, it will shorten the
2043 * duration exposed to the nearest possible value (rather than expose longer).
2044 * The final exposure time used will be available in the output capture result.</p>
2045 * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to
2046 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2047 * <p><b>Units</b>: Nanoseconds</p>
2048 * <p><b>Range of valid values:</b><br>
2049 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002050 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2051 * <p><b>Full capability</b> -
2052 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2053 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2054 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002055 * @see CaptureRequest#CONTROL_AE_MODE
2056 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002057 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002058 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002059 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002060 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002061 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2062 new Key<Long>("android.sensor.exposureTime", long.class);
2063
2064 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002065 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002066 * start of next frame exposure.</p>
2067 * <p>The maximum frame rate that can be supported by a camera subsystem is
2068 * a function of many factors:</p>
2069 * <ul>
2070 * <li>Requested resolutions of output image streams</li>
2071 * <li>Availability of binning / skipping modes on the imager</li>
2072 * <li>The bandwidth of the imager interface</li>
2073 * <li>The bandwidth of the various ISP processing blocks</li>
2074 * </ul>
2075 * <p>Since these factors can vary greatly between different ISPs and
2076 * sensors, the camera abstraction tries to represent the bandwidth
2077 * restrictions with as simple a model as possible.</p>
2078 * <p>The model presented has the following characteristics:</p>
2079 * <ul>
2080 * <li>The image sensor is always configured to output the smallest
2081 * resolution possible given the application's requested output stream
2082 * sizes. The smallest resolution is defined as being at least as large
2083 * as the largest requested output stream size; the camera pipeline must
2084 * never digitally upsample sensor data when the crop region covers the
2085 * whole sensor. In general, this means that if only small output stream
2086 * resolutions are configured, the sensor can provide a higher frame
2087 * rate.</li>
2088 * <li>Since any request may use any or all the currently configured
2089 * output streams, the sensor and ISP must be configured to support
2090 * scaling a single capture to all the streams at the same time. This
2091 * means the camera pipeline must be ready to produce the largest
2092 * requested output size without any delay. Therefore, the overall
2093 * frame rate of a given configured stream set is governed only by the
2094 * largest requested stream resolution.</li>
2095 * <li>Using more than one output stream in a request does not affect the
2096 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002097 * <li>Certain format-streams may need to do additional background processing
2098 * before data is consumed/produced by that stream. These processors
2099 * can run concurrently to the rest of the camera pipeline, but
2100 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002101 * </ul>
2102 * <p>The necessary information for the application, given the model above,
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002103 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field using
2104 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002105 * These are used to determine the maximum frame rate / minimum frame
2106 * duration that is possible for a given stream configuration.</p>
2107 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002108 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002109 * device:</p>
2110 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002111 * <li>Let the set of currently configured input/output streams
2112 * be called <code>S</code>.</li>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002113 * <li>Find the minimum frame durations for each stream in <code>S</code>, by looking
2114 * it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
2115 * (with its respective size/format). Let this set of frame durations be
2116 * called <code>F</code>.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002117 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2118 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2119 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002120 * </ol>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002121 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }
2122 * using its respective size/format), then the frame duration in <code>F</code>
2123 * determines the steady state frame rate that the application will get
2124 * if it uses <code>R</code> as a repeating request. Let this special kind of
2125 * request be called <code>Rsimple</code>.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002126 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2127 * by a single capture of a new request <code>Rstall</code> (which has at least
2128 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2129 * same minimum frame duration this will not cause a frame rate loss
2130 * if all buffers from the previous <code>Rstall</code> have already been
2131 * delivered.</p>
2132 * <p>For more details about stalling, see
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002133 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002134 * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to
2135 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2136 * <p><b>Units</b>: Nanoseconds</p>
2137 * <p><b>Range of valid values:</b><br>
2138 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
2139 * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
2140 * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002141 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2142 * <p><b>Full capability</b> -
2143 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2144 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002145 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002146 * @see CaptureRequest#CONTROL_AE_MODE
2147 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002148 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin9c595172014-05-12 13:56:20 -07002149 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002150 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002151 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002152 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002153 public static final Key<Long> SENSOR_FRAME_DURATION =
2154 new Key<Long>("android.sensor.frameDuration", long.class);
2155
2156 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002157 * <p>The amount of gain applied to sensor data
2158 * before processing.</p>
2159 * <p>The sensitivity is the standard ISO sensitivity value,
2160 * as defined in ISO 12232:2006.</p>
2161 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2162 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2163 * is guaranteed to use only analog amplification for applying the gain.</p>
2164 * <p>If the camera device cannot apply the exact sensitivity
2165 * requested, it will reduce the gain to the nearest supported
2166 * value. The final sensitivity used will be available in the
2167 * output capture result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002168 * <p><b>Units</b>: ISO arithmetic units</p>
2169 * <p><b>Range of valid values:</b><br>
2170 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002171 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2172 * <p><b>Full capability</b> -
2173 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2174 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002175 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002176 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002177 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2178 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002179 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002180 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002181 public static final Key<Integer> SENSOR_SENSITIVITY =
2182 new Key<Integer>("android.sensor.sensitivity", int.class);
2183
2184 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002185 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2186 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2187 * <p>Each color channel is treated as an unsigned 32-bit integer.
2188 * The camera device then uses the most significant X bits
2189 * that correspond to how many bits are in its Bayer raw sensor
2190 * output.</p>
2191 * <p>For example, a sensor with RAW10 Bayer output would use the
2192 * 10 most significant bits from each color channel.</p>
2193 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2194 *
2195 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2196 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002197 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002198 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2199 new Key<int[]>("android.sensor.testPatternData", int[].class);
2200
2201 /**
2202 * <p>When enabled, the sensor sends a test pattern instead of
2203 * doing a real exposure from the camera.</p>
2204 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002205 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002206 * work as normal.</p>
2207 * <p>For example, if manual flash is enabled, flash firing should still
2208 * occur (and that the test pattern remain unmodified, since the flash
2209 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002210 * <p>Defaults to OFF.</p>
2211 * <p><b>Possible values:</b>
2212 * <ul>
2213 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
2214 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
2215 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
2216 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
2217 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
2218 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
2219 * </ul></p>
2220 * <p><b>Available values for this device:</b><br>
2221 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002222 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002223 *
2224 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08002225 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2226 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2227 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2228 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2229 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2230 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2231 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002232 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002233 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2234 new Key<Integer>("android.sensor.testPatternMode", int.class);
2235
2236 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002237 * <p>Quality of lens shading correction applied
2238 * to the image data.</p>
2239 * <p>When set to OFF mode, no lens shading correction will be applied by the
2240 * camera device, and an identity lens shading map data will be provided
2241 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002242 * shading map with size of <code>[ 4, 3 ]</code>,
2243 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
2244 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002245 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002246 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2247 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2248 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2249 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2250 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08002251 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002252 * <p>When set to other modes, lens shading correction will be applied by the camera
2253 * device. Applications can request lens shading map data by setting
2254 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
2255 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
2256 * data will be the one applied by the camera device for this capture request.</p>
2257 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
2258 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
2259 * AWB are in AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code>
2260 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
2261 * to be converged before using the returned shading map data.</p>
2262 * <p><b>Possible values:</b>
2263 * <ul>
2264 * <li>{@link #SHADING_MODE_OFF OFF}</li>
2265 * <li>{@link #SHADING_MODE_FAST FAST}</li>
2266 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2267 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002268 * <p><b>Available values for this device:</b><br>
2269 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002270 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2271 * <p><b>Full capability</b> -
2272 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2273 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002274 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002275 * @see CaptureRequest#CONTROL_AE_MODE
2276 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002277 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002278 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002279 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08002280 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2281 * @see #SHADING_MODE_OFF
2282 * @see #SHADING_MODE_FAST
2283 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08002284 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002285 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08002286 public static final Key<Integer> SHADING_MODE =
2287 new Key<Integer>("android.shading.mode", int.class);
2288
2289 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002290 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002291 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002292 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002293 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002294 * fields.</p>
2295 * <p><b>Possible values:</b>
2296 * <ul>
2297 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
2298 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
2299 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
2300 * </ul></p>
2301 * <p><b>Available values for this device:</b><br>
2302 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
2303 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002304 *
2305 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002306 * @see #STATISTICS_FACE_DETECT_MODE_OFF
2307 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
2308 * @see #STATISTICS_FACE_DETECT_MODE_FULL
2309 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002310 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002311 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
2312 new Key<Integer>("android.statistics.faceDetectMode", int.class);
2313
2314 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002315 * <p>Operating mode for hot pixel map generation.</p>
2316 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
2317 * If set to <code>false</code>, no hot pixel map will be returned.</p>
2318 * <p><b>Range of valid values:</b><br>
2319 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002320 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002321 *
2322 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
2323 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
2324 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002325 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002326 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
2327 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
2328
2329 /**
Zhijun Hecc28a412014-02-24 15:11:23 -08002330 * <p>Whether the camera device will output the lens
2331 * shading map in output result metadata.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002332 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002333 * android.statistics.lensShadingMap will be provided in
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002334 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002335 * <p>ON is always supported on devices with the RAW capability.</p>
2336 * <p><b>Possible values:</b>
2337 * <ul>
2338 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
2339 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
2340 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002341 * <p><b>Available values for this device:</b><br>
2342 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002343 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2344 * <p><b>Full capability</b> -
2345 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2346 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2347 *
2348 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002349 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
Eino-Ville Talvalad96748b2013-09-12 11:11:27 -07002350 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2351 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2352 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002353 @PublicKey
Eino-Ville Talvalad96748b2013-09-12 11:11:27 -07002354 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2355 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2356
2357 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002358 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08002359 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2360 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002361 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002362 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2363 * <p><b>Full capability</b> -
2364 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2365 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002366 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002367 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08002368 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002369 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002370 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002371 public static final Key<float[]> TONEMAP_CURVE_BLUE =
2372 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002373
2374 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002375 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08002376 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2377 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002378 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002379 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2380 * <p><b>Full capability</b> -
2381 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2382 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002383 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002384 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08002385 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002386 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002387 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002388 public static final Key<float[]> TONEMAP_CURVE_GREEN =
2389 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002390
2391 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002392 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08002393 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2394 * CONTRAST_CURVE.</p>
2395 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002396 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002397 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08002398 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002399 * <p>These are sorted in order of increasing <code>Pin</code>; it is
2400 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08002401 * define a complete mapping. For input values between control points,
2402 * the camera device must linearly interpolate between the control
2403 * points.</p>
2404 * <p>Each curve can have an independent number of points, and the number
2405 * of points can be less than max (that is, the request doesn't have to
2406 * always provide a curve with number of points equivalent to
2407 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2408 * <p>A few examples, and their corresponding graphical mappings; these
2409 * only specify the red channel and the precision is limited to 4
2410 * digits, for conciseness.</p>
2411 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002412 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002413 * </code></pre>
2414 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2415 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002416 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002417 * </code></pre>
2418 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2419 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002420 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002421 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2422 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2423 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2424 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002425 * </code></pre>
2426 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2427 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002428 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002429 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2430 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2431 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2432 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002433 * </code></pre>
2434 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002435 * <p><b>Range of valid values:</b><br>
2436 * 0-1 on both input and output coordinates, normalized
2437 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002438 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2439 * <p><b>Full capability</b> -
2440 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2441 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002442 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002443 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08002444 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002445 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002446 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002447 */
2448 public static final Key<float[]> TONEMAP_CURVE_RED =
2449 new Key<float[]>("android.tonemap.curveRed", float[].class);
2450
2451 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002452 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
2453 * is CONTRAST_CURVE.</p>
2454 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
2455 * channels respectively. The following example uses the red channel as an
2456 * example. The same logic applies to green and blue channel.
2457 * Each channel's curve is defined by an array of control points:</p>
2458 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002459 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002460 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
2461 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2462 * guaranteed that input values 0.0 and 1.0 are included in the list to
2463 * define a complete mapping. For input values between control points,
2464 * the camera device must linearly interpolate between the control
2465 * points.</p>
2466 * <p>Each curve can have an independent number of points, and the number
2467 * of points can be less than max (that is, the request doesn't have to
2468 * always provide a curve with number of points equivalent to
2469 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2470 * <p>A few examples, and their corresponding graphical mappings; these
2471 * only specify the red channel and the precision is limited to 4
2472 * digits, for conciseness.</p>
2473 * <p>Linear mapping:</p>
2474 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
2475 * </code></pre>
2476 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2477 * <p>Invert mapping:</p>
2478 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
2479 * </code></pre>
2480 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2481 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
2482 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002483 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
2484 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
2485 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
2486 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002487 * </code></pre>
2488 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2489 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
2490 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002491 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
2492 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
2493 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
2494 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002495 * </code></pre>
2496 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002497 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2498 * <p><b>Full capability</b> -
2499 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2500 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002501 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002502 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002503 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
2504 * @see CaptureRequest#TONEMAP_MODE
2505 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002506 @PublicKey
2507 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002508 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
2509 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
2510
2511 /**
Igor Murashkine0060932014-01-17 17:24:11 -08002512 * <p>High-level global contrast/gamma/tonemapping control.</p>
2513 * <p>When switching to an application-defined contrast curve by setting
2514 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
2515 * per-channel with a set of <code>(in, out)</code> points that specify the
2516 * mapping from input high-bit-depth pixel value to the output
2517 * low-bit-depth value. Since the actual pixel ranges of both input
2518 * and output may change depending on the camera pipeline, the values
2519 * are specified by normalized floating-point numbers.</p>
2520 * <p>More-complex color mapping operations such as 3D color look-up
2521 * tables, selective chroma enhancement, or other non-linear color
2522 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2523 * CONTRAST_CURVE.</p>
2524 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002525 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08002526 * These values are always available, and as close as possible to the
2527 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07002528 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08002529 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
2530 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002531 * <p><b>Possible values:</b>
2532 * <ul>
2533 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
2534 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
2535 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08002536 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
2537 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002538 * </ul></p>
2539 * <p><b>Available values for this device:</b><br>
2540 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002541 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2542 * <p><b>Full capability</b> -
2543 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2544 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002545 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002546 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002547 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002548 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08002549 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002550 * @see #TONEMAP_MODE_CONTRAST_CURVE
2551 * @see #TONEMAP_MODE_FAST
2552 * @see #TONEMAP_MODE_HIGH_QUALITY
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08002553 * @see #TONEMAP_MODE_GAMMA_VALUE
2554 * @see #TONEMAP_MODE_PRESET_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002555 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002556 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002557 public static final Key<Integer> TONEMAP_MODE =
2558 new Key<Integer>("android.tonemap.mode", int.class);
2559
2560 /**
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08002561 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2562 * GAMMA_VALUE</p>
2563 * <p>The tonemap curve will be defined the following formula:
2564 * * OUT = pow(IN, 1.0 / gamma)
2565 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
2566 * pow is the power function and gamma is the gamma value specified by this
2567 * key.</p>
2568 * <p>The same curve will be applied to all color channels. The camera device
2569 * may clip the input gamma value to its supported range. The actual applied
2570 * value will be returned in capture result.</p>
2571 * <p>The valid range of gamma value varies on different devices, but values
2572 * within [1.0, 5.0] are guaranteed not to be clipped.</p>
2573 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2574 *
2575 * @see CaptureRequest#TONEMAP_MODE
2576 */
2577 @PublicKey
2578 public static final Key<Float> TONEMAP_GAMMA =
2579 new Key<Float>("android.tonemap.gamma", float.class);
2580
2581 /**
2582 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2583 * PRESET_CURVE</p>
2584 * <p>The tonemap curve will be defined by specified standard.</p>
2585 * <p>sRGB (approximated by 16 control points):</p>
2586 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
2587 * <p>Rec. 709 (approximated by 16 control points):</p>
2588 * <p><img alt="Rec. 709 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p>
2589 * <p>Note that above figures show a 16 control points approximation of preset
2590 * curves. Camera devices may apply a different approximation to the curve.</p>
2591 * <p><b>Possible values:</b>
2592 * <ul>
2593 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
2594 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
2595 * </ul></p>
2596 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2597 *
2598 * @see CaptureRequest#TONEMAP_MODE
2599 * @see #TONEMAP_PRESET_CURVE_SRGB
2600 * @see #TONEMAP_PRESET_CURVE_REC709
2601 */
2602 @PublicKey
2603 public static final Key<Integer> TONEMAP_PRESET_CURVE =
2604 new Key<Integer>("android.tonemap.presetCurve", int.class);
2605
2606 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002607 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002608 * that the camera is powered on and may be streaming images back to the
2609 * Application Processor. In certain rare circumstances, the OS may
2610 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002611 * any untrusted applications.</p>
2612 * <p>In particular, the LED <em>must</em> always be on when the data could be
2613 * transmitted off the device. The LED <em>should</em> always be on whenever
2614 * data is stored locally on the device.</p>
2615 * <p>The LED <em>may</em> be off if a trusted application is using the data that
2616 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002617 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002618 * @hide
2619 */
2620 public static final Key<Boolean> LED_TRANSMIT =
2621 new Key<Boolean>("android.led.transmit", boolean.class);
2622
2623 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002624 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002625 * to its current values, or is free to vary.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002626 * <p>When set to <code>true</code> (ON), the values used for black-level
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002627 * compensation will not change until the lock is set to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002628 * <code>false</code> (OFF).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002629 * <p>Since changes to certain capture parameters (such as
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002630 * exposure time) may require resetting of black level
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002631 * compensation, the camera device must report whether setting
2632 * the black level lock was successful in the output result
Igor Murashkinace5bf02013-12-10 17:36:40 -08002633 * metadata.</p>
2634 * <p>For example, if a sequence of requests is as follows:</p>
2635 * <ul>
2636 * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li>
2637 * <li>Request 2: Exposure = 10ms, Black level lock = ON</li>
2638 * <li>Request 3: Exposure = 10ms, Black level lock = ON</li>
2639 * <li>Request 4: Exposure = 20ms, Black level lock = ON</li>
2640 * <li>Request 5: Exposure = 20ms, Black level lock = ON</li>
2641 * <li>Request 6: Exposure = 20ms, Black level lock = ON</li>
2642 * </ul>
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002643 * <p>And the exposure change in Request 4 requires the camera
2644 * device to reset the black level offsets, then the output
2645 * result metadata is expected to be:</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002646 * <ul>
2647 * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li>
2648 * <li>Result 2: Exposure = 10ms, Black level lock = ON</li>
2649 * <li>Result 3: Exposure = 10ms, Black level lock = ON</li>
2650 * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li>
2651 * <li>Result 5: Exposure = 20ms, Black level lock = ON</li>
2652 * <li>Result 6: Exposure = 20ms, Black level lock = ON</li>
2653 * </ul>
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002654 * <p>This indicates to the application that on frame 4, black
2655 * levels were reset due to exposure value changes, and pixel
2656 * values may not be consistent across captures.</p>
2657 * <p>The camera device will maintain the lock to the extent
2658 * possible, only overriding the lock to OFF when changes to
2659 * other request parameters require a black level recalculation
2660 * or reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002661 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2662 * <p><b>Full capability</b> -
2663 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2664 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2665 *
2666 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002667 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002668 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002669 public static final Key<Boolean> BLACK_LEVEL_LOCK =
2670 new Key<Boolean>("android.blackLevel.lock", boolean.class);
2671
Zhijun He0e99c222015-01-29 15:26:05 -08002672 /**
2673 * <p>The amount of exposure time increase factor applied to the original output
2674 * frame by the application processing before sending for reprocessing.</p>
2675 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
2676 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
2677 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
2678 * output frames to effectively reduce the noise to the same level as a frame that was
2679 * captured with longer exposure time. To be more specific, assuming the original captured
2680 * images were captured with a sensitivity of S and an exposure time of T, the model in
2681 * the camera device is that the amount of noise in the image would be approximately what
2682 * would be expected if the original capture parameters had been a sensitivity of
2683 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
2684 * than S and T respectively. If the captured images were processed by the application
2685 * before being sent for reprocessing, then the application may have used image processing
2686 * algorithms and/or multi-frame image fusion to reduce the noise in the
2687 * application-processed images (input images). By using the effectiveExposureFactor
2688 * control, the application can communicate to the camera device the actual noise level
2689 * improvement in the application-processed image. With this information, the camera
2690 * device can select appropriate noise reduction and edge enhancement parameters to avoid
2691 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
2692 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
2693 * <p>For example, for multi-frame image fusion use case, the application may fuse
2694 * multiple output frames together to a final frame for reprocessing. When N image are
2695 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
2696 * square root of N (based on a simple photon shot noise model). The camera device will
2697 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
2698 * produce the best quality images.</p>
2699 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
2700 * buffer in a way that affects its effective exposure time.</p>
2701 * <p>This control is only effective for YUV reprocessing capture request. For noise
2702 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
2703 * Similarly, for edge enhancement reprocessing, it is only effective when
2704 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
2705 * <p><b>Units</b>: Relative exposure time increase factor.</p>
2706 * <p><b>Range of valid values:</b><br>
2707 * &gt;= 1.0</p>
2708 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07002709 * <p><b>Limited capability</b> -
2710 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2711 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002712 *
2713 * @see CaptureRequest#EDGE_MODE
Zhijun He513f7c32015-04-24 18:23:54 -07002714 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002715 * @see CaptureRequest#NOISE_REDUCTION_MODE
2716 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2717 */
2718 @PublicKey
2719 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
2720 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
2721
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002722 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2723 * End generated code
2724 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07002725
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002726
2727
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002728}