blob: 411a97e3eca48fc2d4df0cf7ea0c2f807288e97e [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;
Yin-Chia Yehc60af902017-11-10 20:02:29 -080024import android.hardware.camera2.params.OutputConfiguration;
Ruben Brunk5776aaf2014-06-19 13:42:40 -070025import android.hardware.camera2.utils.HashCodeHelpers;
Igor Murashkind6d65152014-05-19 16:31:02 -070026import android.hardware.camera2.utils.TypeReference;
Yin-Chia Yeh4f151472018-02-21 12:38:19 -080027import android.hardware.camera2.utils.SurfaceUtils;
Igor Murashkin70725502013-06-25 20:27:06 +000028import android.os.Parcel;
29import android.os.Parcelable;
Yin-Chia Yehc60af902017-11-10 20:02:29 -080030import android.util.ArraySet;
31import android.util.Log;
32import android.util.SparseArray;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080033import android.view.Surface;
34
Ruben Brunkfeb50af2014-05-09 19:58:49 -070035import java.util.Collection;
36import java.util.Collections;
Emilian Peev2100ae72018-01-12 16:56:25 +000037import java.util.HashMap;
Igor Murashkind6d65152014-05-19 16:31:02 -070038import java.util.List;
Emilian Peev2100ae72018-01-12 16:56:25 +000039import java.util.Map;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -070040import java.util.Objects;
Emilian Peev2100ae72018-01-12 16:56:25 +000041import java.util.Set;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080042
43/**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070044 * <p>An immutable package of settings and outputs needed to capture a single
45 * image from the camera device.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080046 *
47 * <p>Contains the configuration for the capture hardware (sensor, lens, flash),
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070048 * the processing pipeline, the control algorithms, and the output buffers. Also
49 * contains the list of target Surfaces to send image data to for this
50 * capture.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080051 *
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070052 * <p>CaptureRequests can be created by using a {@link Builder} instance,
53 * obtained by calling {@link CameraDevice#createCaptureRequest}</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080054 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -070055 * <p>CaptureRequests are given to {@link CameraCaptureSession#capture} or
56 * {@link CameraCaptureSession#setRepeatingRequest} to capture images from a camera.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080057 *
58 * <p>Each request can specify a different subset of target Surfaces for the
59 * camera to send the captured data to. All the surfaces used in a request must
60 * be part of the surface list given to the last call to
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -070061 * {@link CameraDevice#createCaptureSession}, when the request is submitted to the
62 * session.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080063 *
64 * <p>For example, a request meant for repeating preview might only include the
65 * Surface for the preview SurfaceView or SurfaceTexture, while a
66 * high-resolution still capture would also include a Surface from a ImageReader
67 * configured for high-resolution JPEG images.</p>
68 *
Eino-Ville Talvala0aa2bde2015-05-19 17:25:54 -070069 * <p>A reprocess capture request allows a previously-captured image from the camera device to be
70 * sent back to the device for further processing. It can be created with
Eino-Ville Talvalabd7f34f2015-05-21 11:10:51 -070071 * {@link CameraDevice#createReprocessCaptureRequest}, and used with a reprocessable capture session
Eino-Ville Talvala0aa2bde2015-05-19 17:25:54 -070072 * created with {@link CameraDevice#createReprocessableCaptureSession}.</p>
73 *
74 * @see CameraCaptureSession#capture
75 * @see CameraCaptureSession#setRepeatingRequest
76 * @see CameraCaptureSession#captureBurst
77 * @see CameraCaptureSession#setRepeatingBurst
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070078 * @see CameraDevice#createCaptureRequest
Eino-Ville Talvala0aa2bde2015-05-19 17:25:54 -070079 * @see CameraDevice#createReprocessCaptureRequest
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080080 */
Igor Murashkind6d65152014-05-19 16:31:02 -070081public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
82 implements Parcelable {
83
84 /**
85 * A {@code Key} is used to do capture request field lookups with
86 * {@link CaptureResult#get} or to set fields with
87 * {@link CaptureRequest.Builder#set(Key, Object)}.
88 *
89 * <p>For example, to set the crop rectangle for the next capture:
90 * <code><pre>
91 * Rect cropRectangle = new Rect(0, 0, 640, 480);
92 * captureRequestBuilder.set(SCALER_CROP_REGION, cropRectangle);
93 * </pre></code>
94 * </p>
95 *
96 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
97 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
98 *
99 * @see CaptureResult#get
100 * @see CameraCharacteristics#getAvailableCaptureResultKeys
101 */
102 public final static class Key<T> {
103 private final CameraMetadataNative.Key<T> mKey;
104
105 /**
106 * Visible for testing and vendor extensions only.
107 *
108 * @hide
109 */
Emilian Peevde62d842017-03-23 19:20:40 +0000110 public Key(String name, Class<T> type, long vendorId) {
111 mKey = new CameraMetadataNative.Key<T>(name, type, vendorId);
112 }
113
114 /**
115 * Visible for testing and vendor extensions only.
116 *
117 * @hide
118 */
Igor Murashkind6d65152014-05-19 16:31:02 -0700119 public Key(String name, Class<T> type) {
120 mKey = new CameraMetadataNative.Key<T>(name, type);
121 }
122
123 /**
124 * Visible for testing and vendor extensions only.
125 *
126 * @hide
127 */
128 public Key(String name, TypeReference<T> typeReference) {
129 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
130 }
131
132 /**
133 * Return a camelCase, period separated name formatted like:
134 * {@code "root.section[.subsections].name"}.
135 *
136 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
137 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
138 *
139 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
140 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
141 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
142 *
143 * @return String representation of the key name
144 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700145 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700146 public String getName() {
147 return mKey.getName();
148 }
149
150 /**
Emilian Peevde62d842017-03-23 19:20:40 +0000151 * Return vendor tag id.
152 *
153 * @hide
154 */
155 public long getVendorId() {
156 return mKey.getVendorId();
157 }
158
159 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700160 * {@inheritDoc}
161 */
162 @Override
163 public final int hashCode() {
164 return mKey.hashCode();
165 }
166
167 /**
168 * {@inheritDoc}
169 */
170 @SuppressWarnings("unchecked")
171 @Override
172 public final boolean equals(Object o) {
173 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
174 }
175
176 /**
Chien-Yu Chen12a83852015-07-07 12:17:22 -0700177 * Return this {@link Key} as a string representation.
178 *
179 * <p>{@code "CaptureRequest.Key(%s)"}, where {@code %s} represents
180 * the name of this key as returned by {@link #getName}.</p>
181 *
182 * @return string representation of {@link Key}
183 */
184 @NonNull
185 @Override
186 public String toString() {
187 return String.format("CaptureRequest.Key(%s)", mKey.getName());
188 }
189
190 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700191 * Visible for CameraMetadataNative implementation only; do not use.
192 *
193 * TODO: Make this private or remove it altogether.
194 *
195 * @hide
196 */
197 public CameraMetadataNative.Key<T> getNativeKey() {
198 return mKey;
199 }
200
201 @SuppressWarnings({ "unchecked" })
202 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
203 mKey = (CameraMetadataNative.Key<T>) nativeKey;
204 }
205 }
Igor Murashkin70725502013-06-25 20:27:06 +0000206
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800207 private final String TAG = "CaptureRequest-JV";
208
209 private final ArraySet<Surface> mSurfaceSet = new ArraySet<Surface>();
210
211 // Speed up sending CaptureRequest across IPC:
212 // mSurfaceConverted should only be set to true during capture request
213 // submission by {@link #convertSurfaceToStreamId}. The method will convert
214 // surfaces to stream/surface indexes based on passed in stream configuration at that time.
215 // This will save significant unparcel time for remote camera device.
216 // Once the request is submitted, camera device will call {@link #recoverStreamIdToSurface}
217 // to reset the capture request back to its original state.
218 private final Object mSurfacesLock = new Object();
219 private boolean mSurfaceConverted = false;
220 private int[] mStreamIdxArray;
221 private int[] mSurfaceIdxArray;
222
223 private static final ArraySet<Surface> mEmptySurfaceSet = new ArraySet<Surface>();
224
Emilian Peev2100ae72018-01-12 16:56:25 +0000225 private String mLogicalCameraId;
226 private CameraMetadataNative mLogicalCameraSettings;
227 private final HashMap<String, CameraMetadataNative> mPhysicalCameraSettings =
228 new HashMap<String, CameraMetadataNative>();
229
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700230 private boolean mIsReprocess;
Zhijun Hea7677722015-06-01 16:36:06 -0700231 // If this request is part of constrained high speed request list that was created by
Eino-Ville Talvala639fffe2015-06-30 10:34:48 -0700232 // {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}
Zhijun Hea7677722015-06-01 16:36:06 -0700233 private boolean mIsPartOfCHSRequestList = false;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700234 // Each reprocess request must be tied to a reprocessable session ID.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700235 // Valid only for reprocess requests (mIsReprocess == true).
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700236 private int mReprocessableSessionId;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700237
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700238 private Object mUserTag;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800239
240 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700241 * Construct empty request.
242 *
243 * Used by Binder to unparcel this object only.
Igor Murashkin70725502013-06-25 20:27:06 +0000244 */
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700245 private CaptureRequest() {
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700246 mIsReprocess = false;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700247 mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800248 }
249
250 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700251 * Clone from source capture request.
252 *
253 * Used by the Builder to create an immutable copy.
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800254 */
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700255 @SuppressWarnings("unchecked")
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700256 private CaptureRequest(CaptureRequest source) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000257 mLogicalCameraId = new String(source.mLogicalCameraId);
258 for (Map.Entry<String, CameraMetadataNative> entry :
259 source.mPhysicalCameraSettings.entrySet()) {
260 mPhysicalCameraSettings.put(new String(entry.getKey()),
261 new CameraMetadataNative(entry.getValue()));
262 }
263 mLogicalCameraSettings = mPhysicalCameraSettings.get(mLogicalCameraId);
264 setNativeInstance(mLogicalCameraSettings);
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800265 mSurfaceSet.addAll(source.mSurfaceSet);
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700266 mIsReprocess = source.mIsReprocess;
Zhijun Hea7677722015-06-01 16:36:06 -0700267 mIsPartOfCHSRequestList = source.mIsPartOfCHSRequestList;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700268 mReprocessableSessionId = source.mReprocessableSessionId;
Eino-Ville Talvala7b01c5c2013-10-08 19:34:29 -0700269 mUserTag = source.mUserTag;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800270 }
271
272 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700273 * Take ownership of passed-in settings.
274 *
275 * Used by the Builder to create a mutable CaptureRequest.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700276 *
277 * @param settings Settings for this capture request.
278 * @param isReprocess Indicates whether to create a reprocess capture request. {@code true}
279 * to create a reprocess capture request. {@code false} to create a regular
280 * capture request.
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700281 * @param reprocessableSessionId The ID of the camera capture session this capture is created
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700282 * for. This is used to validate if the application submits a
283 * reprocess capture request to the same session where
284 * the {@link TotalCaptureResult}, used to create the reprocess
285 * capture, came from.
Emilian Peev2100ae72018-01-12 16:56:25 +0000286 * @param logicalCameraId Camera Id of the actively open camera that instantiates the
287 * Builder.
288 *
289 * @param physicalCameraIdSet A set of physical camera ids that can be used to customize
290 * the request for a specific physical camera.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700291 *
292 * @throws IllegalArgumentException If creating a reprocess capture request with an invalid
Emilian Peev2100ae72018-01-12 16:56:25 +0000293 * reprocessableSessionId, or multiple physical cameras.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700294 *
295 * @see CameraDevice#createReprocessCaptureRequest
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800296 */
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700297 private CaptureRequest(CameraMetadataNative settings, boolean isReprocess,
Emilian Peev2100ae72018-01-12 16:56:25 +0000298 int reprocessableSessionId, String logicalCameraId, Set<String> physicalCameraIdSet) {
299 if ((physicalCameraIdSet != null) && isReprocess) {
300 throw new IllegalArgumentException("Create a reprocess capture request with " +
301 "with more than one physical camera is not supported!");
302 }
303
304 mLogicalCameraId = logicalCameraId;
305 mLogicalCameraSettings = CameraMetadataNative.move(settings);
306 mPhysicalCameraSettings.put(mLogicalCameraId, mLogicalCameraSettings);
307 if (physicalCameraIdSet != null) {
308 for (String physicalId : physicalCameraIdSet) {
309 mPhysicalCameraSettings.put(physicalId, new CameraMetadataNative(
310 mLogicalCameraSettings));
311 }
312 }
313
314 setNativeInstance(mLogicalCameraSettings);
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700315 mIsReprocess = isReprocess;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700316 if (isReprocess) {
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700317 if (reprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) {
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700318 throw new IllegalArgumentException("Create a reprocess capture request with an " +
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700319 "invalid session ID: " + reprocessableSessionId);
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700320 }
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700321 mReprocessableSessionId = reprocessableSessionId;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700322 } else {
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700323 mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700324 }
Igor Murashkin70725502013-06-25 20:27:06 +0000325 }
326
Igor Murashkind6d65152014-05-19 16:31:02 -0700327 /**
328 * Get a capture request field value.
329 *
330 * <p>The field definitions can be found in {@link CaptureRequest}.</p>
331 *
332 * <p>Querying the value for the same key more than once will return a value
333 * which is equal to the previous queried value.</p>
334 *
335 * @throws IllegalArgumentException if the key was not valid
336 *
337 * @param key The result field to read.
338 * @return The value of that key, or {@code null} if the field is not set.
339 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700340 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700341 public <T> T get(Key<T> key) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000342 return mLogicalCameraSettings.get(key);
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700343 }
344
345 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700346 * {@inheritDoc}
347 * @hide
348 */
349 @SuppressWarnings("unchecked")
350 @Override
351 protected <T> T getProtected(Key<?> key) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000352 return (T) mLogicalCameraSettings.get(key);
Igor Murashkind6d65152014-05-19 16:31:02 -0700353 }
354
355 /**
356 * {@inheritDoc}
357 * @hide
358 */
359 @SuppressWarnings("unchecked")
360 @Override
361 protected Class<Key<?>> getKeyClass() {
362 Object thisClass = Key.class;
363 return (Class<Key<?>>)thisClass;
364 }
365
366 /**
367 * {@inheritDoc}
368 */
369 @Override
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700370 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700371 public List<Key<?>> getKeys() {
372 // Force the javadoc for this function to show up on the CaptureRequest page
373 return super.getKeys();
374 }
375
376 /**
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700377 * Retrieve the tag for this request, if any.
378 *
379 * <p>This tag is not used for anything by the camera device, but can be
380 * used by an application to easily identify a CaptureRequest when it is
381 * returned by
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700382 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700383 * </p>
384 *
385 * @return the last tag Object set on this request, or {@code null} if
386 * no tag has been set.
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700387 * @see Builder#setTag
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700388 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700389 @Nullable
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700390 public Object getTag() {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700391 return mUserTag;
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700392 }
393
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700394 /**
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700395 * Determine if this is a reprocess capture request.
396 *
397 * <p>A reprocess capture request produces output images from an input buffer from the
398 * {@link CameraCaptureSession}'s input {@link Surface}. A reprocess capture request can be
399 * created by {@link CameraDevice#createReprocessCaptureRequest}.</p>
400 *
401 * @return {@code true} if this is a reprocess capture request. {@code false} if this is not a
402 * reprocess capture request.
403 *
404 * @see CameraDevice#createReprocessCaptureRequest
405 */
406 public boolean isReprocess() {
407 return mIsReprocess;
408 }
409
410 /**
Zhijun Hea7677722015-06-01 16:36:06 -0700411 * <p>Determine if this request is part of a constrained high speed request list that was
Eino-Ville Talvala639fffe2015-06-30 10:34:48 -0700412 * created by
413 * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}.
414 * A constrained high speed request list contains some constrained high speed capture requests
415 * with certain interleaved pattern that is suitable for high speed preview/video streaming. An
416 * active constrained high speed capture session only accepts constrained high speed request
417 * lists. This method can be used to do the sanity check when a constrained high speed capture
418 * session receives a request list via {@link CameraCaptureSession#setRepeatingBurst} or
419 * {@link CameraCaptureSession#captureBurst}. </p>
Zhijun Hea7677722015-06-01 16:36:06 -0700420 *
421 *
422 * @return {@code true} if this request is part of a constrained high speed request list,
423 * {@code false} otherwise.
424 *
425 * @hide
426 */
427 public boolean isPartOfCRequestList() {
428 return mIsPartOfCHSRequestList;
429 }
430
431 /**
432 * Returns a copy of the underlying {@link CameraMetadataNative}.
433 * @hide
434 */
435 public CameraMetadataNative getNativeCopy() {
Emilian Peev2100ae72018-01-12 16:56:25 +0000436 return new CameraMetadataNative(mLogicalCameraSettings);
Zhijun Hea7677722015-06-01 16:36:06 -0700437 }
438
439 /**
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700440 * Get the reprocessable session ID this reprocess capture request is associated with.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700441 *
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700442 * @return the reprocessable session ID this reprocess capture request is associated with
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700443 *
444 * @throws IllegalStateException if this capture request is not a reprocess capture request.
445 * @hide
446 */
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700447 public int getReprocessableSessionId() {
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700448 if (mIsReprocess == false ||
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700449 mReprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) {
450 throw new IllegalStateException("Getting the reprocessable session ID for a "+
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700451 "non-reprocess capture request is illegal.");
452 }
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700453 return mReprocessableSessionId;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700454 }
455
456 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700457 * Determine whether this CaptureRequest is equal to another CaptureRequest.
458 *
459 * <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 -0700460 * list of output surfaces is equal, the user tag is equal, and the return values of
461 * isReprocess() are equal.</p>
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700462 *
463 * @param other Another instance of CaptureRequest.
464 *
465 * @return True if the requests are the same, false otherwise.
466 */
467 @Override
468 public boolean equals(Object other) {
469 return other instanceof CaptureRequest
470 && equals((CaptureRequest)other);
471 }
472
473 private boolean equals(CaptureRequest other) {
474 return other != null
475 && Objects.equals(mUserTag, other.mUserTag)
476 && mSurfaceSet.equals(other.mSurfaceSet)
Emilian Peev2100ae72018-01-12 16:56:25 +0000477 && mPhysicalCameraSettings.equals(other.mPhysicalCameraSettings)
478 && mLogicalCameraId.equals(other.mLogicalCameraId)
479 && mLogicalCameraSettings.equals(other.mLogicalCameraSettings)
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700480 && mIsReprocess == other.mIsReprocess
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700481 && mReprocessableSessionId == other.mReprocessableSessionId;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700482 }
483
484 @Override
485 public int hashCode() {
Emilian Peev2100ae72018-01-12 16:56:25 +0000486 return HashCodeHelpers.hashCodeGeneric(mPhysicalCameraSettings, mSurfaceSet, mUserTag);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700487 }
488
Igor Murashkin70725502013-06-25 20:27:06 +0000489 public static final Parcelable.Creator<CaptureRequest> CREATOR =
490 new Parcelable.Creator<CaptureRequest>() {
491 @Override
492 public CaptureRequest createFromParcel(Parcel in) {
493 CaptureRequest request = new CaptureRequest();
494 request.readFromParcel(in);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700495
Igor Murashkin70725502013-06-25 20:27:06 +0000496 return request;
497 }
498
499 @Override
500 public CaptureRequest[] newArray(int size) {
501 return new CaptureRequest[size];
502 }
503 };
504
505 /**
506 * Expand this object from a Parcel.
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700507 * Hidden since this breaks the immutability of CaptureRequest, but is
508 * needed to receive CaptureRequests with aidl.
509 *
Igor Murashkin70725502013-06-25 20:27:06 +0000510 * @param in The parcel from which the object should be read
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700511 * @hide
Igor Murashkin70725502013-06-25 20:27:06 +0000512 */
Igor Murashkin72f9f0a2014-05-14 15:46:10 -0700513 private void readFromParcel(Parcel in) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000514 int physicalCameraCount = in.readInt();
515 if (physicalCameraCount <= 0) {
516 throw new RuntimeException("Physical camera count" + physicalCameraCount +
517 " should always be positive");
518 }
519
520 //Always start with the logical camera id
521 mLogicalCameraId = in.readString();
522 mLogicalCameraSettings = new CameraMetadataNative();
523 mLogicalCameraSettings.readFromParcel(in);
524 setNativeInstance(mLogicalCameraSettings);
525 mPhysicalCameraSettings.put(mLogicalCameraId, mLogicalCameraSettings);
526 for (int i = 1; i < physicalCameraCount; i++) {
527 String physicalId = in.readString();
528 CameraMetadataNative physicalCameraSettings = new CameraMetadataNative();
529 physicalCameraSettings.readFromParcel(in);
530 mPhysicalCameraSettings.put(physicalId, physicalCameraSettings);
531 }
532
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700533 mIsReprocess = (in.readInt() == 0) ? false : true;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700534 mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800535
536 synchronized (mSurfacesLock) {
537 mSurfaceSet.clear();
538 Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader());
539 if (parcelableArray != null) {
540 for (Parcelable p : parcelableArray) {
541 Surface s = (Surface) p;
542 mSurfaceSet.add(s);
543 }
544 }
545 // Intentionally disallow java side readFromParcel to receive streamIdx/surfaceIdx
546 // Since there is no good way to convert indexes back to Surface
547 int streamSurfaceSize = in.readInt();
548 if (streamSurfaceSize != 0) {
549 throw new RuntimeException("Reading cached CaptureRequest is not supported");
550 }
551 }
Igor Murashkin70725502013-06-25 20:27:06 +0000552 }
553
554 @Override
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700555 public int describeContents() {
556 return 0;
557 }
Igor Murashkin70725502013-06-25 20:27:06 +0000558
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700559 @Override
560 public void writeToParcel(Parcel dest, int flags) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000561 int physicalCameraCount = mPhysicalCameraSettings.size();
562 dest.writeInt(physicalCameraCount);
563 //Logical camera id and settings always come first.
564 dest.writeString(mLogicalCameraId);
565 mLogicalCameraSettings.writeToParcel(dest, flags);
566 for (Map.Entry<String, CameraMetadataNative> entry : mPhysicalCameraSettings.entrySet()) {
567 if (entry.getKey().equals(mLogicalCameraId)) {
568 continue;
569 }
570 dest.writeString(entry.getKey());
571 entry.getValue().writeToParcel(dest, flags);
572 }
573
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700574 dest.writeInt(mIsReprocess ? 1 : 0);
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800575
576 synchronized (mSurfacesLock) {
577 final ArraySet<Surface> surfaces = mSurfaceConverted ? mEmptySurfaceSet : mSurfaceSet;
578 dest.writeParcelableArray(surfaces.toArray(new Surface[surfaces.size()]), flags);
579 if (mSurfaceConverted) {
580 dest.writeInt(mStreamIdxArray.length);
581 for (int i = 0; i < mStreamIdxArray.length; i++) {
582 dest.writeInt(mStreamIdxArray[i]);
583 dest.writeInt(mSurfaceIdxArray[i]);
584 }
585 } else {
586 dest.writeInt(0);
587 }
588 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700589 }
590
591 /**
Ruben Brunkfeb50af2014-05-09 19:58:49 -0700592 * @hide
593 */
594 public boolean containsTarget(Surface surface) {
595 return mSurfaceSet.contains(surface);
596 }
597
598 /**
599 * @hide
600 */
601 public Collection<Surface> getTargets() {
602 return Collections.unmodifiableCollection(mSurfaceSet);
603 }
604
605 /**
Emilian Peev2100ae72018-01-12 16:56:25 +0000606 * Retrieves the logical camera id.
607 * @hide
608 */
609 public String getLogicalCameraId() {
610 return mLogicalCameraId;
611 }
612
613 /**
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800614 * @hide
615 */
616 public void convertSurfaceToStreamId(
617 final SparseArray<OutputConfiguration> configuredOutputs) {
618 synchronized (mSurfacesLock) {
619 if (mSurfaceConverted) {
620 Log.v(TAG, "Cannot convert already converted surfaces!");
621 return;
622 }
623
624 mStreamIdxArray = new int[mSurfaceSet.size()];
625 mSurfaceIdxArray = new int[mSurfaceSet.size()];
626 int i = 0;
627 for (Surface s : mSurfaceSet) {
628 boolean streamFound = false;
629 for (int j = 0; j < configuredOutputs.size(); ++j) {
630 int streamId = configuredOutputs.keyAt(j);
631 OutputConfiguration outConfig = configuredOutputs.valueAt(j);
632 int surfaceId = 0;
633 for (Surface outSurface : outConfig.getSurfaces()) {
634 if (s == outSurface) {
635 streamFound = true;
636 mStreamIdxArray[i] = streamId;
637 mSurfaceIdxArray[i] = surfaceId;
638 i++;
639 break;
640 }
641 surfaceId++;
642 }
643 if (streamFound) {
644 break;
645 }
646 }
Yin-Chia Yeh4f151472018-02-21 12:38:19 -0800647
648 if (!streamFound) {
649 // Check if we can match s by native object ID
650 long reqSurfaceId = SurfaceUtils.getSurfaceId(s);
651 for (int j = 0; j < configuredOutputs.size(); ++j) {
652 int streamId = configuredOutputs.keyAt(j);
653 OutputConfiguration outConfig = configuredOutputs.valueAt(j);
654 int surfaceId = 0;
655 for (Surface outSurface : outConfig.getSurfaces()) {
656 if (reqSurfaceId == SurfaceUtils.getSurfaceId(outSurface)) {
657 streamFound = true;
658 mStreamIdxArray[i] = streamId;
659 mSurfaceIdxArray[i] = surfaceId;
660 i++;
661 break;
662 }
663 surfaceId++;
664 }
665 if (streamFound) {
666 break;
667 }
668 }
669 }
670
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800671 if (!streamFound) {
672 mStreamIdxArray = null;
673 mSurfaceIdxArray = null;
674 throw new IllegalArgumentException(
675 "CaptureRequest contains unconfigured Input/Output Surface!");
676 }
677 }
678 mSurfaceConverted = true;
679 }
680 }
681
682 /**
683 * @hide
684 */
685 public void recoverStreamIdToSurface() {
686 synchronized (mSurfacesLock) {
687 if (!mSurfaceConverted) {
688 Log.v(TAG, "Cannot convert already converted surfaces!");
689 return;
690 }
691
692 mStreamIdxArray = null;
693 mSurfaceIdxArray = null;
694 mSurfaceConverted = false;
695 }
696 }
697
698 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700699 * A builder for capture requests.
700 *
701 * <p>To obtain a builder instance, use the
702 * {@link CameraDevice#createCaptureRequest} method, which initializes the
703 * request fields to one of the templates defined in {@link CameraDevice}.
704 *
705 * @see CameraDevice#createCaptureRequest
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700706 * @see CameraDevice#TEMPLATE_PREVIEW
707 * @see CameraDevice#TEMPLATE_RECORD
708 * @see CameraDevice#TEMPLATE_STILL_CAPTURE
709 * @see CameraDevice#TEMPLATE_VIDEO_SNAPSHOT
710 * @see CameraDevice#TEMPLATE_MANUAL
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700711 */
712 public final static class Builder {
713
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700714 private final CaptureRequest mRequest;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700715
716 /**
717 * Initialize the builder using the template; the request takes
718 * ownership of the template.
719 *
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700720 * @param template Template settings for this capture request.
721 * @param reprocess Indicates whether to create a reprocess capture request. {@code true}
722 * to create a reprocess capture request. {@code false} to create a regular
723 * capture request.
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700724 * @param reprocessableSessionId The ID of the camera capture session this capture is
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700725 * created for. This is used to validate if the application
726 * submits a reprocess capture request to the same session
727 * where the {@link TotalCaptureResult}, used to create the
728 * reprocess capture, came from.
Emilian Peev2100ae72018-01-12 16:56:25 +0000729 * @param logicalCameraId Camera Id of the actively open camera that instantiates the
730 * Builder.
731 * @param physicalCameraIdSet A set of physical camera ids that can be used to customize
732 * the request for a specific physical camera.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700733 *
734 * @throws IllegalArgumentException If creating a reprocess capture request with an invalid
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700735 * reprocessableSessionId.
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700736 * @hide
737 */
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700738 public Builder(CameraMetadataNative template, boolean reprocess,
Emilian Peev2100ae72018-01-12 16:56:25 +0000739 int reprocessableSessionId, String logicalCameraId,
740 Set<String> physicalCameraIdSet) {
741 mRequest = new CaptureRequest(template, reprocess, reprocessableSessionId,
742 logicalCameraId, physicalCameraIdSet);
Igor Murashkin70725502013-06-25 20:27:06 +0000743 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700744
745 /**
746 * <p>Add a surface to the list of targets for this request</p>
747 *
748 * <p>The Surface added must be one of the surfaces included in the most
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700749 * recent call to {@link CameraDevice#createCaptureSession}, when the
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700750 * request is given to the camera device.</p>
751 *
752 * <p>Adding a target more than once has no effect.</p>
753 *
754 * @param outputTarget Surface to use as an output target for this request
755 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700756 public void addTarget(@NonNull Surface outputTarget) {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700757 mRequest.mSurfaceSet.add(outputTarget);
758 }
759
760 /**
761 * <p>Remove a surface from the list of targets for this request.</p>
762 *
763 * <p>Removing a target that is not currently added has no effect.</p>
764 *
765 * @param outputTarget Surface to use as an output target for this request
766 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700767 public void removeTarget(@NonNull Surface outputTarget) {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700768 mRequest.mSurfaceSet.remove(outputTarget);
769 }
770
771 /**
772 * Set a capture request field to a value. The field definitions can be
773 * found in {@link CaptureRequest}.
774 *
Eino-Ville Talvalad8407272015-11-08 18:27:20 -0800775 * <p>Setting a field to {@code null} will remove that field from the capture request.
776 * Unless the field is optional, removing it will likely produce an error from the camera
777 * device when the request is submitted.</p>
778 *
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700779 * @param key The metadata field to write.
780 * @param value The value to set the field to, which must be of a matching
781 * type to the key.
782 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700783 public <T> void set(@NonNull Key<T> key, T value) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000784 mRequest.mLogicalCameraSettings.set(key, value);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700785 }
786
787 /**
788 * Get a capture request field value. The field definitions can be
789 * found in {@link CaptureRequest}.
790 *
791 * @throws IllegalArgumentException if the key was not valid
792 *
793 * @param key The metadata field to read.
794 * @return The value of that key, or {@code null} if the field is not set.
795 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700796 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700797 public <T> T get(Key<T> key) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000798 return mRequest.mLogicalCameraSettings.get(key);
799 }
800
801 /**
802 * Set a capture request field to a value. The field definitions can be
803 * found in {@link CaptureRequest}.
804 *
805 * <p>Setting a field to {@code null} will remove that field from the capture request.
806 * Unless the field is optional, removing it will likely produce an error from the camera
807 * device when the request is submitted.</p>
808 *
809 *<p>This method can be called for logical camera devices, which are devices that have
810 * REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA capability and calls to
Shuzhen Wangbde13972018-03-19 10:30:45 -0700811 * {@link CameraCharacteristics#getPhysicalCameraIds} return a non-empty set of
Emilian Peev2100ae72018-01-12 16:56:25 +0000812 * physical devices that are backing the logical camera. The camera Id included in the
813 * 'physicalCameraId' argument selects an individual physical device that will receive
814 * the customized capture request field.</p>
815 *
816 * @throws IllegalArgumentException if the physical camera id is not valid
817 *
818 * @param key The metadata field to write.
819 * @param value The value to set the field to, which must be of a matching
820 * @param physicalCameraId A valid physical camera Id. The valid camera Ids can be obtained
821 * via calls to {@link CameraCharacteristics#getPhysicalCameraIds}.
822 * @return The builder object.
823 * type to the key.
824 */
825 public <T> Builder setPhysicalCameraKey(@NonNull Key<T> key, T value,
826 @NonNull String physicalCameraId) {
827 if (!mRequest.mPhysicalCameraSettings.containsKey(physicalCameraId)) {
828 throw new IllegalArgumentException("Physical camera id: " + physicalCameraId +
829 " is not valid!");
830 }
831
832 mRequest.mPhysicalCameraSettings.get(physicalCameraId).set(key, value);
833
834 return this;
835 }
836
837 /**
838 * Get a capture request field value for a specific physical camera Id. The field
839 * definitions can be found in {@link CaptureRequest}.
840 *
841 *<p>This method can be called for logical camera devices, which are devices that have
842 * REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA capability and calls to
843 * {@link CameraCharacteristics#getPhysicalCameraIds} return a non-empty list of
844 * physical devices that are backing the logical camera. The camera Id included in the
845 * 'physicalCameraId' argument selects an individual physical device and returns
846 * its specific capture request field.</p>
847 *
848 * @throws IllegalArgumentException if the key or physical camera id were not valid
849 *
850 * @param key The metadata field to read.
851 * @param physicalCameraId A valid physical camera Id. The valid camera Ids can be obtained
852 * via calls to {@link CameraCharacteristics#getPhysicalCameraIds}.
853 * @return The value of that key, or {@code null} if the field is not set.
854 */
855 @Nullable
856 public <T> T getPhysicalCameraKey(Key<T> key,@NonNull String physicalCameraId) {
857 if (!mRequest.mPhysicalCameraSettings.containsKey(physicalCameraId)) {
858 throw new IllegalArgumentException("Physical camera id: " + physicalCameraId +
859 " is not valid!");
860 }
861
862 return mRequest.mPhysicalCameraSettings.get(physicalCameraId).get(key);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700863 }
864
865 /**
866 * Set a tag for this request.
867 *
868 * <p>This tag is not used for anything by the camera device, but can be
869 * used by an application to easily identify a CaptureRequest when it is
870 * returned by
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700871 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700872 *
873 * @param tag an arbitrary Object to store with this request
874 * @see CaptureRequest#getTag
875 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700876 public void setTag(@Nullable Object tag) {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700877 mRequest.mUserTag = tag;
878 }
879
880 /**
Zhijun Hea7677722015-06-01 16:36:06 -0700881 * <p>Mark this request as part of a constrained high speed request list created by
Eino-Ville Talvala639fffe2015-06-30 10:34:48 -0700882 * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}.
883 * A constrained high speed request list contains some constrained high speed capture
884 * requests with certain interleaved pattern that is suitable for high speed preview/video
885 * streaming.</p>
Zhijun Hea7677722015-06-01 16:36:06 -0700886 *
887 * @hide
888 */
889 public void setPartOfCHSRequestList(boolean partOfCHSList) {
890 mRequest.mIsPartOfCHSRequestList = partOfCHSList;
891 }
892
893 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700894 * Build a request using the current target Surfaces and settings.
Sol Boucheredeab402014-07-09 18:36:28 -0700895 * <p>Note that, although it is possible to create a {@code CaptureRequest} with no target
896 * {@link Surface}s, passing such a request into {@link CameraCaptureSession#capture},
897 * {@link CameraCaptureSession#captureBurst},
898 * {@link CameraCaptureSession#setRepeatingBurst}, or
899 * {@link CameraCaptureSession#setRepeatingRequest} will cause that method to throw an
900 * {@link IllegalArgumentException}.</p>
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700901 *
902 * @return A new capture request instance, ready for submission to the
903 * camera device.
904 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700905 @NonNull
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700906 public CaptureRequest build() {
907 return new CaptureRequest(mRequest);
908 }
909
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700910 /**
911 * @hide
912 */
913 public boolean isEmpty() {
Emilian Peev2100ae72018-01-12 16:56:25 +0000914 return mRequest.mLogicalCameraSettings.isEmpty();
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700915 }
916
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800917 }
918
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700919 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
920 * The key entries below this point are generated from metadata
921 * definitions in /system/media/camera/docs. Do not modify by hand or
922 * modify the comment blocks at the start or end.
923 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
924
925 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800926 * <p>The mode control selects how the image data is converted from the
927 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700928 * <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 -0800929 * control is overridden by the AWB routine. When AWB is disabled, the
930 * application controls how the color mapping is performed.</p>
931 * <p>We define the expected processing pipeline below. For consistency
932 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
933 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
934 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
935 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
936 * camera device (in the results) and be roughly correct.</p>
937 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
938 * FAST or HIGH_QUALITY will yield a picture with the same white point
939 * as what was produced by the camera device in the earlier frame.</p>
940 * <p>The expected processing pipeline is as follows:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -0800941 * <p><img alt="White balance processing pipeline" src="/reference/images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800942 * <p>The white balance is encoded by two values, a 4-channel white-balance
943 * gain vector (applied in the Bayer domain), and a 3x3 color transform
944 * matrix (applied after demosaic).</p>
945 * <p>The 4-channel white-balance gains are defined as:</p>
946 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
947 * </code></pre>
948 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
949 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
950 * These may be identical for a given camera device implementation; if
951 * the camera device does not support a separate gain for even/odd green
952 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
953 * <code>G_even</code> in the output result metadata.</p>
954 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
955 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
956 * </code></pre>
957 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
958 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
959 * <p>with colors as follows:</p>
960 * <pre><code>r' = I0r + I1g + I2b
961 * g' = I3r + I4g + I5b
962 * b' = I6r + I7g + I8b
963 * </code></pre>
964 * <p>Both the input and output value ranges must match. Overflow/underflow
965 * values are clipped to fit within the range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700966 * <p><b>Possible values:</b>
967 * <ul>
968 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
969 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
970 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
971 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700972 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
973 * <p><b>Full capability</b> -
974 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
975 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800976 *
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800977 * @see CaptureRequest#COLOR_CORRECTION_GAINS
978 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800979 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700980 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700981 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
982 * @see #COLOR_CORRECTION_MODE_FAST
983 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
984 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700985 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700986 public static final Key<Integer> COLOR_CORRECTION_MODE =
987 new Key<Integer>("android.colorCorrection.mode", int.class);
988
989 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800990 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700991 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800992 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800993 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700994 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800995 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800996 * <p>In the latter case, the camera device may round the matrix to account
997 * for precision issues; the final rounded matrix should be reported back
998 * in this matrix result metadata. The transform should keep the magnitude
999 * of the output color values within <code>[0, 1.0]</code> (assuming input color
1000 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001001 * <p>The valid range of each matrix element varies on different devices, but
1002 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001003 * <p><b>Units</b>: Unitless scale factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001004 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1005 * <p><b>Full capability</b> -
1006 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1007 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001008 *
1009 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001010 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001011 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001012 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001013 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
1014 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001015
1016 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -08001017 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -08001018 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001019 * <p>These per-channel gains are either set by the camera device
1020 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
1021 * TRANSFORM_MATRIX, or directly by the application in the
1022 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
1023 * TRANSFORM_MATRIX.</p>
1024 * <p>The gains in the result metadata are the gains actually
1025 * applied by the camera device to the current frame.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001026 * <p>The valid range of gains varies on different devices, but gains
1027 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
1028 * device allows gains below 1.0, this is usually not recommended because
1029 * this can create color artifacts.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001030 * <p><b>Units</b>: Unitless gain factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001031 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1032 * <p><b>Full capability</b> -
1033 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1034 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001035 *
1036 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001037 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001038 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001039 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001040 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
1041 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001042
1043 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -07001044 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -07001045 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
1046 * can not focus on the same point after exiting from the lens. This metadata defines
1047 * the high level control of chromatic aberration correction algorithm, which aims to
1048 * minimize the chromatic artifacts that may occur along the object boundaries in an
1049 * image.</p>
1050 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
1051 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
1052 * use the highest-quality aberration correction algorithms, even if it slows down
1053 * capture rate. FAST means the camera device will not slow down capture rate when
1054 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001055 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001056 * <p><b>Possible values:</b>
1057 * <ul>
1058 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
1059 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
1060 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
1061 * </ul></p>
1062 * <p><b>Available values for this device:</b><br>
1063 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001064 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -07001065 *
Zhijun He9e4e4392014-08-18 11:12:32 -07001066 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
1067 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
1068 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
1069 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -07001070 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001071 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -07001072 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
1073 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -07001074
1075 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001076 * <p>The desired setting for the camera device's auto-exposure
1077 * algorithm's antibanding compensation.</p>
1078 * <p>Some kinds of lighting fixtures, such as some fluorescent
1079 * lights, flicker at the rate of the power supply frequency
1080 * (60Hz or 50Hz, depending on country). While this is
1081 * typically not noticeable to a person, it can be visible to
1082 * a camera device. If a camera sets its exposure time to the
1083 * wrong value, the flicker may become visible in the
1084 * viewfinder as flicker or in a final captured image, as a
1085 * set of variable-brightness bands across the image.</p>
1086 * <p>Therefore, the auto-exposure routines of camera devices
1087 * include antibanding routines that ensure that the chosen
1088 * exposure value will not cause such banding. The choice of
1089 * exposure time depends on the rate of flicker, which the
1090 * camera device can detect automatically, or the expected
1091 * rate can be selected by the application using this
1092 * control.</p>
1093 * <p>A given camera device may not support all of the possible
1094 * options for the antibanding mode. The
1095 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
1096 * the available modes for a given camera device.</p>
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -08001097 * <p>AUTO mode is the default if it is available on given
1098 * camera device. When AUTO mode is not available, the
1099 * default will be either 50HZ or 60HZ, and both 50HZ
1100 * and 60HZ will be available.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001101 * <p>If manual exposure control is enabled (by setting
1102 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
1103 * then this setting has no effect, and the application must
1104 * ensure it selects exposure times that do not cause banding
1105 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
1106 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001107 * <p><b>Possible values:</b>
1108 * <ul>
1109 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
1110 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
1111 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
1112 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
1113 * </ul></p>
1114 * <p><b>Available values for this device:</b><br></p>
1115 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001116 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001117 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08001118 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
Zhijun He399f05d2014-01-15 11:31:30 -08001119 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001120 * @see CaptureRequest#CONTROL_MODE
1121 * @see CaptureResult#STATISTICS_SCENE_FLICKER
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001122 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
1123 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
1124 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
1125 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
1126 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001127 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001128 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
1129 new Key<Integer>("android.control.aeAntibandingMode", int.class);
1130
1131 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001132 * <p>Adjustment to auto-exposure (AE) target image
1133 * brightness.</p>
1134 * <p>The adjustment is measured as a count of steps, with the
1135 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
1136 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
1137 * <p>For example, if the exposure value (EV) step is 0.333, '6'
1138 * will mean an exposure compensation of +2 EV; -3 will mean an
1139 * exposure compensation of -1 EV. One EV represents a doubling
1140 * of image brightness. Note that this control will only be
1141 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
1142 * 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 -07001143 * <p>In the event of exposure compensation value being changed, camera device
1144 * may take several frames to reach the newly requested exposure target.
1145 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
1146 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
1147 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
1148 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001149 * <p><b>Units</b>: Compensation steps</p>
1150 * <p><b>Range of valid values:</b><br>
1151 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001152 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -07001153 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001154 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
1155 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -07001156 * @see CaptureRequest#CONTROL_AE_LOCK
1157 * @see CaptureRequest#CONTROL_AE_MODE
1158 * @see CaptureResult#CONTROL_AE_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001159 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001160 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001161 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
1162 new Key<Integer>("android.control.aeExposureCompensation", int.class);
1163
1164 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001165 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He49a3ca92014-02-05 13:48:09 -08001166 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001167 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
1168 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
1169 * <p>Note that even when AE is locked, the flash may be fired if
1170 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
1171 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -07001172 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
1173 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -08001174 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
1175 * when AE is already locked, the camera device will not change the exposure time
1176 * ({@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 -08001177 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
Zhijun He49a3ca92014-02-05 13:48:09 -08001178 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
Zhijun Hefa95b042015-02-09 10:40:49 -08001179 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
1180 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
1181 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
1182 * the AE if AE is locked by the camera device internally during precapture metering
1183 * sequence In other words, submitting requests with AE unlock has no effect for an
1184 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
1185 * will never succeed in a sequence of preview requests where AE lock is always set
1186 * to <code>false</code>.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001187 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1188 * get locked do not necessarily correspond to the settings that were present in the
1189 * latest capture result received from the camera device, since additional captures
1190 * and AE updates may have occurred even before the result was sent out. If an
1191 * application is switching between automatic and manual control and wishes to eliminate
1192 * any flicker during the switch, the following procedure is recommended:</p>
1193 * <ol>
1194 * <li>Starting in auto-AE mode:</li>
1195 * <li>Lock AE</li>
1196 * <li>Wait for the first result to be output that has the AE locked</li>
1197 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
1198 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
1199 * </ol>
Zhijun He49a3ca92014-02-05 13:48:09 -08001200 * <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 -07001201 * <p>This key is available on all devices.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -08001202 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -07001203 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He49a3ca92014-02-05 13:48:09 -08001204 * @see CaptureRequest#CONTROL_AE_MODE
1205 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1206 * @see CaptureResult#CONTROL_AE_STATE
1207 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
1208 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001209 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001210 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001211 public static final Key<Boolean> CONTROL_AE_LOCK =
1212 new Key<Boolean>("android.control.aeLock", boolean.class);
1213
1214 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001215 * <p>The desired mode for the camera device's
1216 * auto-exposure routine.</p>
1217 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
1218 * AUTO.</p>
1219 * <p>When set to any of the ON modes, the camera device's
1220 * auto-exposure routine is enabled, overriding the
1221 * application's selected exposure time, sensor sensitivity,
1222 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
1223 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
1224 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
1225 * is selected, the camera device's flash unit controls are
1226 * also overridden.</p>
1227 * <p>The FLASH modes are only available if the camera device
1228 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
1229 * <p>If flash TORCH mode is desired, this field must be set to
1230 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
1231 * <p>When set to any of the ON modes, the values chosen by the
1232 * camera device auto-exposure routine for the overridden
1233 * fields for a given capture will be available in its
1234 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001235 * <p><b>Possible values:</b>
1236 * <ul>
1237 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
1238 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
1239 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
1240 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
1241 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001242 * <li>{@link #CONTROL_AE_MODE_ON_EXTERNAL_FLASH ON_EXTERNAL_FLASH}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001243 * </ul></p>
1244 * <p><b>Available values for this device:</b><br>
1245 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001246 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001247 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001248 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -08001249 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001250 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
1251 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08001252 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
1253 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -08001254 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001255 * @see #CONTROL_AE_MODE_OFF
1256 * @see #CONTROL_AE_MODE_ON
1257 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
1258 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
1259 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001260 * @see #CONTROL_AE_MODE_ON_EXTERNAL_FLASH
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001261 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001262 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001263 public static final Key<Integer> CONTROL_AE_MODE =
1264 new Key<Integer>("android.control.aeMode", int.class);
1265
1266 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001267 * <p>List of metering areas to use for auto-exposure adjustment.</p>
1268 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001269 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001270 * <p>The maximum number of regions supported by the device is determined by the value
1271 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001272 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001273 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001274 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1275 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001276 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001277 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001278 * for every pixel in the area. This means that a large metering area
1279 * with the same weight as a smaller area will have more effect in
1280 * the metering result. Metering areas can partially overlap and the
1281 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001282 * <p>The weights are relative to weights of other exposure metering regions, so if only one
1283 * region is used, all non-zero weights will have the same effect. A region with 0
1284 * weight is ignored.</p>
1285 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1286 * camera device.</p>
1287 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1288 * capture result metadata, the camera device will ignore the sections outside the crop
1289 * region and output only the intersection rectangle as the metering region in the result
1290 * metadata. If the region is entirely outside the crop region, it will be ignored and
1291 * not reported in the result metadata.</p>
1292 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1293 * <p><b>Range of valid values:</b><br>
1294 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1295 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001296 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001297 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001298 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001299 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001300 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001301 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001302 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001303 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
1304 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001305
1306 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001307 * <p>Range over which the auto-exposure routine can
1308 * adjust the capture frame rate to maintain good
1309 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001310 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001311 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
1312 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
1313 * <p><b>Units</b>: Frames per second (FPS)</p>
1314 * <p><b>Range of valid values:</b><br>
1315 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
1316 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001317 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001318 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001319 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001320 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001321 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001322 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001323 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
1324 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001325
1326 /**
Zhijun He228f4f92014-01-16 17:22:05 -08001327 * <p>Whether the camera device will trigger a precapture
1328 * metering sequence when it processes this request.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001329 * <p>This entry is normally set to IDLE, or is not
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001330 * included at all in the request settings. When included and
Zhijun Hedd72be52015-02-06 13:49:51 -08001331 * set to START, the camera device will trigger the auto-exposure (AE)
Igor Murashkinace5bf02013-12-10 17:36:40 -08001332 * precapture metering sequence.</p>
Zhijun Hefa95b042015-02-09 10:40:49 -08001333 * <p>When set to CANCEL, the camera device will cancel any active
1334 * precapture metering trigger, and return to its initial AE state.
1335 * If a precapture metering sequence is already completed, and the camera
1336 * device has implicitly locked the AE for subsequent still capture, the
1337 * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -08001338 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001339 * high-quality still capture for final metering decisions to
1340 * be made, and for firing pre-capture flash pulses to estimate
1341 * scene brightness and required final capture flash power, when
1342 * the flash is enabled.</p>
1343 * <p>Normally, this entry should be set to START for only a
1344 * single request, and the application should wait until the
1345 * sequence completes before starting a new one.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -08001346 * <p>When a precapture metering sequence is finished, the camera device
1347 * may lock the auto-exposure routine internally to be able to accurately expose the
1348 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
1349 * For this case, the AE may not resume normal scan if no subsequent still capture is
1350 * submitted. To ensure that the AE routine restarts normal scan, the application should
1351 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
1352 * 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 -08001353 * still capture request after the precapture sequence completes. Alternatively, for
1354 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
1355 * internally locked AE if the application doesn't submit a still capture request after
1356 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
1357 * be used in devices that have earlier API levels.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001358 * <p>The exact effect of auto-exposure (AE) precapture trigger
1359 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001360 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
1361 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001362 * <p>On LEGACY-level devices, the precapture trigger is not supported;
1363 * capturing a high-resolution JPEG image will automatically trigger a
1364 * precapture sequence before the high-resolution capture, including
1365 * potentially firing a pre-capture flash.</p>
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001366 * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}
1367 * simultaneously is allowed. However, since these triggers often require cooperation between
1368 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1369 * focus sweep), the camera device may delay acting on a later trigger until the previous
1370 * trigger has been fully handled. This may lead to longer intervals between the trigger and
1371 * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for
1372 * example.</p>
1373 * <p>If both the precapture and the auto-focus trigger are activated on the same request, then
1374 * the camera device will complete them in the optimal order for that device.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001375 * <p><b>Possible values:</b>
1376 * <ul>
1377 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
1378 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
Zhijun Hefa95b042015-02-09 10:40:49 -08001379 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001380 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001381 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1382 * <p><b>Limited capability</b> -
1383 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1384 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001385 *
Zhijun Hedd72be52015-02-06 13:49:51 -08001386 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He228f4f92014-01-16 17:22:05 -08001387 * @see CaptureResult#CONTROL_AE_STATE
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001388 * @see CaptureRequest#CONTROL_AF_TRIGGER
Zhijun Hedd72be52015-02-06 13:49:51 -08001389 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001390 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001391 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
1392 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
Zhijun Hefa95b042015-02-09 10:40:49 -08001393 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001394 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001395 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001396 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
1397 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
1398
1399 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001400 * <p>Whether auto-focus (AF) is currently enabled, and what
1401 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001402 * <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 -08001403 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1404 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1405 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1406 * 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 -08001407 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001408 * 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 -07001409 * in result metadata.</p>
1410 * <p><b>Possible values:</b>
1411 * <ul>
1412 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1413 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1414 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1415 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1416 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1417 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1418 * </ul></p>
1419 * <p><b>Available values for this device:</b><br>
1420 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1421 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001422 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001423 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001424 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001425 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001426 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001427 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001428 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001429 * @see #CONTROL_AF_MODE_OFF
1430 * @see #CONTROL_AF_MODE_AUTO
1431 * @see #CONTROL_AF_MODE_MACRO
1432 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1433 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1434 * @see #CONTROL_AF_MODE_EDOF
1435 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001436 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001437 public static final Key<Integer> CONTROL_AF_MODE =
1438 new Key<Integer>("android.control.afMode", int.class);
1439
1440 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001441 * <p>List of metering areas to use for auto-focus.</p>
1442 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001443 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001444 * <p>The maximum number of focus areas supported by the device is determined by the value
1445 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001446 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001447 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001448 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1449 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001450 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001451 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001452 * for every pixel in the area. This means that a large metering area
1453 * with the same weight as a smaller area will have more effect in
1454 * the metering result. Metering areas can partially overlap and the
1455 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001456 * <p>The weights are relative to weights of other metering regions, so if only one region
1457 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1458 * ignored.</p>
1459 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
Shuzhen Wanga31d58f2018-02-08 12:44:47 -08001460 * camera device. The capture result will either be a zero weight region as well, or
1461 * the region selected by the camera device as the focus area of interest.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001462 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1463 * capture result metadata, the camera device will ignore the sections outside the crop
1464 * region and output only the intersection rectangle as the metering region in the result
1465 * metadata. If the region is entirely outside the crop region, it will be ignored and
1466 * not reported in the result metadata.</p>
1467 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1468 * <p><b>Range of valid values:</b><br>
1469 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1470 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001471 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001472 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001473 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001474 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001475 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001476 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001477 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001478 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1479 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001480
1481 /**
Zhijun He228f4f92014-01-16 17:22:05 -08001482 * <p>Whether the camera device will trigger autofocus for this request.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001483 * <p>This entry is normally set to IDLE, or is not
1484 * included at all in the request settings.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001485 * <p>When included and set to START, the camera device will trigger the
1486 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1487 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1488 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001489 * <p>Generally, applications should set this entry to START or CANCEL for only a
1490 * single capture, and then return it to IDLE (or not set at all). Specifying
1491 * START for multiple captures in a row means restarting the AF operation over
1492 * and over again.</p>
1493 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001494 * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}
1495 * simultaneously is allowed. However, since these triggers often require cooperation between
1496 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1497 * focus sweep), the camera device may delay acting on a later trigger until the previous
1498 * trigger has been fully handled. This may lead to longer intervals between the trigger and
1499 * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001500 * <p><b>Possible values:</b>
1501 * <ul>
1502 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1503 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1504 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1505 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001506 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001507 *
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001508 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Zhijun He228f4f92014-01-16 17:22:05 -08001509 * @see CaptureResult#CONTROL_AF_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001510 * @see #CONTROL_AF_TRIGGER_IDLE
1511 * @see #CONTROL_AF_TRIGGER_START
1512 * @see #CONTROL_AF_TRIGGER_CANCEL
1513 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001514 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001515 public static final Key<Integer> CONTROL_AF_TRIGGER =
1516 new Key<Integer>("android.control.afTrigger", int.class);
1517
1518 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001519 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He2d5e8972014-02-07 16:13:46 -08001520 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001521 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1522 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1523 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1524 * get locked do not necessarily correspond to the settings that were present in the
1525 * latest capture result received from the camera device, since additional captures
1526 * and AWB updates may have occurred even before the result was sent out. If an
1527 * application is switching between automatic and manual control and wishes to eliminate
1528 * any flicker during the switch, the following procedure is recommended:</p>
1529 * <ol>
1530 * <li>Starting in auto-AWB mode:</li>
1531 * <li>Lock AWB</li>
1532 * <li>Wait for the first result to be output that has the AWB locked</li>
1533 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1534 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1535 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001536 * <p>Note that AWB lock is only meaningful when
1537 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1538 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001539 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1540 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001541 *
1542 * @see CaptureRequest#CONTROL_AWB_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001543 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001544 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001545 public static final Key<Boolean> CONTROL_AWB_LOCK =
1546 new Key<Boolean>("android.control.awbLock", boolean.class);
1547
1548 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001549 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001550 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001551 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001552 * <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 -07001553 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001554 * routine is enabled, overriding the application's selected
1555 * {@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 -08001556 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1557 * is OFF, the behavior of AWB is device dependent. It is recommened to
1558 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1559 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001560 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001561 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001562 * 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 -08001563 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001564 * <p>When set to any other modes, the camera device's auto-white
1565 * balance routine is disabled. The camera device uses each
1566 * particular illumination target for white balance
1567 * adjustment. The application's values for
1568 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1569 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1570 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001571 * <p><b>Possible values:</b>
1572 * <ul>
1573 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1574 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1575 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1576 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1577 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1578 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1579 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1580 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1581 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1582 * </ul></p>
1583 * <p><b>Available values for this device:</b><br>
1584 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001585 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001586 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001587 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001588 * @see CaptureRequest#COLOR_CORRECTION_MODE
1589 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001590 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001591 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001592 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001593 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001594 * @see #CONTROL_AWB_MODE_OFF
1595 * @see #CONTROL_AWB_MODE_AUTO
1596 * @see #CONTROL_AWB_MODE_INCANDESCENT
1597 * @see #CONTROL_AWB_MODE_FLUORESCENT
1598 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1599 * @see #CONTROL_AWB_MODE_DAYLIGHT
1600 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1601 * @see #CONTROL_AWB_MODE_TWILIGHT
1602 * @see #CONTROL_AWB_MODE_SHADE
1603 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001604 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001605 public static final Key<Integer> CONTROL_AWB_MODE =
1606 new Key<Integer>("android.control.awbMode", int.class);
1607
1608 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001609 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001610 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001611 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001612 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001613 * <p>The maximum number of regions supported by the device is determined by the value
1614 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001615 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001616 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001617 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1618 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001619 * bottom-right pixel in the active pixel array.</p>
1620 * <p>The weight must range from 0 to 1000, and represents a weight
1621 * for every pixel in the area. This means that a large metering area
1622 * with the same weight as a smaller area will have more effect in
1623 * the metering result. Metering areas can partially overlap and the
1624 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001625 * <p>The weights are relative to weights of other white balance metering regions, so if
1626 * only one region is used, all non-zero weights will have the same effect. A region with
1627 * 0 weight is ignored.</p>
1628 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1629 * camera device.</p>
1630 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1631 * capture result metadata, the camera device will ignore the sections outside the crop
1632 * region and output only the intersection rectangle as the metering region in the result
1633 * metadata. If the region is entirely outside the crop region, it will be ignored and
1634 * not reported in the result metadata.</p>
1635 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1636 * <p><b>Range of valid values:</b><br>
1637 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1638 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001639 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001640 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001641 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001642 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001643 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001644 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001645 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001646 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1647 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001648
1649 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001650 * <p>Information to the camera device 3A (auto-exposure,
1651 * auto-focus, auto-white balance) routines about the purpose
1652 * of this capture, to help the camera device to decide optimal 3A
1653 * strategy.</p>
Zhijun Hee30adb72014-04-09 19:04:31 -07001654 * <p>This control (except for MANUAL) is only effective if
1655 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001656 * <p>All intents are supported by all devices, except that:
1657 * * ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1658 * PRIVATE_REPROCESSING or YUV_REPROCESSING.
1659 * * MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1660 * MANUAL_SENSOR.
1661 * * MOTION_TRACKING will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1662 * MOTION_TRACKING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001663 * <p><b>Possible values:</b>
1664 * <ul>
1665 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1666 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1667 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1668 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1669 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1670 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1671 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001672 * <li>{@link #CONTROL_CAPTURE_INTENT_MOTION_TRACKING MOTION_TRACKING}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001673 * </ul></p>
1674 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001675 *
1676 * @see CaptureRequest#CONTROL_MODE
Zhijun Hee30adb72014-04-09 19:04:31 -07001677 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001678 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1679 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1680 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1681 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1682 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1683 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
Zhijun Hee30adb72014-04-09 19:04:31 -07001684 * @see #CONTROL_CAPTURE_INTENT_MANUAL
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001685 * @see #CONTROL_CAPTURE_INTENT_MOTION_TRACKING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001686 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001687 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001688 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1689 new Key<Integer>("android.control.captureIntent", int.class);
1690
1691 /**
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -08001692 * <p>A special color effect to apply.</p>
1693 * <p>When this mode is set, a color effect will be applied
1694 * to images produced by the camera device. The interpretation
1695 * and implementation of these color effects is left to the
1696 * implementor of the camera device, and should not be
1697 * depended on to be consistent (or present) across all
1698 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001699 * <p><b>Possible values:</b>
1700 * <ul>
1701 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1702 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1703 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1704 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1705 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1706 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1707 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1708 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1709 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1710 * </ul></p>
1711 * <p><b>Available values for this device:</b><br>
1712 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001713 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001714 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001715 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001716 * @see #CONTROL_EFFECT_MODE_OFF
1717 * @see #CONTROL_EFFECT_MODE_MONO
1718 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1719 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1720 * @see #CONTROL_EFFECT_MODE_SEPIA
1721 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1722 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1723 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1724 * @see #CONTROL_EFFECT_MODE_AQUA
1725 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001726 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001727 public static final Key<Integer> CONTROL_EFFECT_MODE =
1728 new Key<Integer>("android.control.effectMode", int.class);
1729
1730 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001731 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001732 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001733 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001734 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001735 * capture parameters itself.</p>
1736 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001737 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001738 * <p>When set to USE_SCENE_MODE, the individual controls in
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001739 * android.control.* are mostly disabled, and the camera device
1740 * implements one of the scene mode settings (such as ACTION,
1741 * SUNSET, or PARTY) as it wishes. The camera device scene mode
1742 * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001743 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1744 * is that this frame will not be used by camera device background 3A statistics
1745 * update, as if this frame is never captured. This mode can be used in the scenario
1746 * where the application doesn't want a 3A manual control capture to affect
1747 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001748 * <p><b>Possible values:</b>
1749 * <ul>
1750 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
1751 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1752 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1753 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1754 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001755 * <p><b>Available values for this device:</b><br>
1756 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001757 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001758 *
1759 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001760 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001761 * @see #CONTROL_MODE_OFF
1762 * @see #CONTROL_MODE_AUTO
1763 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001764 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001765 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001766 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001767 public static final Key<Integer> CONTROL_MODE =
1768 new Key<Integer>("android.control.mode", int.class);
1769
1770 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001771 * <p>Control for which scene mode is currently active.</p>
1772 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1773 * capture settings.</p>
Ruben Brunke6679362014-01-17 17:05:54 -08001774 * <p>This is the mode that that is active when
Zhijun Heee2ebde2015-06-16 19:58:11 -07001775 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
1776 * 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}
1777 * while in use.</p>
Ruben Brunke6679362014-01-17 17:05:54 -08001778 * <p>The interpretation and implementation of these scene modes is left
1779 * to the implementor of the camera device. Their behavior will not be
1780 * consistent across all devices, and any given device may only implement
1781 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001782 * <p><b>Possible values:</b>
1783 * <ul>
1784 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1785 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1786 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1787 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1788 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1789 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1790 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1791 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1792 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1793 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1794 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1795 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1796 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1797 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1798 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1799 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1800 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1801 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001802 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001803 * </ul></p>
1804 * <p><b>Available values for this device:</b><br>
1805 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001806 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001807 *
Ruben Brunke6679362014-01-17 17:05:54 -08001808 * @see CaptureRequest#CONTROL_AE_MODE
1809 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001810 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Ruben Brunke6679362014-01-17 17:05:54 -08001811 * @see CaptureRequest#CONTROL_AWB_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001812 * @see CaptureRequest#CONTROL_MODE
Ruben Brunke6679362014-01-17 17:05:54 -08001813 * @see #CONTROL_SCENE_MODE_DISABLED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001814 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1815 * @see #CONTROL_SCENE_MODE_ACTION
1816 * @see #CONTROL_SCENE_MODE_PORTRAIT
1817 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1818 * @see #CONTROL_SCENE_MODE_NIGHT
1819 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1820 * @see #CONTROL_SCENE_MODE_THEATRE
1821 * @see #CONTROL_SCENE_MODE_BEACH
1822 * @see #CONTROL_SCENE_MODE_SNOW
1823 * @see #CONTROL_SCENE_MODE_SUNSET
1824 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1825 * @see #CONTROL_SCENE_MODE_FIREWORKS
1826 * @see #CONTROL_SCENE_MODE_SPORTS
1827 * @see #CONTROL_SCENE_MODE_PARTY
1828 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1829 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07001830 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001831 * @see #CONTROL_SCENE_MODE_HDR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001832 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001833 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001834 public static final Key<Integer> CONTROL_SCENE_MODE =
1835 new Key<Integer>("android.control.sceneMode", int.class);
1836
1837 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001838 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001839 * active.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07001840 * <p>Video stabilization automatically warps images from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001841 * the camera in order to stabilize motion between consecutive frames.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001842 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07001843 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001844 * <p>Switching between different video stabilization modes may take several
1845 * frames to initialize, the camera device will report the current mode
1846 * in capture result metadata. For example, When "ON" mode is requested,
1847 * the video stabilization modes in the first several capture results may
1848 * still be "OFF", and it will become "ON" when the initialization is
1849 * done.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07001850 * <p>In addition, not all recording sizes or frame rates may be supported for
1851 * stabilization by a device that reports stabilization support. It is guaranteed
1852 * that an output targeting a MediaRecorder or MediaCodec will be stabilized if
1853 * the recording resolution is less than or equal to 1920 x 1080 (width less than
1854 * or equal to 1920, height less than or equal to 1080), and the recording
1855 * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult
1856 * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return
1857 * OFF if the recording output is not stabilized, or if there are no output
1858 * Surface types that can be stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001859 * <p>If a camera device supports both this mode and OIS
1860 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
1861 * produce undesirable interaction, so it is recommended not to enable
1862 * both at the same time.</p>
1863 * <p><b>Possible values:</b>
1864 * <ul>
1865 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
1866 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
1867 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001868 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001869 *
Jianing Wei2813b0f2015-09-29 14:24:36 -07001870 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Zhijun He45fa43a12014-06-13 18:29:37 -07001871 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001872 * @see CaptureRequest#SCALER_CROP_REGION
Zhijun He4793af52014-05-05 10:39:12 -07001873 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1874 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001875 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001876 @PublicKey
Zhijun He4793af52014-05-05 10:39:12 -07001877 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1878 new Key<Integer>("android.control.videoStabilizationMode", int.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001879
1880 /**
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07001881 * <p>The amount of additional sensitivity boost applied to output images
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08001882 * after RAW sensor data is captured.</p>
1883 * <p>Some camera devices support additional digital sensitivity boosting in the
1884 * camera processing pipeline after sensor RAW image is captured.
1885 * Such a boost will be applied to YUV/JPEG format output images but will not
1886 * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p>
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07001887 * <p>This key will be <code>null</code> for devices that do not support any RAW format
1888 * outputs. For devices that do support RAW format outputs, this key will always
1889 * present, and if a device does not support post RAW sensitivity boost, it will
1890 * list <code>100</code> in this key.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08001891 * <p>If the camera device cannot apply the exact boost requested, it will reduce the
1892 * boost to the nearest supported value.
1893 * The final boost value used will be available in the output capture result.</p>
1894 * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images
1895 * of such device will have the total sensitivity of
Yin-Chia Yeh67e61b62016-01-26 13:27:35 -08001896 * <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} / 100</code>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08001897 * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p>
1898 * <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
1899 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
1900 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
1901 * <p><b>Range of valid values:</b><br>
1902 * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p>
1903 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1904 *
1905 * @see CaptureRequest#CONTROL_AE_MODE
1906 * @see CaptureRequest#CONTROL_MODE
1907 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
1908 * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE
1909 * @see CaptureRequest#SENSOR_SENSITIVITY
1910 */
1911 @PublicKey
1912 public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST =
1913 new Key<Integer>("android.control.postRawSensitivityBoost", int.class);
1914
1915 /**
Chien-Yu Chene4491712017-01-11 11:14:06 -08001916 * <p>Allow camera device to enable zero-shutter-lag mode for requests with
1917 * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p>
1918 * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with
1919 * STILL_CAPTURE capture intent. The camera device may use images captured in the past to
1920 * produce output images for a zero-shutter-lag request. The result metadata including the
1921 * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images.
1922 * Therefore, the contents of the output images and the result metadata may be out of order
1923 * compared to previous regular requests. enableZsl does not affect requests with other
1924 * capture intents.</p>
1925 * <p>For example, when requests are submitted in the following order:
1926 * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW
1927 * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p>
1928 * <p>The output images for request B may have contents captured before the output images for
1929 * request A, and the result metadata for request B may be older than the result metadata for
1930 * request A.</p>
Chien-Yu Chen1d72ee32017-04-18 15:23:06 -07001931 * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in
1932 * the past for requests with STILL_CAPTURE capture intent.</p>
1933 * <p>For applications targeting SDK versions O and newer, the value of enableZsl in
1934 * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always
1935 * <code>false</code> if present.</p>
1936 * <p>For applications targeting SDK versions older than O, the value of enableZsl in all
1937 * capture templates is always <code>false</code> if present.</p>
Chien-Yu Chen81026382017-05-03 12:30:58 -07001938 * <p>For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p>
Chien-Yu Chene4491712017-01-11 11:14:06 -08001939 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1940 *
1941 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
1942 * @see CaptureResult#SENSOR_TIMESTAMP
1943 */
1944 @PublicKey
1945 public static final Key<Boolean> CONTROL_ENABLE_ZSL =
1946 new Key<Boolean>("android.control.enableZsl", boolean.class);
1947
1948 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001949 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001950 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001951 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
1952 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001953 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001954 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001955 * camera device will use the highest-quality enhancement algorithms,
1956 * even if it slows down capture rate. FAST means the camera device will
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07001957 * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if
1958 * edge enhancement will slow down capture rate. Every output stream will have a similar
1959 * amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07001960 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
1961 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
1962 * into a final capture when triggered by the user. In this mode, the camera device applies
1963 * edge enhancement to low-resolution streams (below maximum recording resolution) to
1964 * maximize preview quality, but does not apply edge enhancement to high-resolution streams,
1965 * since those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08001966 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
1967 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07001968 * The camera device may adjust its internal edge enhancement parameters for best
Zhijun He0e99c222015-01-29 15:26:05 -08001969 * 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 -07001970 * <p><b>Possible values:</b>
1971 * <ul>
1972 * <li>{@link #EDGE_MODE_OFF OFF}</li>
1973 * <li>{@link #EDGE_MODE_FAST FAST}</li>
1974 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07001975 * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001976 * </ul></p>
1977 * <p><b>Available values for this device:</b><br>
1978 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001979 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1980 * <p><b>Full capability</b> -
1981 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1982 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001983 *
1984 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001985 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08001986 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001987 * @see #EDGE_MODE_OFF
1988 * @see #EDGE_MODE_FAST
1989 * @see #EDGE_MODE_HIGH_QUALITY
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07001990 * @see #EDGE_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001991 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001992 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001993 public static final Key<Integer> EDGE_MODE =
1994 new Key<Integer>("android.edge.mode", int.class);
1995
1996 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001997 * <p>The desired mode for for the camera device's flash control.</p>
1998 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08001999 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002000 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2001 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2002 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2003 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2004 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2005 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002006 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002007 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2008 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2009 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002010 * <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 -07002011 * <p><b>Possible values:</b>
2012 * <ul>
2013 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2014 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2015 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2016 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002017 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002018 *
2019 * @see CaptureRequest#CONTROL_AE_MODE
2020 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2021 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002022 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002023 * @see #FLASH_MODE_OFF
2024 * @see #FLASH_MODE_SINGLE
2025 * @see #FLASH_MODE_TORCH
2026 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002027 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002028 public static final Key<Integer> FLASH_MODE =
2029 new Key<Integer>("android.flash.mode", int.class);
2030
2031 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002032 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002033 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002034 * that do not accurately measure the incoming light (i.e. pixels that
2035 * are stuck at an arbitrary value or are oversensitive).</p>
2036 * <p><b>Possible values:</b>
2037 * <ul>
2038 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2039 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2040 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2041 * </ul></p>
2042 * <p><b>Available values for this device:</b><br>
2043 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002044 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002045 *
2046 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002047 * @see #HOT_PIXEL_MODE_OFF
2048 * @see #HOT_PIXEL_MODE_FAST
2049 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2050 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002051 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002052 public static final Key<Integer> HOT_PIXEL_MODE =
2053 new Key<Integer>("android.hotPixel.mode", int.class);
2054
2055 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002056 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002057 * <p>Setting a location object in a request will include the GPS coordinates of the location
2058 * into any JPEG images captured based on the request. These coordinates can then be
2059 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002060 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002061 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002062 @PublicKey
2063 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002064 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2065 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2066
2067 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002068 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002069 * EXIF.</p>
2070 * <p><b>Range of valid values:</b><br>
2071 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002072 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002073 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002074 */
2075 public static final Key<double[]> JPEG_GPS_COORDINATES =
2076 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2077
2078 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002079 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002080 * include in EXIF.</p>
2081 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002082 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002083 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002084 */
2085 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2086 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2087
2088 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002089 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002090 * EXIF.</p>
2091 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002092 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002093 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002094 */
2095 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2096 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2097
2098 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002099 * <p>The orientation for a JPEG image.</p>
2100 * <p>The clockwise rotation angle in degrees, relative to the orientation
2101 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2102 * upright.</p>
2103 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
Yin-Chia Yehd49ebcc2015-03-27 13:54:04 -07002104 * rotate the image data to match this orientation. When the image data is rotated,
2105 * the thumbnail data will also be rotated.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002106 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2107 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
Emilian Peev3abc7512018-03-28 11:22:26 +01002108 * <p>To translate from the device orientation given by the Android sensor APIs for camera
2109 * sensors which are not EXTERNAL, the following sample code may be used:</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002110 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2111 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2112 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2113 *
2114 * // Round device orientation to a multiple of 90
2115 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2116 *
2117 * // Reverse device orientation for front-facing cameras
2118 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2119 * if (facingFront) deviceOrientation = -deviceOrientation;
2120 *
2121 * // Calculate desired JPEG orientation relative to camera orientation to make
2122 * // the image upright relative to the device orientation
2123 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2124 *
2125 * return jpegOrientation;
2126 * }
2127 * </code></pre>
Emilian Peev3abc7512018-03-28 11:22:26 +01002128 * <p>For EXTERNAL cameras the sensor orientation will always be set to 0 and the facing will
2129 * also be set to EXTERNAL. The above code is not relevant in such case.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002130 * <p><b>Units</b>: Degrees in multiples of 90</p>
2131 * <p><b>Range of valid values:</b><br>
2132 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002133 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002134 *
2135 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002136 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002137 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002138 public static final Key<Integer> JPEG_ORIENTATION =
2139 new Key<Integer>("android.jpeg.orientation", int.class);
2140
2141 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002142 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002143 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002144 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002145 * <p><b>Range of valid values:</b><br>
2146 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002147 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002148 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002149 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002150 public static final Key<Byte> JPEG_QUALITY =
2151 new Key<Byte>("android.jpeg.quality", byte.class);
2152
2153 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002154 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002155 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002156 * <p><b>Range of valid values:</b><br>
2157 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002158 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002159 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002160 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002161 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2162 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2163
2164 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002165 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002166 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2167 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002168 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2169 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002170 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2171 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2172 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2173 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2174 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2175 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002176 * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested,
2177 * the camera device will handle thumbnail rotation in one of the following ways:</p>
2178 * <ul>
2179 * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
2180 * and keep jpeg and thumbnail image data unrotated.</li>
2181 * <li>Rotate the jpeg and thumbnail image data and not set
2182 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
2183 * case, LIMITED or FULL hardware level devices will report rotated thumnail size in
2184 * capture result, so the width and height will be interchanged if 90 or 270 degree
2185 * orientation is requested. LEGACY device will always report unrotated thumbnail
2186 * size.</li>
2187 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002188 * <p><b>Range of valid values:</b><br>
2189 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002190 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002191 *
2192 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002193 * @see CaptureRequest#JPEG_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002194 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002195 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002196 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2197 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002198
2199 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002200 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2201 * effective aperture diameter.</p>
2202 * <p>Setting this value is only supported on the camera devices that have a variable
2203 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002204 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2205 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002206 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002207 * to achieve manual exposure control.</p>
2208 * <p>The requested aperture value may take several frames to reach the
2209 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002210 * aperture size in capture result metadata while the aperture is changing.
2211 * 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 -08002212 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2213 * the ON modes, this will be overridden by the camera device
2214 * auto-exposure algorithm, the overridden values are then provided
2215 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002216 * <p><b>Units</b>: The f-number (f/N)</p>
2217 * <p><b>Range of valid values:</b><br>
2218 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002219 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2220 * <p><b>Full capability</b> -
2221 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2222 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002223 *
Zhijun He399f05d2014-01-15 11:31:30 -08002224 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002225 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002226 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002227 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002228 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002229 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002230 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002231 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002232 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002233 public static final Key<Float> LENS_APERTURE =
2234 new Key<Float>("android.lens.aperture", float.class);
2235
2236 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002237 * <p>The desired setting for the lens neutral density filter(s).</p>
2238 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002239 * <p>Lens filters are typically used to lower the amount of light the
2240 * sensor is exposed to (measured in steps of EV). As used here, an EV
2241 * step is the standard logarithmic representation, which are
2242 * non-negative, and inversely proportional to the amount of light
2243 * hitting the sensor. For example, setting this to 0 would result
2244 * in no reduction of the incoming light, and setting this to 2 would
2245 * mean that the filter is set to reduce incoming light by two stops
2246 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002247 * <p>It may take several frames before the lens filter density changes
2248 * to the requested value. While the filter density is still changing,
2249 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002250 * <p><b>Units</b>: Exposure Value (EV)</p>
2251 * <p><b>Range of valid values:</b><br>
2252 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002253 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2254 * <p><b>Full capability</b> -
2255 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2256 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002257 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002258 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002259 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002260 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002261 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002262 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002263 public static final Key<Float> LENS_FILTER_DENSITY =
2264 new Key<Float>("android.lens.filterDensity", float.class);
2265
2266 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002267 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002268 * <p>This setting controls the physical focal length of the camera
2269 * device's lens. Changing the focal length changes the field of
2270 * view of the camera device, and is usually used for optical zoom.</p>
2271 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2272 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002273 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002274 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2275 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002276 * <p>Optical zoom will not be supported on most devices.</p>
2277 * <p><b>Units</b>: Millimeters</p>
2278 * <p><b>Range of valid values:</b><br>
2279 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002280 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002281 *
2282 * @see CaptureRequest#LENS_APERTURE
2283 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002284 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002285 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002286 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002287 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002288 public static final Key<Float> LENS_FOCAL_LENGTH =
2289 new Key<Float>("android.lens.focalLength", float.class);
2290
2291 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002292 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002293 * measured from frontmost surface of the lens.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002294 * <p>This control can be used for setting manual focus, on devices that support
2295 * the MANUAL_SENSOR capability and have a variable-focus lens (see
2296 * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}).</p>
2297 * <p>A value of <code>0.0f</code> means infinity focus. The value set will be clamped to
2298 * <code>[0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code>.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002299 * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied
2300 * instantaneously, and it may take several frames before the lens
2301 * can move to the requested focus distance. While the lens is still moving,
2302 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002303 * <p>LEGACY devices support at most setting this to <code>0.0f</code>
2304 * for infinity focus.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002305 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2306 * <p><b>Range of valid values:</b><br>
2307 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002308 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2309 * <p><b>Full capability</b> -
2310 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2311 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002312 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002313 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002314 * @see CaptureRequest#LENS_FOCAL_LENGTH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002315 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Zhijun Heca1b73a2014-02-03 12:39:53 -08002316 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
2317 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002318 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002319 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002320 public static final Key<Float> LENS_FOCUS_DISTANCE =
2321 new Key<Float>("android.lens.focusDistance", float.class);
2322
2323 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002324 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2325 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002326 * <p>OIS is used to compensate for motion blur due to small
2327 * movements of the camera during capture. Unlike digital image
2328 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2329 * makes use of mechanical elements to stabilize the camera
2330 * sensor, and thus allows for longer exposure times before
2331 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002332 * <p>Switching between different optical stabilization modes may take several
2333 * frames to initialize, the camera device will report the current mode in
2334 * capture result metadata. For example, When "ON" mode is requested, the
2335 * optical stabilization modes in the first several capture results may still
2336 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002337 * <p>If a camera device supports both OIS and digital image stabilization
2338 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2339 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002340 * <p>Not all devices will support OIS; see
2341 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2342 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002343 * <p><b>Possible values:</b>
2344 * <ul>
2345 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2346 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2347 * </ul></p>
2348 * <p><b>Available values for this device:</b><br>
2349 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002350 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2351 * <p><b>Limited capability</b> -
2352 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2353 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002354 *
2355 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002356 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002357 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002358 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2359 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2360 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002361 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002362 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2363 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2364
2365 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002366 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002367 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08002368 * excessive noise added by the capture process, especially in dark conditions.</p>
2369 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
2370 * YUV domain.</p>
2371 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
2372 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
2373 * This mode is optional, may not be support by all devices. The application should check
2374 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002375 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2376 * will be applied. HIGH_QUALITY mode indicates that the camera device
2377 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002378 * even if it slows down capture rate. FAST means the camera device will not
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002379 * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if
2380 * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate.
2381 * Every output stream will have a similar amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002382 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2383 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2384 * into a final capture when triggered by the user. In this mode, the camera device applies
2385 * noise reduction to low-resolution streams (below maximum recording resolution) to maximize
2386 * preview quality, but does not apply noise reduction to high-resolution streams, since
2387 * those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002388 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
2389 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
2390 * may adjust the noise reduction parameters for best image quality based on the
2391 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002392 * <p><b>Possible values:</b>
2393 * <ul>
2394 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2395 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2396 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08002397 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002398 * <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002399 * </ul></p>
2400 * <p><b>Available values for this device:</b><br>
2401 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002402 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2403 * <p><b>Full capability</b> -
2404 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2405 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002406 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002407 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002408 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08002409 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002410 * @see #NOISE_REDUCTION_MODE_OFF
2411 * @see #NOISE_REDUCTION_MODE_FAST
2412 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08002413 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002414 * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002415 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002416 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002417 public static final Key<Integer> NOISE_REDUCTION_MODE =
2418 new Key<Integer>("android.noiseReduction.mode", int.class);
2419
2420 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002421 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002422 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002423 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002424 * <p><b>Units</b>: arbitrary integer assigned by application</p>
2425 * <p><b>Range of valid values:</b><br>
2426 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002427 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002428 * @hide
2429 */
2430 public static final Key<Integer> REQUEST_ID =
2431 new Key<Integer>("android.request.id", int.class);
2432
2433 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002434 * <p>The desired region of the sensor to read out for this capture.</p>
2435 * <p>This control can be used to implement digital zoom.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002436 * <p>The crop region coordinate system is based off
2437 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2438 * top-left corner of the sensor active array.</p>
2439 * <p>Output streams use this rectangle to produce their output,
2440 * cropping to a smaller region if necessary to maintain the
2441 * stream's aspect ratio, then scaling the sensor input to
2442 * match the output's configured resolution.</p>
2443 * <p>The crop region is applied after the RAW to other color
2444 * space (e.g. YUV) conversion. Since raw streams
2445 * (e.g. RAW16) don't have the conversion stage, they are not
2446 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002447 * <p>For non-raw streams, any additional per-stream cropping will
2448 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002449 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002450 * ratio, then 4:3 streams will use the exact crop
2451 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002452 * (letterbox).</p>
2453 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002454 * outputs will crop horizontally (pillarbox), and 16:9
2455 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002456 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002457 * <p>The width and height of the crop region cannot
2458 * be set to be smaller than
2459 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2460 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2461 * <p>The camera device may adjust the crop region to account
2462 * for rounding and other hardware requirements; the final
2463 * crop region used will be included in the output capture
2464 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002465 * <p><b>Units</b>: Pixel coordinates relative to
2466 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002467 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002468 *
2469 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002470 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002471 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002472 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002473 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2474 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2475
2476 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002477 * <p>Duration each pixel is exposed to
2478 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002479 * <p>If the sensor can't expose this exact duration, it will shorten the
2480 * duration exposed to the nearest possible value (rather than expose longer).
2481 * The final exposure time used will be available in the output capture result.</p>
2482 * <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
2483 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2484 * <p><b>Units</b>: Nanoseconds</p>
2485 * <p><b>Range of valid values:</b><br>
2486 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002487 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2488 * <p><b>Full capability</b> -
2489 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2490 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2491 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002492 * @see CaptureRequest#CONTROL_AE_MODE
2493 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002494 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002495 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002496 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002497 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002498 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2499 new Key<Long>("android.sensor.exposureTime", long.class);
2500
2501 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002502 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002503 * start of next frame exposure.</p>
2504 * <p>The maximum frame rate that can be supported by a camera subsystem is
2505 * a function of many factors:</p>
2506 * <ul>
2507 * <li>Requested resolutions of output image streams</li>
2508 * <li>Availability of binning / skipping modes on the imager</li>
2509 * <li>The bandwidth of the imager interface</li>
2510 * <li>The bandwidth of the various ISP processing blocks</li>
2511 * </ul>
2512 * <p>Since these factors can vary greatly between different ISPs and
2513 * sensors, the camera abstraction tries to represent the bandwidth
2514 * restrictions with as simple a model as possible.</p>
2515 * <p>The model presented has the following characteristics:</p>
2516 * <ul>
2517 * <li>The image sensor is always configured to output the smallest
2518 * resolution possible given the application's requested output stream
2519 * sizes. The smallest resolution is defined as being at least as large
2520 * as the largest requested output stream size; the camera pipeline must
2521 * never digitally upsample sensor data when the crop region covers the
2522 * whole sensor. In general, this means that if only small output stream
2523 * resolutions are configured, the sensor can provide a higher frame
2524 * rate.</li>
2525 * <li>Since any request may use any or all the currently configured
2526 * output streams, the sensor and ISP must be configured to support
2527 * scaling a single capture to all the streams at the same time. This
2528 * means the camera pipeline must be ready to produce the largest
2529 * requested output size without any delay. Therefore, the overall
2530 * frame rate of a given configured stream set is governed only by the
2531 * largest requested stream resolution.</li>
2532 * <li>Using more than one output stream in a request does not affect the
2533 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002534 * <li>Certain format-streams may need to do additional background processing
2535 * before data is consumed/produced by that stream. These processors
2536 * can run concurrently to the rest of the camera pipeline, but
2537 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002538 * </ul>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002539 * <p>The necessary information for the application, given the model above, is provided via
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002540 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002541 * These are used to determine the maximum frame rate / minimum frame duration that is
2542 * possible for a given stream configuration.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002543 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002544 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002545 * device:</p>
2546 * <ol>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002547 * <li>Let the set of currently configured input/output streams be called <code>S</code>.</li>
2548 * <li>Find the minimum frame durations for each stream in <code>S</code>, by looking it up in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
2549 * (with its respective size/format). Let this set of frame durations be called <code>F</code>.</li>
2550 * <li>For any given request <code>R</code>, the minimum frame duration allowed for <code>R</code> is the maximum
2551 * out of all values in <code>F</code>. Let the streams used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002552 * </ol>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002553 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002554 * using its respective size/format), then the frame duration in <code>F</code> determines the steady
2555 * state frame rate that the application will get if it uses <code>R</code> as a repeating request. Let
2556 * this special kind of request be called <code>Rsimple</code>.</p>
2557 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved by a single capture of a
2558 * new request <code>Rstall</code> (which has at least one in-use stream with a non-0 stall time) and if
2559 * <code>Rstall</code> has the same minimum frame duration this will not cause a frame rate loss if all
2560 * buffers from the previous <code>Rstall</code> have already been delivered.</p>
2561 * <p>For more details about stalling, see {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002562 * <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
2563 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2564 * <p><b>Units</b>: Nanoseconds</p>
2565 * <p><b>Range of valid values:</b><br>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002566 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, {@link android.hardware.camera2.params.StreamConfigurationMap }.
2567 * The duration is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002568 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2569 * <p><b>Full capability</b> -
2570 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2571 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002572 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002573 * @see CaptureRequest#CONTROL_AE_MODE
2574 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002575 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002576 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002577 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002578 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002579 public static final Key<Long> SENSOR_FRAME_DURATION =
2580 new Key<Long>("android.sensor.frameDuration", long.class);
2581
2582 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002583 * <p>The amount of gain applied to sensor data
2584 * before processing.</p>
2585 * <p>The sensitivity is the standard ISO sensitivity value,
2586 * as defined in ISO 12232:2006.</p>
2587 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2588 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2589 * is guaranteed to use only analog amplification for applying the gain.</p>
2590 * <p>If the camera device cannot apply the exact sensitivity
2591 * requested, it will reduce the gain to the nearest supported
2592 * value. The final sensitivity used will be available in the
2593 * output capture result.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002594 * <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
2595 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002596 * <p><b>Units</b>: ISO arithmetic units</p>
2597 * <p><b>Range of valid values:</b><br>
2598 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002599 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2600 * <p><b>Full capability</b> -
2601 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2602 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002603 *
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002604 * @see CaptureRequest#CONTROL_AE_MODE
2605 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002606 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002607 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2608 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002609 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002610 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002611 public static final Key<Integer> SENSOR_SENSITIVITY =
2612 new Key<Integer>("android.sensor.sensitivity", int.class);
2613
2614 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002615 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2616 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2617 * <p>Each color channel is treated as an unsigned 32-bit integer.
2618 * The camera device then uses the most significant X bits
2619 * that correspond to how many bits are in its Bayer raw sensor
2620 * output.</p>
2621 * <p>For example, a sensor with RAW10 Bayer output would use the
2622 * 10 most significant bits from each color channel.</p>
2623 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2624 *
2625 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2626 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002627 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002628 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2629 new Key<int[]>("android.sensor.testPatternData", int[].class);
2630
2631 /**
2632 * <p>When enabled, the sensor sends a test pattern instead of
2633 * doing a real exposure from the camera.</p>
2634 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002635 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002636 * work as normal.</p>
2637 * <p>For example, if manual flash is enabled, flash firing should still
2638 * occur (and that the test pattern remain unmodified, since the flash
2639 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002640 * <p>Defaults to OFF.</p>
2641 * <p><b>Possible values:</b>
2642 * <ul>
2643 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
2644 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
2645 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
2646 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
2647 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
2648 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
2649 * </ul></p>
2650 * <p><b>Available values for this device:</b><br>
2651 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002652 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002653 *
2654 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08002655 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2656 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2657 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2658 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2659 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2660 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2661 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002662 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002663 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2664 new Key<Integer>("android.sensor.testPatternMode", int.class);
2665
2666 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002667 * <p>Quality of lens shading correction applied
2668 * to the image data.</p>
2669 * <p>When set to OFF mode, no lens shading correction will be applied by the
2670 * camera device, and an identity lens shading map data will be provided
2671 * 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 -07002672 * shading map with size of <code>[ 4, 3 ]</code>,
2673 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
2674 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002675 * <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 -07002676 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2677 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2678 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2679 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2680 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08002681 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002682 * <p>When set to other modes, lens shading correction will be applied by the camera
2683 * device. Applications can request lens shading map data by setting
2684 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
2685 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
2686 * data will be the one applied by the camera device for this capture request.</p>
2687 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
2688 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
2689 * 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>
2690 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
2691 * to be converged before using the returned shading map data.</p>
2692 * <p><b>Possible values:</b>
2693 * <ul>
2694 * <li>{@link #SHADING_MODE_OFF OFF}</li>
2695 * <li>{@link #SHADING_MODE_FAST FAST}</li>
2696 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2697 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002698 * <p><b>Available values for this device:</b><br>
2699 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002700 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2701 * <p><b>Full capability</b> -
2702 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2703 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002704 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002705 * @see CaptureRequest#CONTROL_AE_MODE
2706 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002707 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002708 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002709 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08002710 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2711 * @see #SHADING_MODE_OFF
2712 * @see #SHADING_MODE_FAST
2713 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08002714 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002715 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08002716 public static final Key<Integer> SHADING_MODE =
2717 new Key<Integer>("android.shading.mode", int.class);
2718
2719 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002720 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002721 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002722 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002723 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002724 * fields.</p>
2725 * <p><b>Possible values:</b>
2726 * <ul>
2727 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
2728 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
2729 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
2730 * </ul></p>
2731 * <p><b>Available values for this device:</b><br>
2732 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
2733 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002734 *
2735 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002736 * @see #STATISTICS_FACE_DETECT_MODE_OFF
2737 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
2738 * @see #STATISTICS_FACE_DETECT_MODE_FULL
2739 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002740 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002741 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
2742 new Key<Integer>("android.statistics.faceDetectMode", int.class);
2743
2744 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002745 * <p>Operating mode for hot pixel map generation.</p>
2746 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
2747 * If set to <code>false</code>, no hot pixel map will be returned.</p>
2748 * <p><b>Range of valid values:</b><br>
2749 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002750 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002751 *
2752 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
2753 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
2754 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002755 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002756 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
2757 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
2758
2759 /**
Zhijun Hecc28a412014-02-24 15:11:23 -08002760 * <p>Whether the camera device will output the lens
2761 * shading map in output result metadata.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002762 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002763 * android.statistics.lensShadingMap will be provided in
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002764 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002765 * <p>ON is always supported on devices with the RAW capability.</p>
2766 * <p><b>Possible values:</b>
2767 * <ul>
2768 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
2769 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
2770 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002771 * <p><b>Available values for this device:</b><br>
2772 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002773 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2774 * <p><b>Full capability</b> -
2775 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2776 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2777 *
2778 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002779 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
Eino-Ville Talvalad96748b2013-09-12 11:11:27 -07002780 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2781 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2782 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002783 @PublicKey
Eino-Ville Talvalad96748b2013-09-12 11:11:27 -07002784 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2785 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2786
2787 /**
Eino-Ville Talvala601e0f62018-02-05 16:25:40 -08002788 * <p>A control for selecting whether OIS position information is included in output
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08002789 * result metadata.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08002790 * <p><b>Possible values:</b>
2791 * <ul>
2792 * <li>{@link #STATISTICS_OIS_DATA_MODE_OFF OFF}</li>
2793 * <li>{@link #STATISTICS_OIS_DATA_MODE_ON ON}</li>
2794 * </ul></p>
2795 * <p><b>Available values for this device:</b><br>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002796 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES android.statistics.info.availableOisDataModes}</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08002797 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002798 *
2799 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08002800 * @see #STATISTICS_OIS_DATA_MODE_OFF
2801 * @see #STATISTICS_OIS_DATA_MODE_ON
2802 */
2803 @PublicKey
2804 public static final Key<Integer> STATISTICS_OIS_DATA_MODE =
2805 new Key<Integer>("android.statistics.oisDataMode", int.class);
2806
2807 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002808 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08002809 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2810 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002811 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002812 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2813 * <p><b>Full capability</b> -
2814 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2815 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002816 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002817 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08002818 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002819 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002820 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002821 public static final Key<float[]> TONEMAP_CURVE_BLUE =
2822 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002823
2824 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002825 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08002826 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2827 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002828 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002829 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2830 * <p><b>Full capability</b> -
2831 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2832 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002833 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002834 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08002835 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002836 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002837 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002838 public static final Key<float[]> TONEMAP_CURVE_GREEN =
2839 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002840
2841 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002842 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08002843 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2844 * CONTRAST_CURVE.</p>
2845 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002846 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002847 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08002848 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002849 * <p>These are sorted in order of increasing <code>Pin</code>; it is
2850 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08002851 * define a complete mapping. For input values between control points,
2852 * the camera device must linearly interpolate between the control
2853 * points.</p>
2854 * <p>Each curve can have an independent number of points, and the number
2855 * of points can be less than max (that is, the request doesn't have to
2856 * always provide a curve with number of points equivalent to
2857 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wang51248bf2018-03-22 00:04:45 -07002858 * <p>For devices with MONOCHROME capability, only red channel is used. Green and blue channels
2859 * are ignored.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08002860 * <p>A few examples, and their corresponding graphical mappings; these
2861 * only specify the red channel and the precision is limited to 4
2862 * digits, for conciseness.</p>
2863 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002864 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002865 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002866 * <p><img alt="Linear mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
Igor Murashkine0060932014-01-17 17:24:11 -08002867 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002868 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002869 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002870 * <p><img alt="Inverting mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
Igor Murashkine0060932014-01-17 17:24:11 -08002871 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002872 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002873 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2874 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2875 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2876 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002877 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002878 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
Igor Murashkine0060932014-01-17 17:24:11 -08002879 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002880 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002881 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2882 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2883 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2884 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08002885 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002886 * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002887 * <p><b>Range of valid values:</b><br>
2888 * 0-1 on both input and output coordinates, normalized
2889 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002890 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2891 * <p><b>Full capability</b> -
2892 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2893 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002894 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002895 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08002896 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002897 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002898 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002899 */
2900 public static final Key<float[]> TONEMAP_CURVE_RED =
2901 new Key<float[]>("android.tonemap.curveRed", float[].class);
2902
2903 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002904 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
2905 * is CONTRAST_CURVE.</p>
2906 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
2907 * channels respectively. The following example uses the red channel as an
2908 * example. The same logic applies to green and blue channel.
2909 * Each channel's curve is defined by an array of control points:</p>
2910 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002911 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002912 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
2913 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2914 * guaranteed that input values 0.0 and 1.0 are included in the list to
2915 * define a complete mapping. For input values between control points,
2916 * the camera device must linearly interpolate between the control
2917 * points.</p>
2918 * <p>Each curve can have an independent number of points, and the number
2919 * of points can be less than max (that is, the request doesn't have to
2920 * always provide a curve with number of points equivalent to
2921 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wang51248bf2018-03-22 00:04:45 -07002922 * <p>For devices with MONOCHROME capability, only red channel is used. Green and blue channels
2923 * are ignored.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002924 * <p>A few examples, and their corresponding graphical mappings; these
2925 * only specify the red channel and the precision is limited to 4
2926 * digits, for conciseness.</p>
2927 * <p>Linear mapping:</p>
2928 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
2929 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002930 * <p><img alt="Linear mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002931 * <p>Invert mapping:</p>
2932 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
2933 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002934 * <p><img alt="Inverting mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002935 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
2936 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002937 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
2938 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
2939 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
2940 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002941 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002942 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002943 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
2944 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002945 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
2946 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
2947 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
2948 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002949 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002950 * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002951 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2952 * <p><b>Full capability</b> -
2953 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2954 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002955 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002956 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002957 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
2958 * @see CaptureRequest#TONEMAP_MODE
2959 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002960 @PublicKey
2961 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002962 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
2963 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
2964
2965 /**
Igor Murashkine0060932014-01-17 17:24:11 -08002966 * <p>High-level global contrast/gamma/tonemapping control.</p>
2967 * <p>When switching to an application-defined contrast curve by setting
2968 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
2969 * per-channel with a set of <code>(in, out)</code> points that specify the
2970 * mapping from input high-bit-depth pixel value to the output
2971 * low-bit-depth value. Since the actual pixel ranges of both input
2972 * and output may change depending on the camera pipeline, the values
2973 * are specified by normalized floating-point numbers.</p>
2974 * <p>More-complex color mapping operations such as 3D color look-up
2975 * tables, selective chroma enhancement, or other non-linear color
2976 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2977 * CONTRAST_CURVE.</p>
2978 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002979 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08002980 * These values are always available, and as close as possible to the
2981 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07002982 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08002983 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
2984 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002985 * <p><b>Possible values:</b>
2986 * <ul>
2987 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
2988 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
2989 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08002990 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
2991 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002992 * </ul></p>
2993 * <p><b>Available values for this device:</b><br>
2994 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002995 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2996 * <p><b>Full capability</b> -
2997 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2998 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002999 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003000 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003001 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003002 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08003003 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003004 * @see #TONEMAP_MODE_CONTRAST_CURVE
3005 * @see #TONEMAP_MODE_FAST
3006 * @see #TONEMAP_MODE_HIGH_QUALITY
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003007 * @see #TONEMAP_MODE_GAMMA_VALUE
3008 * @see #TONEMAP_MODE_PRESET_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003009 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003010 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003011 public static final Key<Integer> TONEMAP_MODE =
3012 new Key<Integer>("android.tonemap.mode", int.class);
3013
3014 /**
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003015 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3016 * GAMMA_VALUE</p>
3017 * <p>The tonemap curve will be defined the following formula:
3018 * * OUT = pow(IN, 1.0 / gamma)
3019 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
3020 * pow is the power function and gamma is the gamma value specified by this
3021 * key.</p>
3022 * <p>The same curve will be applied to all color channels. The camera device
3023 * may clip the input gamma value to its supported range. The actual applied
3024 * value will be returned in capture result.</p>
3025 * <p>The valid range of gamma value varies on different devices, but values
3026 * within [1.0, 5.0] are guaranteed not to be clipped.</p>
3027 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3028 *
3029 * @see CaptureRequest#TONEMAP_MODE
3030 */
3031 @PublicKey
3032 public static final Key<Float> TONEMAP_GAMMA =
3033 new Key<Float>("android.tonemap.gamma", float.class);
3034
3035 /**
3036 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3037 * PRESET_CURVE</p>
3038 * <p>The tonemap curve will be defined by specified standard.</p>
3039 * <p>sRGB (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003040 * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003041 * <p>Rec. 709 (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003042 * <p><img alt="Rec. 709 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003043 * <p>Note that above figures show a 16 control points approximation of preset
3044 * curves. Camera devices may apply a different approximation to the curve.</p>
3045 * <p><b>Possible values:</b>
3046 * <ul>
3047 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
3048 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
3049 * </ul></p>
3050 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3051 *
3052 * @see CaptureRequest#TONEMAP_MODE
3053 * @see #TONEMAP_PRESET_CURVE_SRGB
3054 * @see #TONEMAP_PRESET_CURVE_REC709
3055 */
3056 @PublicKey
3057 public static final Key<Integer> TONEMAP_PRESET_CURVE =
3058 new Key<Integer>("android.tonemap.presetCurve", int.class);
3059
3060 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003061 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003062 * that the camera is powered on and may be streaming images back to the
3063 * Application Processor. In certain rare circumstances, the OS may
3064 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003065 * any untrusted applications.</p>
3066 * <p>In particular, the LED <em>must</em> always be on when the data could be
3067 * transmitted off the device. The LED <em>should</em> always be on whenever
3068 * data is stored locally on the device.</p>
3069 * <p>The LED <em>may</em> be off if a trusted application is using the data that
3070 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003071 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003072 * @hide
3073 */
3074 public static final Key<Boolean> LED_TRANSMIT =
3075 new Key<Boolean>("android.led.transmit", boolean.class);
3076
3077 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003078 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003079 * to its current values, or is free to vary.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003080 * <p>When set to <code>true</code> (ON), the values used for black-level
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003081 * compensation will not change until the lock is set to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003082 * <code>false</code> (OFF).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003083 * <p>Since changes to certain capture parameters (such as
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003084 * exposure time) may require resetting of black level
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003085 * compensation, the camera device must report whether setting
3086 * the black level lock was successful in the output result
Igor Murashkinace5bf02013-12-10 17:36:40 -08003087 * metadata.</p>
3088 * <p>For example, if a sequence of requests is as follows:</p>
3089 * <ul>
3090 * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li>
3091 * <li>Request 2: Exposure = 10ms, Black level lock = ON</li>
3092 * <li>Request 3: Exposure = 10ms, Black level lock = ON</li>
3093 * <li>Request 4: Exposure = 20ms, Black level lock = ON</li>
3094 * <li>Request 5: Exposure = 20ms, Black level lock = ON</li>
3095 * <li>Request 6: Exposure = 20ms, Black level lock = ON</li>
3096 * </ul>
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003097 * <p>And the exposure change in Request 4 requires the camera
3098 * device to reset the black level offsets, then the output
3099 * result metadata is expected to be:</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003100 * <ul>
3101 * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li>
3102 * <li>Result 2: Exposure = 10ms, Black level lock = ON</li>
3103 * <li>Result 3: Exposure = 10ms, Black level lock = ON</li>
3104 * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li>
3105 * <li>Result 5: Exposure = 20ms, Black level lock = ON</li>
3106 * <li>Result 6: Exposure = 20ms, Black level lock = ON</li>
3107 * </ul>
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003108 * <p>This indicates to the application that on frame 4, black
3109 * levels were reset due to exposure value changes, and pixel
3110 * values may not be consistent across captures.</p>
3111 * <p>The camera device will maintain the lock to the extent
3112 * possible, only overriding the lock to OFF when changes to
3113 * other request parameters require a black level recalculation
3114 * or reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003115 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3116 * <p><b>Full capability</b> -
3117 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3118 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3119 *
3120 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003121 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003122 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003123 public static final Key<Boolean> BLACK_LEVEL_LOCK =
3124 new Key<Boolean>("android.blackLevel.lock", boolean.class);
3125
Zhijun He0e99c222015-01-29 15:26:05 -08003126 /**
3127 * <p>The amount of exposure time increase factor applied to the original output
3128 * frame by the application processing before sending for reprocessing.</p>
3129 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
3130 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
3131 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
3132 * output frames to effectively reduce the noise to the same level as a frame that was
3133 * captured with longer exposure time. To be more specific, assuming the original captured
3134 * images were captured with a sensitivity of S and an exposure time of T, the model in
3135 * the camera device is that the amount of noise in the image would be approximately what
3136 * would be expected if the original capture parameters had been a sensitivity of
3137 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
3138 * than S and T respectively. If the captured images were processed by the application
3139 * before being sent for reprocessing, then the application may have used image processing
3140 * algorithms and/or multi-frame image fusion to reduce the noise in the
3141 * application-processed images (input images). By using the effectiveExposureFactor
3142 * control, the application can communicate to the camera device the actual noise level
3143 * improvement in the application-processed image. With this information, the camera
3144 * device can select appropriate noise reduction and edge enhancement parameters to avoid
3145 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
3146 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
3147 * <p>For example, for multi-frame image fusion use case, the application may fuse
3148 * multiple output frames together to a final frame for reprocessing. When N image are
3149 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
3150 * square root of N (based on a simple photon shot noise model). The camera device will
3151 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
3152 * produce the best quality images.</p>
3153 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
3154 * buffer in a way that affects its effective exposure time.</p>
3155 * <p>This control is only effective for YUV reprocessing capture request. For noise
3156 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
3157 * Similarly, for edge enhancement reprocessing, it is only effective when
3158 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
3159 * <p><b>Units</b>: Relative exposure time increase factor.</p>
3160 * <p><b>Range of valid values:</b><br>
3161 * &gt;= 1.0</p>
3162 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07003163 * <p><b>Limited capability</b> -
3164 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3165 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0e99c222015-01-29 15:26:05 -08003166 *
3167 * @see CaptureRequest#EDGE_MODE
Zhijun He513f7c32015-04-24 18:23:54 -07003168 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08003169 * @see CaptureRequest#NOISE_REDUCTION_MODE
3170 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3171 */
3172 @PublicKey
3173 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
3174 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
3175
Eino-Ville Talvala41670722018-03-13 19:43:07 -07003176 /**
3177 * <p>Mode of operation for the lens distortion correction block.</p>
3178 * <p>The lens distortion correction block attempts to improve image quality by fixing
3179 * radial, tangential, or other geometric aberrations in the camera device's optics. If
3180 * available, the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} field documents the lens's distortion parameters.</p>
3181 * <p>OFF means no distortion correction is done.</p>
3182 * <p>FAST/HIGH_QUALITY both mean camera device determined distortion correction will be
3183 * applied. HIGH_QUALITY mode indicates that the camera device will use the highest-quality
3184 * correction algorithms, even if it slows down capture rate. FAST means the camera device
3185 * will not slow down capture rate when applying correction. FAST may be the same as OFF if
3186 * any correction at all would slow down capture rate. Every output stream will have a
3187 * similar amount of enhancement applied.</p>
3188 * <p>The correction only applies to processed outputs such as YUV, JPEG, or DEPTH16; it is not
3189 * applied to any RAW output. Metadata coordinates such as face rectangles or metering
3190 * regions are also not affected by correction.</p>
3191 * <p>Applications enabling distortion correction need to pay extra attention when converting
3192 * image coordinates between corrected output buffers and the sensor array. For example, if
3193 * the app supports tap-to-focus and enables correction, it then has to apply the distortion
3194 * model described in {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} to the image buffer tap coordinates to properly
3195 * calculate the tap position on the sensor active array to be used with
3196 * {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}. The same applies in reverse to detected face rectangles if
3197 * they need to be drawn on top of the corrected output buffers.</p>
3198 * <p><b>Possible values:</b>
3199 * <ul>
3200 * <li>{@link #DISTORTION_CORRECTION_MODE_OFF OFF}</li>
3201 * <li>{@link #DISTORTION_CORRECTION_MODE_FAST FAST}</li>
3202 * <li>{@link #DISTORTION_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3203 * </ul></p>
3204 * <p><b>Available values for this device:</b><br>
3205 * {@link CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES android.distortionCorrection.availableModes}</p>
3206 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3207 *
3208 * @see CaptureRequest#CONTROL_AF_REGIONS
3209 * @see CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES
3210 * @see CameraCharacteristics#LENS_DISTORTION
3211 * @see #DISTORTION_CORRECTION_MODE_OFF
3212 * @see #DISTORTION_CORRECTION_MODE_FAST
3213 * @see #DISTORTION_CORRECTION_MODE_HIGH_QUALITY
3214 */
3215 @PublicKey
3216 public static final Key<Integer> DISTORTION_CORRECTION_MODE =
3217 new Key<Integer>("android.distortionCorrection.mode", int.class);
3218
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003219 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3220 * End generated code
3221 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07003222
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003223
3224
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003225}