blob: eddfd7d0e8e6cc0d59b2d80b5d66a3522bb9ed7d [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;
Mathew Inwoodbcbe4402018-08-08 15:42:59 +010021import android.annotation.UnsupportedAppUsage;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070022import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkin6c76f582014-07-15 17:19:49 -070023import android.hardware.camera2.impl.PublicKey;
24import android.hardware.camera2.impl.SyntheticKey;
Yin-Chia Yehc60af902017-11-10 20:02:29 -080025import android.hardware.camera2.params.OutputConfiguration;
Ruben Brunk5776aaf2014-06-19 13:42:40 -070026import android.hardware.camera2.utils.HashCodeHelpers;
Yin-Chia Yeh4f151472018-02-21 12:38:19 -080027import android.hardware.camera2.utils.SurfaceUtils;
Shuzhen Wanga8d36032018-10-15 12:01:53 -070028import android.hardware.camera2.utils.TypeReference;
Igor Murashkin70725502013-06-25 20:27:06 +000029import android.os.Parcel;
30import android.os.Parcelable;
Yin-Chia Yehc60af902017-11-10 20:02:29 -080031import android.util.ArraySet;
32import android.util.Log;
33import android.util.SparseArray;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080034import android.view.Surface;
35
Ruben Brunkfeb50af2014-05-09 19:58:49 -070036import java.util.Collection;
37import java.util.Collections;
Emilian Peev2100ae72018-01-12 16:56:25 +000038import java.util.HashMap;
Igor Murashkind6d65152014-05-19 16:31:02 -070039import java.util.List;
Emilian Peev2100ae72018-01-12 16:56:25 +000040import java.util.Map;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -070041import java.util.Objects;
Emilian Peev2100ae72018-01-12 16:56:25 +000042import java.util.Set;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080043
44/**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070045 * <p>An immutable package of settings and outputs needed to capture a single
46 * image from the camera device.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080047 *
48 * <p>Contains the configuration for the capture hardware (sensor, lens, flash),
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070049 * the processing pipeline, the control algorithms, and the output buffers. Also
50 * contains the list of target Surfaces to send image data to for this
51 * capture.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080052 *
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070053 * <p>CaptureRequests can be created by using a {@link Builder} instance,
54 * obtained by calling {@link CameraDevice#createCaptureRequest}</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080055 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -070056 * <p>CaptureRequests are given to {@link CameraCaptureSession#capture} or
57 * {@link CameraCaptureSession#setRepeatingRequest} to capture images from a camera.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080058 *
59 * <p>Each request can specify a different subset of target Surfaces for the
60 * camera to send the captured data to. All the surfaces used in a request must
61 * be part of the surface list given to the last call to
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -070062 * {@link CameraDevice#createCaptureSession}, when the request is submitted to the
63 * session.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080064 *
65 * <p>For example, a request meant for repeating preview might only include the
66 * Surface for the preview SurfaceView or SurfaceTexture, while a
67 * high-resolution still capture would also include a Surface from a ImageReader
68 * configured for high-resolution JPEG images.</p>
69 *
Eino-Ville Talvala0aa2bde2015-05-19 17:25:54 -070070 * <p>A reprocess capture request allows a previously-captured image from the camera device to be
71 * sent back to the device for further processing. It can be created with
Eino-Ville Talvalabd7f34f2015-05-21 11:10:51 -070072 * {@link CameraDevice#createReprocessCaptureRequest}, and used with a reprocessable capture session
Eino-Ville Talvala0aa2bde2015-05-19 17:25:54 -070073 * created with {@link CameraDevice#createReprocessableCaptureSession}.</p>
74 *
75 * @see CameraCaptureSession#capture
76 * @see CameraCaptureSession#setRepeatingRequest
77 * @see CameraCaptureSession#captureBurst
78 * @see CameraCaptureSession#setRepeatingBurst
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070079 * @see CameraDevice#createCaptureRequest
Eino-Ville Talvala0aa2bde2015-05-19 17:25:54 -070080 * @see CameraDevice#createReprocessCaptureRequest
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080081 */
Igor Murashkind6d65152014-05-19 16:31:02 -070082public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
83 implements Parcelable {
84
85 /**
86 * A {@code Key} is used to do capture request field lookups with
87 * {@link CaptureResult#get} or to set fields with
88 * {@link CaptureRequest.Builder#set(Key, Object)}.
89 *
90 * <p>For example, to set the crop rectangle for the next capture:
91 * <code><pre>
92 * Rect cropRectangle = new Rect(0, 0, 640, 480);
93 * captureRequestBuilder.set(SCALER_CROP_REGION, cropRectangle);
94 * </pre></code>
95 * </p>
96 *
97 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
98 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
99 *
100 * @see CaptureResult#get
101 * @see CameraCharacteristics#getAvailableCaptureResultKeys
102 */
103 public final static class Key<T> {
104 private final CameraMetadataNative.Key<T> mKey;
105
106 /**
107 * Visible for testing and vendor extensions only.
108 *
109 * @hide
110 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100111 @UnsupportedAppUsage
Emilian Peevde62d842017-03-23 19:20:40 +0000112 public Key(String name, Class<T> type, long vendorId) {
113 mKey = new CameraMetadataNative.Key<T>(name, type, vendorId);
114 }
115
116 /**
Eino-Ville Talvala1cf59fd2019-01-25 17:33:05 -0800117 * Construct a new Key with a given name and type.
Emilian Peevde62d842017-03-23 19:20:40 +0000118 *
Eino-Ville Talvala1cf59fd2019-01-25 17:33:05 -0800119 * <p>Normally, applications should use the existing Key definitions in
120 * {@link CaptureRequest}, and not need to construct their own Key objects. However, they
121 * may be useful for testing purposes and for defining custom capture request fields.</p>
Emilian Peevde62d842017-03-23 19:20:40 +0000122 */
Eino-Ville Talvala79d4aac2019-03-06 14:26:10 -0800123 public Key(@NonNull String name, @NonNull Class<T> type) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700124 mKey = new CameraMetadataNative.Key<T>(name, type);
125 }
126
127 /**
128 * Visible for testing and vendor extensions only.
129 *
130 * @hide
131 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100132 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700133 public Key(String name, TypeReference<T> typeReference) {
134 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
135 }
136
137 /**
138 * Return a camelCase, period separated name formatted like:
139 * {@code "root.section[.subsections].name"}.
140 *
141 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
142 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
143 *
144 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
145 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
146 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
147 *
148 * @return String representation of the key name
149 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700150 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700151 public String getName() {
152 return mKey.getName();
153 }
154
155 /**
Emilian Peevde62d842017-03-23 19:20:40 +0000156 * Return vendor tag id.
157 *
158 * @hide
159 */
160 public long getVendorId() {
161 return mKey.getVendorId();
162 }
163
164 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700165 * {@inheritDoc}
166 */
167 @Override
168 public final int hashCode() {
169 return mKey.hashCode();
170 }
171
172 /**
173 * {@inheritDoc}
174 */
175 @SuppressWarnings("unchecked")
176 @Override
177 public final boolean equals(Object o) {
178 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
179 }
180
181 /**
Chien-Yu Chen12a83852015-07-07 12:17:22 -0700182 * Return this {@link Key} as a string representation.
183 *
184 * <p>{@code "CaptureRequest.Key(%s)"}, where {@code %s} represents
185 * the name of this key as returned by {@link #getName}.</p>
186 *
187 * @return string representation of {@link Key}
188 */
189 @NonNull
190 @Override
191 public String toString() {
192 return String.format("CaptureRequest.Key(%s)", mKey.getName());
193 }
194
195 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700196 * Visible for CameraMetadataNative implementation only; do not use.
197 *
198 * TODO: Make this private or remove it altogether.
199 *
200 * @hide
201 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100202 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700203 public CameraMetadataNative.Key<T> getNativeKey() {
204 return mKey;
205 }
206
207 @SuppressWarnings({ "unchecked" })
208 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
209 mKey = (CameraMetadataNative.Key<T>) nativeKey;
210 }
211 }
Igor Murashkin70725502013-06-25 20:27:06 +0000212
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800213 private final String TAG = "CaptureRequest-JV";
214
215 private final ArraySet<Surface> mSurfaceSet = new ArraySet<Surface>();
216
217 // Speed up sending CaptureRequest across IPC:
218 // mSurfaceConverted should only be set to true during capture request
219 // submission by {@link #convertSurfaceToStreamId}. The method will convert
220 // surfaces to stream/surface indexes based on passed in stream configuration at that time.
221 // This will save significant unparcel time for remote camera device.
222 // Once the request is submitted, camera device will call {@link #recoverStreamIdToSurface}
223 // to reset the capture request back to its original state.
224 private final Object mSurfacesLock = new Object();
225 private boolean mSurfaceConverted = false;
226 private int[] mStreamIdxArray;
227 private int[] mSurfaceIdxArray;
228
229 private static final ArraySet<Surface> mEmptySurfaceSet = new ArraySet<Surface>();
230
Emilian Peev2100ae72018-01-12 16:56:25 +0000231 private String mLogicalCameraId;
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100232 @UnsupportedAppUsage
Emilian Peev2100ae72018-01-12 16:56:25 +0000233 private CameraMetadataNative mLogicalCameraSettings;
234 private final HashMap<String, CameraMetadataNative> mPhysicalCameraSettings =
235 new HashMap<String, CameraMetadataNative>();
236
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700237 private boolean mIsReprocess;
Zhijun Hea7677722015-06-01 16:36:06 -0700238 // If this request is part of constrained high speed request list that was created by
Eino-Ville Talvala639fffe2015-06-30 10:34:48 -0700239 // {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}
Zhijun Hea7677722015-06-01 16:36:06 -0700240 private boolean mIsPartOfCHSRequestList = false;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700241 // Each reprocess request must be tied to a reprocessable session ID.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700242 // Valid only for reprocess requests (mIsReprocess == true).
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700243 private int mReprocessableSessionId;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700244
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700245 private Object mUserTag;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800246
247 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700248 * Construct empty request.
249 *
250 * Used by Binder to unparcel this object only.
Igor Murashkin70725502013-06-25 20:27:06 +0000251 */
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700252 private CaptureRequest() {
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700253 mIsReprocess = false;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700254 mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800255 }
256
257 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700258 * Clone from source capture request.
259 *
260 * Used by the Builder to create an immutable copy.
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800261 */
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700262 @SuppressWarnings("unchecked")
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700263 private CaptureRequest(CaptureRequest source) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000264 mLogicalCameraId = new String(source.mLogicalCameraId);
265 for (Map.Entry<String, CameraMetadataNative> entry :
266 source.mPhysicalCameraSettings.entrySet()) {
267 mPhysicalCameraSettings.put(new String(entry.getKey()),
268 new CameraMetadataNative(entry.getValue()));
269 }
270 mLogicalCameraSettings = mPhysicalCameraSettings.get(mLogicalCameraId);
271 setNativeInstance(mLogicalCameraSettings);
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800272 mSurfaceSet.addAll(source.mSurfaceSet);
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700273 mIsReprocess = source.mIsReprocess;
Zhijun Hea7677722015-06-01 16:36:06 -0700274 mIsPartOfCHSRequestList = source.mIsPartOfCHSRequestList;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700275 mReprocessableSessionId = source.mReprocessableSessionId;
Eino-Ville Talvala7b01c5c2013-10-08 19:34:29 -0700276 mUserTag = source.mUserTag;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800277 }
278
279 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700280 * Take ownership of passed-in settings.
281 *
282 * Used by the Builder to create a mutable CaptureRequest.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700283 *
284 * @param settings Settings for this capture request.
285 * @param isReprocess Indicates whether to create a reprocess capture request. {@code true}
286 * to create a reprocess capture request. {@code false} to create a regular
287 * capture request.
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700288 * @param reprocessableSessionId The ID of the camera capture session this capture is created
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700289 * for. This is used to validate if the application submits a
290 * reprocess capture request to the same session where
291 * the {@link TotalCaptureResult}, used to create the reprocess
292 * capture, came from.
Emilian Peev2100ae72018-01-12 16:56:25 +0000293 * @param logicalCameraId Camera Id of the actively open camera that instantiates the
294 * Builder.
295 *
296 * @param physicalCameraIdSet A set of physical camera ids that can be used to customize
297 * the request for a specific physical camera.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700298 *
299 * @throws IllegalArgumentException If creating a reprocess capture request with an invalid
Emilian Peev2100ae72018-01-12 16:56:25 +0000300 * reprocessableSessionId, or multiple physical cameras.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700301 *
302 * @see CameraDevice#createReprocessCaptureRequest
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800303 */
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700304 private CaptureRequest(CameraMetadataNative settings, boolean isReprocess,
Emilian Peev2100ae72018-01-12 16:56:25 +0000305 int reprocessableSessionId, String logicalCameraId, Set<String> physicalCameraIdSet) {
306 if ((physicalCameraIdSet != null) && isReprocess) {
307 throw new IllegalArgumentException("Create a reprocess capture request with " +
308 "with more than one physical camera is not supported!");
309 }
310
311 mLogicalCameraId = logicalCameraId;
312 mLogicalCameraSettings = CameraMetadataNative.move(settings);
313 mPhysicalCameraSettings.put(mLogicalCameraId, mLogicalCameraSettings);
314 if (physicalCameraIdSet != null) {
315 for (String physicalId : physicalCameraIdSet) {
316 mPhysicalCameraSettings.put(physicalId, new CameraMetadataNative(
317 mLogicalCameraSettings));
318 }
319 }
320
321 setNativeInstance(mLogicalCameraSettings);
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700322 mIsReprocess = isReprocess;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700323 if (isReprocess) {
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700324 if (reprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) {
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700325 throw new IllegalArgumentException("Create a reprocess capture request with an " +
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700326 "invalid session ID: " + reprocessableSessionId);
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700327 }
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700328 mReprocessableSessionId = reprocessableSessionId;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700329 } else {
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700330 mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700331 }
Igor Murashkin70725502013-06-25 20:27:06 +0000332 }
333
Igor Murashkind6d65152014-05-19 16:31:02 -0700334 /**
335 * Get a capture request field value.
336 *
337 * <p>The field definitions can be found in {@link CaptureRequest}.</p>
338 *
339 * <p>Querying the value for the same key more than once will return a value
340 * which is equal to the previous queried value.</p>
341 *
342 * @throws IllegalArgumentException if the key was not valid
343 *
344 * @param key The result field to read.
345 * @return The value of that key, or {@code null} if the field is not set.
346 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700347 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700348 public <T> T get(Key<T> key) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000349 return mLogicalCameraSettings.get(key);
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700350 }
351
352 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700353 * {@inheritDoc}
354 * @hide
355 */
356 @SuppressWarnings("unchecked")
357 @Override
358 protected <T> T getProtected(Key<?> key) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000359 return (T) mLogicalCameraSettings.get(key);
Igor Murashkind6d65152014-05-19 16:31:02 -0700360 }
361
362 /**
363 * {@inheritDoc}
364 * @hide
365 */
366 @SuppressWarnings("unchecked")
367 @Override
368 protected Class<Key<?>> getKeyClass() {
369 Object thisClass = Key.class;
370 return (Class<Key<?>>)thisClass;
371 }
372
373 /**
374 * {@inheritDoc}
375 */
376 @Override
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700377 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700378 public List<Key<?>> getKeys() {
379 // Force the javadoc for this function to show up on the CaptureRequest page
380 return super.getKeys();
381 }
382
383 /**
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700384 * Retrieve the tag for this request, if any.
385 *
386 * <p>This tag is not used for anything by the camera device, but can be
387 * used by an application to easily identify a CaptureRequest when it is
388 * returned by
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700389 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700390 * </p>
391 *
392 * @return the last tag Object set on this request, or {@code null} if
393 * no tag has been set.
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700394 * @see Builder#setTag
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700395 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700396 @Nullable
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700397 public Object getTag() {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700398 return mUserTag;
Eino-Ville Talvala40683882013-08-08 16:56:28 -0700399 }
400
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700401 /**
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700402 * Determine if this is a reprocess capture request.
403 *
404 * <p>A reprocess capture request produces output images from an input buffer from the
405 * {@link CameraCaptureSession}'s input {@link Surface}. A reprocess capture request can be
406 * created by {@link CameraDevice#createReprocessCaptureRequest}.</p>
407 *
408 * @return {@code true} if this is a reprocess capture request. {@code false} if this is not a
409 * reprocess capture request.
410 *
411 * @see CameraDevice#createReprocessCaptureRequest
412 */
413 public boolean isReprocess() {
414 return mIsReprocess;
415 }
416
417 /**
Zhijun Hea7677722015-06-01 16:36:06 -0700418 * <p>Determine if this request is part of a constrained high speed request list that was
Eino-Ville Talvala639fffe2015-06-30 10:34:48 -0700419 * created by
420 * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}.
421 * A constrained high speed request list contains some constrained high speed capture requests
422 * with certain interleaved pattern that is suitable for high speed preview/video streaming. An
423 * active constrained high speed capture session only accepts constrained high speed request
424 * lists. This method can be used to do the sanity check when a constrained high speed capture
425 * session receives a request list via {@link CameraCaptureSession#setRepeatingBurst} or
426 * {@link CameraCaptureSession#captureBurst}. </p>
Zhijun Hea7677722015-06-01 16:36:06 -0700427 *
428 *
429 * @return {@code true} if this request is part of a constrained high speed request list,
430 * {@code false} otherwise.
431 *
432 * @hide
433 */
434 public boolean isPartOfCRequestList() {
435 return mIsPartOfCHSRequestList;
436 }
437
438 /**
439 * Returns a copy of the underlying {@link CameraMetadataNative}.
440 * @hide
441 */
442 public CameraMetadataNative getNativeCopy() {
Emilian Peev2100ae72018-01-12 16:56:25 +0000443 return new CameraMetadataNative(mLogicalCameraSettings);
Zhijun Hea7677722015-06-01 16:36:06 -0700444 }
445
446 /**
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700447 * Get the reprocessable session ID this reprocess capture request is associated with.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700448 *
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700449 * @return the reprocessable session ID this reprocess capture request is associated with
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700450 *
451 * @throws IllegalStateException if this capture request is not a reprocess capture request.
452 * @hide
453 */
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700454 public int getReprocessableSessionId() {
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700455 if (mIsReprocess == false ||
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700456 mReprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) {
457 throw new IllegalStateException("Getting the reprocessable session ID for a "+
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700458 "non-reprocess capture request is illegal.");
459 }
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700460 return mReprocessableSessionId;
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700461 }
462
463 /**
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700464 * Determine whether this CaptureRequest is equal to another CaptureRequest.
465 *
466 * <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 -0700467 * list of output surfaces is equal, the user tag is equal, and the return values of
468 * isReprocess() are equal.</p>
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700469 *
470 * @param other Another instance of CaptureRequest.
471 *
472 * @return True if the requests are the same, false otherwise.
473 */
474 @Override
475 public boolean equals(Object other) {
476 return other instanceof CaptureRequest
477 && equals((CaptureRequest)other);
478 }
479
480 private boolean equals(CaptureRequest other) {
481 return other != null
482 && Objects.equals(mUserTag, other.mUserTag)
483 && mSurfaceSet.equals(other.mSurfaceSet)
Emilian Peev2100ae72018-01-12 16:56:25 +0000484 && mPhysicalCameraSettings.equals(other.mPhysicalCameraSettings)
485 && mLogicalCameraId.equals(other.mLogicalCameraId)
486 && mLogicalCameraSettings.equals(other.mLogicalCameraSettings)
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700487 && mIsReprocess == other.mIsReprocess
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700488 && mReprocessableSessionId == other.mReprocessableSessionId;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700489 }
490
491 @Override
492 public int hashCode() {
Emilian Peev2100ae72018-01-12 16:56:25 +0000493 return HashCodeHelpers.hashCodeGeneric(mPhysicalCameraSettings, mSurfaceSet, mUserTag);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700494 }
495
Jeff Sharkey9e8f83d2019-02-28 12:06:45 -0700496 public static final @android.annotation.NonNull Parcelable.Creator<CaptureRequest> CREATOR =
Igor Murashkin70725502013-06-25 20:27:06 +0000497 new Parcelable.Creator<CaptureRequest>() {
498 @Override
499 public CaptureRequest createFromParcel(Parcel in) {
500 CaptureRequest request = new CaptureRequest();
501 request.readFromParcel(in);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700502
Igor Murashkin70725502013-06-25 20:27:06 +0000503 return request;
504 }
505
506 @Override
507 public CaptureRequest[] newArray(int size) {
508 return new CaptureRequest[size];
509 }
510 };
511
512 /**
513 * Expand this object from a Parcel.
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700514 * Hidden since this breaks the immutability of CaptureRequest, but is
515 * needed to receive CaptureRequests with aidl.
516 *
Igor Murashkin70725502013-06-25 20:27:06 +0000517 * @param in The parcel from which the object should be read
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700518 * @hide
Igor Murashkin70725502013-06-25 20:27:06 +0000519 */
Igor Murashkin72f9f0a2014-05-14 15:46:10 -0700520 private void readFromParcel(Parcel in) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000521 int physicalCameraCount = in.readInt();
522 if (physicalCameraCount <= 0) {
523 throw new RuntimeException("Physical camera count" + physicalCameraCount +
524 " should always be positive");
525 }
526
527 //Always start with the logical camera id
528 mLogicalCameraId = in.readString();
529 mLogicalCameraSettings = new CameraMetadataNative();
530 mLogicalCameraSettings.readFromParcel(in);
531 setNativeInstance(mLogicalCameraSettings);
532 mPhysicalCameraSettings.put(mLogicalCameraId, mLogicalCameraSettings);
533 for (int i = 1; i < physicalCameraCount; i++) {
534 String physicalId = in.readString();
535 CameraMetadataNative physicalCameraSettings = new CameraMetadataNative();
536 physicalCameraSettings.readFromParcel(in);
537 mPhysicalCameraSettings.put(physicalId, physicalCameraSettings);
538 }
539
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700540 mIsReprocess = (in.readInt() == 0) ? false : true;
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700541 mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800542
543 synchronized (mSurfacesLock) {
544 mSurfaceSet.clear();
545 Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader());
546 if (parcelableArray != null) {
547 for (Parcelable p : parcelableArray) {
548 Surface s = (Surface) p;
549 mSurfaceSet.add(s);
550 }
551 }
552 // Intentionally disallow java side readFromParcel to receive streamIdx/surfaceIdx
553 // Since there is no good way to convert indexes back to Surface
554 int streamSurfaceSize = in.readInt();
555 if (streamSurfaceSize != 0) {
556 throw new RuntimeException("Reading cached CaptureRequest is not supported");
557 }
558 }
Igor Murashkin70725502013-06-25 20:27:06 +0000559 }
560
561 @Override
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700562 public int describeContents() {
563 return 0;
564 }
Igor Murashkin70725502013-06-25 20:27:06 +0000565
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700566 @Override
567 public void writeToParcel(Parcel dest, int flags) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000568 int physicalCameraCount = mPhysicalCameraSettings.size();
569 dest.writeInt(physicalCameraCount);
570 //Logical camera id and settings always come first.
571 dest.writeString(mLogicalCameraId);
572 mLogicalCameraSettings.writeToParcel(dest, flags);
573 for (Map.Entry<String, CameraMetadataNative> entry : mPhysicalCameraSettings.entrySet()) {
574 if (entry.getKey().equals(mLogicalCameraId)) {
575 continue;
576 }
577 dest.writeString(entry.getKey());
578 entry.getValue().writeToParcel(dest, flags);
579 }
580
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700581 dest.writeInt(mIsReprocess ? 1 : 0);
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800582
583 synchronized (mSurfacesLock) {
584 final ArraySet<Surface> surfaces = mSurfaceConverted ? mEmptySurfaceSet : mSurfaceSet;
585 dest.writeParcelableArray(surfaces.toArray(new Surface[surfaces.size()]), flags);
586 if (mSurfaceConverted) {
587 dest.writeInt(mStreamIdxArray.length);
588 for (int i = 0; i < mStreamIdxArray.length; i++) {
589 dest.writeInt(mStreamIdxArray[i]);
590 dest.writeInt(mSurfaceIdxArray[i]);
591 }
592 } else {
593 dest.writeInt(0);
594 }
595 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700596 }
597
598 /**
Ruben Brunkfeb50af2014-05-09 19:58:49 -0700599 * @hide
600 */
601 public boolean containsTarget(Surface surface) {
602 return mSurfaceSet.contains(surface);
603 }
604
605 /**
606 * @hide
607 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100608 @UnsupportedAppUsage
Ruben Brunkfeb50af2014-05-09 19:58:49 -0700609 public Collection<Surface> getTargets() {
610 return Collections.unmodifiableCollection(mSurfaceSet);
611 }
612
613 /**
Emilian Peev2100ae72018-01-12 16:56:25 +0000614 * Retrieves the logical camera id.
615 * @hide
616 */
617 public String getLogicalCameraId() {
618 return mLogicalCameraId;
619 }
620
621 /**
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800622 * @hide
623 */
624 public void convertSurfaceToStreamId(
625 final SparseArray<OutputConfiguration> configuredOutputs) {
626 synchronized (mSurfacesLock) {
627 if (mSurfaceConverted) {
628 Log.v(TAG, "Cannot convert already converted surfaces!");
629 return;
630 }
631
632 mStreamIdxArray = new int[mSurfaceSet.size()];
633 mSurfaceIdxArray = new int[mSurfaceSet.size()];
634 int i = 0;
635 for (Surface s : mSurfaceSet) {
636 boolean streamFound = false;
637 for (int j = 0; j < configuredOutputs.size(); ++j) {
638 int streamId = configuredOutputs.keyAt(j);
639 OutputConfiguration outConfig = configuredOutputs.valueAt(j);
640 int surfaceId = 0;
641 for (Surface outSurface : outConfig.getSurfaces()) {
642 if (s == outSurface) {
643 streamFound = true;
644 mStreamIdxArray[i] = streamId;
645 mSurfaceIdxArray[i] = surfaceId;
646 i++;
647 break;
648 }
649 surfaceId++;
650 }
651 if (streamFound) {
652 break;
653 }
654 }
Yin-Chia Yeh4f151472018-02-21 12:38:19 -0800655
656 if (!streamFound) {
657 // Check if we can match s by native object ID
658 long reqSurfaceId = SurfaceUtils.getSurfaceId(s);
659 for (int j = 0; j < configuredOutputs.size(); ++j) {
660 int streamId = configuredOutputs.keyAt(j);
661 OutputConfiguration outConfig = configuredOutputs.valueAt(j);
662 int surfaceId = 0;
663 for (Surface outSurface : outConfig.getSurfaces()) {
664 if (reqSurfaceId == SurfaceUtils.getSurfaceId(outSurface)) {
665 streamFound = true;
666 mStreamIdxArray[i] = streamId;
667 mSurfaceIdxArray[i] = surfaceId;
668 i++;
669 break;
670 }
671 surfaceId++;
672 }
673 if (streamFound) {
674 break;
675 }
676 }
677 }
678
Yin-Chia Yehc60af902017-11-10 20:02:29 -0800679 if (!streamFound) {
680 mStreamIdxArray = null;
681 mSurfaceIdxArray = null;
682 throw new IllegalArgumentException(
683 "CaptureRequest contains unconfigured Input/Output Surface!");
684 }
685 }
686 mSurfaceConverted = true;
687 }
688 }
689
690 /**
691 * @hide
692 */
693 public void recoverStreamIdToSurface() {
694 synchronized (mSurfacesLock) {
695 if (!mSurfaceConverted) {
696 Log.v(TAG, "Cannot convert already converted surfaces!");
697 return;
698 }
699
700 mStreamIdxArray = null;
701 mSurfaceIdxArray = null;
702 mSurfaceConverted = false;
703 }
704 }
705
706 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700707 * A builder for capture requests.
708 *
709 * <p>To obtain a builder instance, use the
710 * {@link CameraDevice#createCaptureRequest} method, which initializes the
711 * request fields to one of the templates defined in {@link CameraDevice}.
712 *
713 * @see CameraDevice#createCaptureRequest
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700714 * @see CameraDevice#TEMPLATE_PREVIEW
715 * @see CameraDevice#TEMPLATE_RECORD
716 * @see CameraDevice#TEMPLATE_STILL_CAPTURE
717 * @see CameraDevice#TEMPLATE_VIDEO_SNAPSHOT
718 * @see CameraDevice#TEMPLATE_MANUAL
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700719 */
720 public final static class Builder {
721
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700722 private final CaptureRequest mRequest;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700723
724 /**
725 * Initialize the builder using the template; the request takes
726 * ownership of the template.
727 *
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700728 * @param template Template settings for this capture request.
729 * @param reprocess Indicates whether to create a reprocess capture request. {@code true}
730 * to create a reprocess capture request. {@code false} to create a regular
731 * capture request.
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700732 * @param reprocessableSessionId The ID of the camera capture session this capture is
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700733 * created for. This is used to validate if the application
734 * submits a reprocess capture request to the same session
735 * where the {@link TotalCaptureResult}, used to create the
736 * reprocess capture, came from.
Emilian Peev2100ae72018-01-12 16:56:25 +0000737 * @param logicalCameraId Camera Id of the actively open camera that instantiates the
738 * Builder.
739 * @param physicalCameraIdSet A set of physical camera ids that can be used to customize
740 * the request for a specific physical camera.
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700741 *
742 * @throws IllegalArgumentException If creating a reprocess capture request with an invalid
Chien-Yu Chen8062d312015-05-12 14:24:10 -0700743 * reprocessableSessionId.
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700744 * @hide
745 */
Chien-Yu Chen7a316f6b2015-04-13 14:31:45 -0700746 public Builder(CameraMetadataNative template, boolean reprocess,
Emilian Peev2100ae72018-01-12 16:56:25 +0000747 int reprocessableSessionId, String logicalCameraId,
748 Set<String> physicalCameraIdSet) {
749 mRequest = new CaptureRequest(template, reprocess, reprocessableSessionId,
750 logicalCameraId, physicalCameraIdSet);
Igor Murashkin70725502013-06-25 20:27:06 +0000751 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700752
753 /**
754 * <p>Add a surface to the list of targets for this request</p>
755 *
756 * <p>The Surface added must be one of the surfaces included in the most
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700757 * recent call to {@link CameraDevice#createCaptureSession}, when the
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700758 * request is given to the camera device.</p>
759 *
760 * <p>Adding a target more than once has no effect.</p>
761 *
762 * @param outputTarget Surface to use as an output target for this request
763 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700764 public void addTarget(@NonNull Surface outputTarget) {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700765 mRequest.mSurfaceSet.add(outputTarget);
766 }
767
768 /**
769 * <p>Remove a surface from the list of targets for this request.</p>
770 *
771 * <p>Removing a target that is not currently added has no effect.</p>
772 *
773 * @param outputTarget Surface to use as an output target for this request
774 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700775 public void removeTarget(@NonNull Surface outputTarget) {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700776 mRequest.mSurfaceSet.remove(outputTarget);
777 }
778
779 /**
780 * Set a capture request field to a value. The field definitions can be
781 * found in {@link CaptureRequest}.
782 *
Eino-Ville Talvalad8407272015-11-08 18:27:20 -0800783 * <p>Setting a field to {@code null} will remove that field from the capture request.
784 * Unless the field is optional, removing it will likely produce an error from the camera
785 * device when the request is submitted.</p>
786 *
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700787 * @param key The metadata field to write.
788 * @param value The value to set the field to, which must be of a matching
789 * type to the key.
790 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700791 public <T> void set(@NonNull Key<T> key, T value) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000792 mRequest.mLogicalCameraSettings.set(key, value);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700793 }
794
795 /**
796 * Get a capture request field value. The field definitions can be
797 * found in {@link CaptureRequest}.
798 *
799 * @throws IllegalArgumentException if the key was not valid
800 *
801 * @param key The metadata field to read.
802 * @return The value of that key, or {@code null} if the field is not set.
803 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700804 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700805 public <T> T get(Key<T> key) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000806 return mRequest.mLogicalCameraSettings.get(key);
807 }
808
809 /**
810 * Set a capture request field to a value. The field definitions can be
811 * found in {@link CaptureRequest}.
812 *
813 * <p>Setting a field to {@code null} will remove that field from the capture request.
814 * Unless the field is optional, removing it will likely produce an error from the camera
815 * device when the request is submitted.</p>
816 *
817 *<p>This method can be called for logical camera devices, which are devices that have
818 * REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA capability and calls to
Shuzhen Wangbde13972018-03-19 10:30:45 -0700819 * {@link CameraCharacteristics#getPhysicalCameraIds} return a non-empty set of
Emilian Peev2100ae72018-01-12 16:56:25 +0000820 * physical devices that are backing the logical camera. The camera Id included in the
821 * 'physicalCameraId' argument selects an individual physical device that will receive
822 * the customized capture request field.</p>
823 *
824 * @throws IllegalArgumentException if the physical camera id is not valid
825 *
826 * @param key The metadata field to write.
827 * @param value The value to set the field to, which must be of a matching
828 * @param physicalCameraId A valid physical camera Id. The valid camera Ids can be obtained
829 * via calls to {@link CameraCharacteristics#getPhysicalCameraIds}.
830 * @return The builder object.
831 * type to the key.
832 */
833 public <T> Builder setPhysicalCameraKey(@NonNull Key<T> key, T value,
834 @NonNull String physicalCameraId) {
835 if (!mRequest.mPhysicalCameraSettings.containsKey(physicalCameraId)) {
836 throw new IllegalArgumentException("Physical camera id: " + physicalCameraId +
837 " is not valid!");
838 }
839
840 mRequest.mPhysicalCameraSettings.get(physicalCameraId).set(key, value);
841
842 return this;
843 }
844
845 /**
846 * Get a capture request field value for a specific physical camera Id. The field
847 * definitions can be found in {@link CaptureRequest}.
848 *
849 *<p>This method can be called for logical camera devices, which are devices that have
850 * REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA capability and calls to
851 * {@link CameraCharacteristics#getPhysicalCameraIds} return a non-empty list of
852 * physical devices that are backing the logical camera. The camera Id included in the
853 * 'physicalCameraId' argument selects an individual physical device and returns
854 * its specific capture request field.</p>
855 *
856 * @throws IllegalArgumentException if the key or physical camera id were not valid
857 *
858 * @param key The metadata field to read.
859 * @param physicalCameraId A valid physical camera Id. The valid camera Ids can be obtained
860 * via calls to {@link CameraCharacteristics#getPhysicalCameraIds}.
861 * @return The value of that key, or {@code null} if the field is not set.
862 */
863 @Nullable
864 public <T> T getPhysicalCameraKey(Key<T> key,@NonNull String physicalCameraId) {
865 if (!mRequest.mPhysicalCameraSettings.containsKey(physicalCameraId)) {
866 throw new IllegalArgumentException("Physical camera id: " + physicalCameraId +
867 " is not valid!");
868 }
869
870 return mRequest.mPhysicalCameraSettings.get(physicalCameraId).get(key);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700871 }
872
873 /**
874 * Set a tag for this request.
875 *
876 * <p>This tag is not used for anything by the camera device, but can be
877 * used by an application to easily identify a CaptureRequest when it is
878 * returned by
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700879 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700880 *
881 * @param tag an arbitrary Object to store with this request
882 * @see CaptureRequest#getTag
883 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700884 public void setTag(@Nullable Object tag) {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700885 mRequest.mUserTag = tag;
886 }
887
888 /**
Zhijun Hea7677722015-06-01 16:36:06 -0700889 * <p>Mark this request as part of a constrained high speed request list created by
Eino-Ville Talvala639fffe2015-06-30 10:34:48 -0700890 * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}.
891 * A constrained high speed request list contains some constrained high speed capture
892 * requests with certain interleaved pattern that is suitable for high speed preview/video
893 * streaming.</p>
Zhijun Hea7677722015-06-01 16:36:06 -0700894 *
895 * @hide
896 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100897 @UnsupportedAppUsage
Zhijun Hea7677722015-06-01 16:36:06 -0700898 public void setPartOfCHSRequestList(boolean partOfCHSList) {
899 mRequest.mIsPartOfCHSRequestList = partOfCHSList;
900 }
901
902 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700903 * Build a request using the current target Surfaces and settings.
Sol Boucheredeab402014-07-09 18:36:28 -0700904 * <p>Note that, although it is possible to create a {@code CaptureRequest} with no target
905 * {@link Surface}s, passing such a request into {@link CameraCaptureSession#capture},
906 * {@link CameraCaptureSession#captureBurst},
907 * {@link CameraCaptureSession#setRepeatingBurst}, or
908 * {@link CameraCaptureSession#setRepeatingRequest} will cause that method to throw an
909 * {@link IllegalArgumentException}.</p>
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700910 *
911 * @return A new capture request instance, ready for submission to the
912 * camera device.
913 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700914 @NonNull
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700915 public CaptureRequest build() {
916 return new CaptureRequest(mRequest);
917 }
918
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700919 /**
920 * @hide
921 */
922 public boolean isEmpty() {
Emilian Peev2100ae72018-01-12 16:56:25 +0000923 return mRequest.mLogicalCameraSettings.isEmpty();
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700924 }
925
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800926 }
927
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700928 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
929 * The key entries below this point are generated from metadata
930 * definitions in /system/media/camera/docs. Do not modify by hand or
931 * modify the comment blocks at the start or end.
932 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
933
934 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800935 * <p>The mode control selects how the image data is converted from the
936 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700937 * <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 -0800938 * control is overridden by the AWB routine. When AWB is disabled, the
939 * application controls how the color mapping is performed.</p>
940 * <p>We define the expected processing pipeline below. For consistency
941 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
942 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
943 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
944 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
945 * camera device (in the results) and be roughly correct.</p>
946 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
947 * FAST or HIGH_QUALITY will yield a picture with the same white point
948 * as what was produced by the camera device in the earlier frame.</p>
949 * <p>The expected processing pipeline is as follows:</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -0800950 * <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 -0800951 * <p>The white balance is encoded by two values, a 4-channel white-balance
952 * gain vector (applied in the Bayer domain), and a 3x3 color transform
953 * matrix (applied after demosaic).</p>
954 * <p>The 4-channel white-balance gains are defined as:</p>
955 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
956 * </code></pre>
957 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
958 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
959 * These may be identical for a given camera device implementation; if
960 * the camera device does not support a separate gain for even/odd green
961 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
962 * <code>G_even</code> in the output result metadata.</p>
963 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
964 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
965 * </code></pre>
966 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
967 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
968 * <p>with colors as follows:</p>
969 * <pre><code>r' = I0r + I1g + I2b
970 * g' = I3r + I4g + I5b
971 * b' = I6r + I7g + I8b
972 * </code></pre>
973 * <p>Both the input and output value ranges must match. Overflow/underflow
974 * values are clipped to fit within the range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700975 * <p><b>Possible values:</b>
976 * <ul>
977 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
978 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
979 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
980 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800981 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700982 * <p><b>Full capability</b> -
983 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
984 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800985 *
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800986 * @see CaptureRequest#COLOR_CORRECTION_GAINS
987 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800988 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700989 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700990 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
991 * @see #COLOR_CORRECTION_MODE_FAST
992 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
993 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700994 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800995 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700996 public static final Key<Integer> COLOR_CORRECTION_MODE =
997 new Key<Integer>("android.colorCorrection.mode", int.class);
998
999 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001000 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001001 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -08001002 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001003 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001004 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001005 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -08001006 * <p>In the latter case, the camera device may round the matrix to account
1007 * for precision issues; the final rounded matrix should be reported back
1008 * in this matrix result metadata. The transform should keep the magnitude
1009 * of the output color values within <code>[0, 1.0]</code> (assuming input color
1010 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001011 * <p>The valid range of each matrix element varies on different devices, but
1012 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001013 * <p><b>Units</b>: Unitless scale factors</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001014 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001015 * <p><b>Full capability</b> -
1016 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1017 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001018 *
1019 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001020 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001021 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001022 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001023 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001024 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
1025 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001026
1027 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -08001028 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -08001029 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001030 * <p>These per-channel gains are either set by the camera device
1031 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
1032 * TRANSFORM_MATRIX, or directly by the application in the
1033 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
1034 * TRANSFORM_MATRIX.</p>
1035 * <p>The gains in the result metadata are the gains actually
1036 * applied by the camera device to the current frame.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001037 * <p>The valid range of gains varies on different devices, but gains
1038 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
1039 * device allows gains below 1.0, this is usually not recommended because
1040 * this can create color artifacts.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001041 * <p><b>Units</b>: Unitless gain factors</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001042 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001043 * <p><b>Full capability</b> -
1044 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1045 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001046 *
1047 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001048 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001049 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001050 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001051 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001052 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
1053 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001054
1055 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -07001056 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -07001057 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
1058 * can not focus on the same point after exiting from the lens. This metadata defines
1059 * the high level control of chromatic aberration correction algorithm, which aims to
1060 * minimize the chromatic artifacts that may occur along the object boundaries in an
1061 * image.</p>
1062 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
1063 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
1064 * use the highest-quality aberration correction algorithms, even if it slows down
1065 * capture rate. FAST means the camera device will not slow down capture rate when
1066 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001067 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001068 * <p><b>Possible values:</b>
1069 * <ul>
1070 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
1071 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
1072 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
1073 * </ul></p>
1074 * <p><b>Available values for this device:</b><br>
1075 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001076 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -07001077 *
Zhijun He9e4e4392014-08-18 11:12:32 -07001078 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
1079 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
1080 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
1081 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -07001082 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001083 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001084 @NonNull
Zhijun He9e4e4392014-08-18 11:12:32 -07001085 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
1086 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -07001087
1088 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001089 * <p>The desired setting for the camera device's auto-exposure
1090 * algorithm's antibanding compensation.</p>
1091 * <p>Some kinds of lighting fixtures, such as some fluorescent
1092 * lights, flicker at the rate of the power supply frequency
1093 * (60Hz or 50Hz, depending on country). While this is
1094 * typically not noticeable to a person, it can be visible to
1095 * a camera device. If a camera sets its exposure time to the
1096 * wrong value, the flicker may become visible in the
1097 * viewfinder as flicker or in a final captured image, as a
1098 * set of variable-brightness bands across the image.</p>
1099 * <p>Therefore, the auto-exposure routines of camera devices
1100 * include antibanding routines that ensure that the chosen
1101 * exposure value will not cause such banding. The choice of
1102 * exposure time depends on the rate of flicker, which the
1103 * camera device can detect automatically, or the expected
1104 * rate can be selected by the application using this
1105 * control.</p>
1106 * <p>A given camera device may not support all of the possible
1107 * options for the antibanding mode. The
1108 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
1109 * the available modes for a given camera device.</p>
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -08001110 * <p>AUTO mode is the default if it is available on given
1111 * camera device. When AUTO mode is not available, the
1112 * default will be either 50HZ or 60HZ, and both 50HZ
1113 * and 60HZ will be available.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001114 * <p>If manual exposure control is enabled (by setting
1115 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
1116 * then this setting has no effect, and the application must
1117 * ensure it selects exposure times that do not cause banding
1118 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
1119 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001120 * <p><b>Possible values:</b>
1121 * <ul>
1122 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
1123 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
1124 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
1125 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
1126 * </ul></p>
1127 * <p><b>Available values for this device:</b><br></p>
1128 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001129 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001130 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08001131 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
Zhijun He399f05d2014-01-15 11:31:30 -08001132 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001133 * @see CaptureRequest#CONTROL_MODE
1134 * @see CaptureResult#STATISTICS_SCENE_FLICKER
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001135 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
1136 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
1137 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
1138 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
1139 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001140 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001141 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001142 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
1143 new Key<Integer>("android.control.aeAntibandingMode", int.class);
1144
1145 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001146 * <p>Adjustment to auto-exposure (AE) target image
1147 * brightness.</p>
1148 * <p>The adjustment is measured as a count of steps, with the
1149 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
1150 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
1151 * <p>For example, if the exposure value (EV) step is 0.333, '6'
1152 * will mean an exposure compensation of +2 EV; -3 will mean an
1153 * exposure compensation of -1 EV. One EV represents a doubling
1154 * of image brightness. Note that this control will only be
1155 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
1156 * 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 -07001157 * <p>In the event of exposure compensation value being changed, camera device
1158 * may take several frames to reach the newly requested exposure target.
1159 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
1160 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
1161 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
1162 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001163 * <p><b>Units</b>: Compensation steps</p>
1164 * <p><b>Range of valid values:</b><br>
1165 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001166 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -07001167 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001168 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
1169 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -07001170 * @see CaptureRequest#CONTROL_AE_LOCK
1171 * @see CaptureRequest#CONTROL_AE_MODE
1172 * @see CaptureResult#CONTROL_AE_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001173 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001174 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001175 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001176 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
1177 new Key<Integer>("android.control.aeExposureCompensation", int.class);
1178
1179 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001180 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He49a3ca92014-02-05 13:48:09 -08001181 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001182 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
1183 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
1184 * <p>Note that even when AE is locked, the flash may be fired if
1185 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
1186 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -07001187 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
1188 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -08001189 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
1190 * when AE is already locked, the camera device will not change the exposure time
1191 * ({@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 -08001192 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
Zhijun He49a3ca92014-02-05 13:48:09 -08001193 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
Zhijun Hefa95b042015-02-09 10:40:49 -08001194 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
1195 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
1196 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
1197 * the AE if AE is locked by the camera device internally during precapture metering
1198 * sequence In other words, submitting requests with AE unlock has no effect for an
1199 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
1200 * will never succeed in a sequence of preview requests where AE lock is always set
1201 * to <code>false</code>.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001202 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1203 * get locked do not necessarily correspond to the settings that were present in the
1204 * latest capture result received from the camera device, since additional captures
1205 * and AE updates may have occurred even before the result was sent out. If an
1206 * application is switching between automatic and manual control and wishes to eliminate
1207 * any flicker during the switch, the following procedure is recommended:</p>
1208 * <ol>
1209 * <li>Starting in auto-AE mode:</li>
1210 * <li>Lock AE</li>
1211 * <li>Wait for the first result to be output that has the AE locked</li>
1212 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
1213 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
1214 * </ol>
Zhijun He49a3ca92014-02-05 13:48:09 -08001215 * <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 -07001216 * <p>This key is available on all devices.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -08001217 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -07001218 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He49a3ca92014-02-05 13:48:09 -08001219 * @see CaptureRequest#CONTROL_AE_MODE
1220 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1221 * @see CaptureResult#CONTROL_AE_STATE
1222 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
1223 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001224 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001225 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001226 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001227 public static final Key<Boolean> CONTROL_AE_LOCK =
1228 new Key<Boolean>("android.control.aeLock", boolean.class);
1229
1230 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001231 * <p>The desired mode for the camera device's
1232 * auto-exposure routine.</p>
1233 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
1234 * AUTO.</p>
1235 * <p>When set to any of the ON modes, the camera device's
1236 * auto-exposure routine is enabled, overriding the
1237 * application's selected exposure time, sensor sensitivity,
1238 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
1239 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
1240 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
1241 * is selected, the camera device's flash unit controls are
1242 * also overridden.</p>
1243 * <p>The FLASH modes are only available if the camera device
1244 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
1245 * <p>If flash TORCH mode is desired, this field must be set to
1246 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
1247 * <p>When set to any of the ON modes, the values chosen by the
1248 * camera device auto-exposure routine for the overridden
1249 * fields for a given capture will be available in its
1250 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001251 * <p><b>Possible values:</b>
1252 * <ul>
1253 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
1254 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
1255 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
1256 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
1257 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001258 * <li>{@link #CONTROL_AE_MODE_ON_EXTERNAL_FLASH ON_EXTERNAL_FLASH}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001259 * </ul></p>
1260 * <p><b>Available values for this device:</b><br>
1261 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001262 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001263 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001264 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -08001265 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001266 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
1267 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08001268 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
1269 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -08001270 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001271 * @see #CONTROL_AE_MODE_OFF
1272 * @see #CONTROL_AE_MODE_ON
1273 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
1274 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
1275 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
Chien-Yu Chen2cf33572018-01-11 11:35:41 -08001276 * @see #CONTROL_AE_MODE_ON_EXTERNAL_FLASH
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001277 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001278 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001279 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001280 public static final Key<Integer> CONTROL_AE_MODE =
1281 new Key<Integer>("android.control.aeMode", int.class);
1282
1283 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001284 * <p>List of metering areas to use for auto-exposure adjustment.</p>
1285 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001286 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001287 * <p>The maximum number of regions supported by the device is determined by the value
1288 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001289 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1290 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
1291 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001292 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001293 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1294 * active pixel array.</p>
1295 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1296 * system depends on the mode being set.
1297 * When the distortion correction mode is OFF, the coordinate system follows
1298 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
1299 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
1300 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
1301 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
1302 * pixel in the pre-correction active pixel array.
1303 * When the distortion correction mode is not OFF, the coordinate system follows
1304 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
1305 * <code>(0, 0)</code> being the top-left pixel of the active array, and
1306 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1307 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1308 * active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001309 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001310 * for every pixel in the area. This means that a large metering area
1311 * with the same weight as a smaller area will have more effect in
1312 * the metering result. Metering areas can partially overlap and the
1313 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001314 * <p>The weights are relative to weights of other exposure metering regions, so if only one
1315 * region is used, all non-zero weights will have the same effect. A region with 0
1316 * weight is ignored.</p>
1317 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1318 * camera device.</p>
1319 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1320 * capture result metadata, the camera device will ignore the sections outside the crop
1321 * region and output only the intersection rectangle as the metering region in the result
1322 * metadata. If the region is entirely outside the crop region, it will be ignored and
1323 * not reported in the result metadata.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001324 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
1325 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
1326 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001327 * <p><b>Range of valid values:</b><br>
1328 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001329 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1330 * depending on distortion correction capability and mode</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001331 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001332 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001333 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001334 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001335 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001336 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001337 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001338 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001339 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001340 @NonNull
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001341 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
1342 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001343
1344 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001345 * <p>Range over which the auto-exposure routine can
1346 * adjust the capture frame rate to maintain good
1347 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001348 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001349 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
1350 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
1351 * <p><b>Units</b>: Frames per second (FPS)</p>
1352 * <p><b>Range of valid values:</b><br>
1353 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
1354 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001355 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001356 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001357 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001358 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001359 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001360 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001361 @NonNull
Igor Murashkin78712a82014-05-27 18:32:18 -07001362 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
1363 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001364
1365 /**
Zhijun He228f4f92014-01-16 17:22:05 -08001366 * <p>Whether the camera device will trigger a precapture
1367 * metering sequence when it processes this request.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001368 * <p>This entry is normally set to IDLE, or is not
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001369 * included at all in the request settings. When included and
Zhijun Hedd72be52015-02-06 13:49:51 -08001370 * set to START, the camera device will trigger the auto-exposure (AE)
Igor Murashkinace5bf02013-12-10 17:36:40 -08001371 * precapture metering sequence.</p>
Zhijun Hefa95b042015-02-09 10:40:49 -08001372 * <p>When set to CANCEL, the camera device will cancel any active
1373 * precapture metering trigger, and return to its initial AE state.
1374 * If a precapture metering sequence is already completed, and the camera
1375 * device has implicitly locked the AE for subsequent still capture, the
1376 * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -08001377 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001378 * high-quality still capture for final metering decisions to
1379 * be made, and for firing pre-capture flash pulses to estimate
1380 * scene brightness and required final capture flash power, when
1381 * the flash is enabled.</p>
1382 * <p>Normally, this entry should be set to START for only a
1383 * single request, and the application should wait until the
1384 * sequence completes before starting a new one.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -08001385 * <p>When a precapture metering sequence is finished, the camera device
1386 * may lock the auto-exposure routine internally to be able to accurately expose the
1387 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
1388 * For this case, the AE may not resume normal scan if no subsequent still capture is
1389 * submitted. To ensure that the AE routine restarts normal scan, the application should
1390 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
1391 * 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 -08001392 * still capture request after the precapture sequence completes. Alternatively, for
1393 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
1394 * internally locked AE if the application doesn't submit a still capture request after
1395 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
1396 * be used in devices that have earlier API levels.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001397 * <p>The exact effect of auto-exposure (AE) precapture trigger
1398 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001399 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
1400 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001401 * <p>On LEGACY-level devices, the precapture trigger is not supported;
1402 * capturing a high-resolution JPEG image will automatically trigger a
1403 * precapture sequence before the high-resolution capture, including
1404 * potentially firing a pre-capture flash.</p>
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001405 * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}
1406 * simultaneously is allowed. However, since these triggers often require cooperation between
1407 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1408 * focus sweep), the camera device may delay acting on a later trigger until the previous
1409 * trigger has been fully handled. This may lead to longer intervals between the trigger and
1410 * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for
1411 * example.</p>
1412 * <p>If both the precapture and the auto-focus trigger are activated on the same request, then
1413 * the camera device will complete them in the optimal order for that device.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001414 * <p><b>Possible values:</b>
1415 * <ul>
1416 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
1417 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
Zhijun Hefa95b042015-02-09 10:40:49 -08001418 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001419 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001420 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001421 * <p><b>Limited capability</b> -
1422 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1423 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001424 *
Zhijun Hedd72be52015-02-06 13:49:51 -08001425 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He228f4f92014-01-16 17:22:05 -08001426 * @see CaptureResult#CONTROL_AE_STATE
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001427 * @see CaptureRequest#CONTROL_AF_TRIGGER
Zhijun Hedd72be52015-02-06 13:49:51 -08001428 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001429 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001430 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
1431 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
Zhijun Hefa95b042015-02-09 10:40:49 -08001432 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001433 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001434 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001435 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001436 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
1437 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
1438
1439 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001440 * <p>Whether auto-focus (AF) is currently enabled, and what
1441 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001442 * <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 -08001443 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1444 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1445 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1446 * 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 -08001447 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001448 * 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 -07001449 * in result metadata.</p>
1450 * <p><b>Possible values:</b>
1451 * <ul>
1452 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1453 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1454 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1455 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1456 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1457 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1458 * </ul></p>
1459 * <p><b>Available values for this device:</b><br>
1460 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1461 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001462 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001463 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001464 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001465 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001466 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001467 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001468 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001469 * @see #CONTROL_AF_MODE_OFF
1470 * @see #CONTROL_AF_MODE_AUTO
1471 * @see #CONTROL_AF_MODE_MACRO
1472 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1473 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1474 * @see #CONTROL_AF_MODE_EDOF
1475 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001476 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001477 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001478 public static final Key<Integer> CONTROL_AF_MODE =
1479 new Key<Integer>("android.control.afMode", int.class);
1480
1481 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001482 * <p>List of metering areas to use for auto-focus.</p>
1483 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001484 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001485 * <p>The maximum number of focus areas supported by the device is determined by the value
1486 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001487 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1488 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
1489 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001490 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001491 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1492 * active pixel array.</p>
1493 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1494 * system depends on the mode being set.
1495 * When the distortion correction mode is OFF, the coordinate system follows
1496 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
1497 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
1498 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
1499 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
1500 * pixel in the pre-correction active pixel array.
1501 * When the distortion correction mode is not OFF, the coordinate system follows
1502 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
1503 * <code>(0, 0)</code> being the top-left pixel of the active array, and
1504 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1505 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1506 * active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001507 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001508 * for every pixel in the area. This means that a large metering area
1509 * with the same weight as a smaller area will have more effect in
1510 * the metering result. Metering areas can partially overlap and the
1511 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001512 * <p>The weights are relative to weights of other metering regions, so if only one region
1513 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1514 * ignored.</p>
1515 * <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 -08001516 * camera device. The capture result will either be a zero weight region as well, or
1517 * the region selected by the camera device as the focus area of interest.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001518 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1519 * capture result metadata, the camera device will ignore the sections outside the crop
1520 * region and output only the intersection rectangle as the metering region in the result
1521 * metadata. If the region is entirely outside the crop region, it will be ignored and
1522 * not reported in the result metadata.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001523 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
1524 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
1525 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001526 * <p><b>Range of valid values:</b><br>
1527 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001528 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1529 * depending on distortion correction capability and mode</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001530 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001531 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001532 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001533 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001534 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001535 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001536 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001537 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001538 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001539 @NonNull
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001540 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1541 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001542
1543 /**
Zhijun He228f4f92014-01-16 17:22:05 -08001544 * <p>Whether the camera device will trigger autofocus for this request.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001545 * <p>This entry is normally set to IDLE, or is not
1546 * included at all in the request settings.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001547 * <p>When included and set to START, the camera device will trigger the
1548 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1549 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1550 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001551 * <p>Generally, applications should set this entry to START or CANCEL for only a
1552 * single capture, and then return it to IDLE (or not set at all). Specifying
1553 * START for multiple captures in a row means restarting the AF operation over
1554 * and over again.</p>
1555 * <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 -07001556 * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}
1557 * simultaneously is allowed. However, since these triggers often require cooperation between
1558 * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1559 * focus sweep), the camera device may delay acting on a later trigger until the previous
1560 * trigger has been fully handled. This may lead to longer intervals between the trigger and
1561 * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001562 * <p><b>Possible values:</b>
1563 * <ul>
1564 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1565 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1566 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1567 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001568 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001569 *
Eino-Ville Talvalaf8a2f572015-06-24 15:36:38 -07001570 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
Zhijun He228f4f92014-01-16 17:22:05 -08001571 * @see CaptureResult#CONTROL_AF_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001572 * @see #CONTROL_AF_TRIGGER_IDLE
1573 * @see #CONTROL_AF_TRIGGER_START
1574 * @see #CONTROL_AF_TRIGGER_CANCEL
1575 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001576 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001577 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001578 public static final Key<Integer> CONTROL_AF_TRIGGER =
1579 new Key<Integer>("android.control.afTrigger", int.class);
1580
1581 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001582 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He2d5e8972014-02-07 16:13:46 -08001583 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001584 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1585 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1586 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1587 * get locked do not necessarily correspond to the settings that were present in the
1588 * latest capture result received from the camera device, since additional captures
1589 * and AWB updates may have occurred even before the result was sent out. If an
1590 * application is switching between automatic and manual control and wishes to eliminate
1591 * any flicker during the switch, the following procedure is recommended:</p>
1592 * <ol>
1593 * <li>Starting in auto-AWB mode:</li>
1594 * <li>Lock AWB</li>
1595 * <li>Wait for the first result to be output that has the AWB locked</li>
1596 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1597 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1598 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001599 * <p>Note that AWB lock is only meaningful when
1600 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1601 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001602 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1603 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001604 *
1605 * @see CaptureRequest#CONTROL_AWB_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001606 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001607 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001608 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001609 public static final Key<Boolean> CONTROL_AWB_LOCK =
1610 new Key<Boolean>("android.control.awbLock", boolean.class);
1611
1612 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001613 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001614 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001615 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001616 * <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 -07001617 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001618 * routine is enabled, overriding the application's selected
1619 * {@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 -08001620 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1621 * is OFF, the behavior of AWB is device dependent. It is recommened to
1622 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1623 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001624 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001625 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001626 * 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 -08001627 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001628 * <p>When set to any other modes, the camera device's auto-white
1629 * balance routine is disabled. The camera device uses each
1630 * particular illumination target for white balance
1631 * adjustment. The application's values for
1632 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1633 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1634 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001635 * <p><b>Possible values:</b>
1636 * <ul>
1637 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1638 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1639 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1640 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1641 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1642 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1643 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1644 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1645 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1646 * </ul></p>
1647 * <p><b>Available values for this device:</b><br>
1648 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001649 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001650 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001651 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001652 * @see CaptureRequest#COLOR_CORRECTION_MODE
1653 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001654 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001655 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001656 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001657 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001658 * @see #CONTROL_AWB_MODE_OFF
1659 * @see #CONTROL_AWB_MODE_AUTO
1660 * @see #CONTROL_AWB_MODE_INCANDESCENT
1661 * @see #CONTROL_AWB_MODE_FLUORESCENT
1662 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1663 * @see #CONTROL_AWB_MODE_DAYLIGHT
1664 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1665 * @see #CONTROL_AWB_MODE_TWILIGHT
1666 * @see #CONTROL_AWB_MODE_SHADE
1667 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001668 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001669 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001670 public static final Key<Integer> CONTROL_AWB_MODE =
1671 new Key<Integer>("android.control.awbMode", int.class);
1672
1673 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001674 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001675 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001676 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001677 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001678 * <p>The maximum number of regions supported by the device is determined by the value
1679 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001680 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1681 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being
1682 * the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001683 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001684 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1685 * active pixel array.</p>
1686 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
1687 * system depends on the mode being set.
1688 * When the distortion correction mode is OFF, the coordinate system follows
1689 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
1690 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and
1691 * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1,
1692 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right
1693 * pixel in the pre-correction active pixel array.
1694 * When the distortion correction mode is not OFF, the coordinate system follows
1695 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
1696 * <code>(0, 0)</code> being the top-left pixel of the active array, and
1697 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1698 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the
1699 * active pixel array.</p>
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001700 * <p>The weight must range from 0 to 1000, and represents a weight
1701 * for every pixel in the area. This means that a large metering area
1702 * with the same weight as a smaller area will have more effect in
1703 * the metering result. Metering areas can partially overlap and the
1704 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001705 * <p>The weights are relative to weights of other white balance metering regions, so if
1706 * only one region is used, all non-zero weights will have the same effect. A region with
1707 * 0 weight is ignored.</p>
1708 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1709 * camera device.</p>
1710 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1711 * capture result metadata, the camera device will ignore the sections outside the crop
1712 * region and output only the intersection rectangle as the metering region in the result
1713 * metadata. If the region is entirely outside the crop region, it will be ignored and
1714 * not reported in the result metadata.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001715 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
1716 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on
1717 * distortion correction capability and mode</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001718 * <p><b>Range of valid values:</b><br>
1719 * Coordinates must be between <code>[(0,0), (width, height))</code> of
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001720 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1721 * depending on distortion correction capability and mode</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001722 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001723 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001724 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001725 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001726 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001727 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07001728 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001729 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001730 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001731 @NonNull
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001732 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1733 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001734
1735 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001736 * <p>Information to the camera device 3A (auto-exposure,
1737 * auto-focus, auto-white balance) routines about the purpose
1738 * of this capture, to help the camera device to decide optimal 3A
1739 * strategy.</p>
Zhijun Hee30adb72014-04-09 19:04:31 -07001740 * <p>This control (except for MANUAL) is only effective if
1741 * <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 -08001742 * <p>All intents are supported by all devices, except that:
1743 * * ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1744 * PRIVATE_REPROCESSING or YUV_REPROCESSING.
1745 * * MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1746 * MANUAL_SENSOR.
1747 * * MOTION_TRACKING will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
1748 * MOTION_TRACKING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001749 * <p><b>Possible values:</b>
1750 * <ul>
1751 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1752 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1753 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1754 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1755 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1756 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1757 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001758 * <li>{@link #CONTROL_CAPTURE_INTENT_MOTION_TRACKING MOTION_TRACKING}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001759 * </ul></p>
1760 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001761 *
1762 * @see CaptureRequest#CONTROL_MODE
Zhijun Hee30adb72014-04-09 19:04:31 -07001763 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001764 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1765 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1766 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1767 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1768 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1769 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
Zhijun Hee30adb72014-04-09 19:04:31 -07001770 * @see #CONTROL_CAPTURE_INTENT_MANUAL
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001771 * @see #CONTROL_CAPTURE_INTENT_MOTION_TRACKING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001772 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001773 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001774 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001775 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1776 new Key<Integer>("android.control.captureIntent", int.class);
1777
1778 /**
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -08001779 * <p>A special color effect to apply.</p>
1780 * <p>When this mode is set, a color effect will be applied
1781 * to images produced by the camera device. The interpretation
1782 * and implementation of these color effects is left to the
1783 * implementor of the camera device, and should not be
1784 * depended on to be consistent (or present) across all
1785 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001786 * <p><b>Possible values:</b>
1787 * <ul>
1788 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1789 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1790 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1791 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1792 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1793 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1794 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1795 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1796 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1797 * </ul></p>
1798 * <p><b>Available values for this device:</b><br>
1799 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001800 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001801 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001802 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001803 * @see #CONTROL_EFFECT_MODE_OFF
1804 * @see #CONTROL_EFFECT_MODE_MONO
1805 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1806 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1807 * @see #CONTROL_EFFECT_MODE_SEPIA
1808 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1809 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1810 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1811 * @see #CONTROL_EFFECT_MODE_AQUA
1812 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001813 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001814 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001815 public static final Key<Integer> CONTROL_EFFECT_MODE =
1816 new Key<Integer>("android.control.effectMode", int.class);
1817
1818 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001819 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001820 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001821 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001822 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001823 * capture parameters itself.</p>
1824 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001825 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001826 * <p>When set to USE_SCENE_MODE, the individual controls in
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001827 * android.control.* are mostly disabled, and the camera device
1828 * implements one of the scene mode settings (such as ACTION,
1829 * SUNSET, or PARTY) as it wishes. The camera device scene mode
1830 * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001831 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1832 * is that this frame will not be used by camera device background 3A statistics
1833 * update, as if this frame is never captured. This mode can be used in the scenario
1834 * where the application doesn't want a 3A manual control capture to affect
1835 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001836 * <p><b>Possible values:</b>
1837 * <ul>
1838 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
1839 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1840 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1841 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1842 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001843 * <p><b>Available values for this device:</b><br>
1844 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001845 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001846 *
1847 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001848 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001849 * @see #CONTROL_MODE_OFF
1850 * @see #CONTROL_MODE_AUTO
1851 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001852 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001853 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001854 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001855 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001856 public static final Key<Integer> CONTROL_MODE =
1857 new Key<Integer>("android.control.mode", int.class);
1858
1859 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001860 * <p>Control for which scene mode is currently active.</p>
1861 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1862 * capture settings.</p>
Ruben Brunke6679362014-01-17 17:05:54 -08001863 * <p>This is the mode that that is active when
Zhijun Heee2ebde2015-06-16 19:58:11 -07001864 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
1865 * 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}
1866 * while in use.</p>
Ruben Brunke6679362014-01-17 17:05:54 -08001867 * <p>The interpretation and implementation of these scene modes is left
1868 * to the implementor of the camera device. Their behavior will not be
1869 * consistent across all devices, and any given device may only implement
1870 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001871 * <p><b>Possible values:</b>
1872 * <ul>
1873 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1874 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1875 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1876 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1877 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1878 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1879 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1880 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1881 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1882 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1883 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1884 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1885 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1886 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1887 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1888 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1889 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1890 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001891 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001892 * </ul></p>
1893 * <p><b>Available values for this device:</b><br>
1894 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001895 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001896 *
Ruben Brunke6679362014-01-17 17:05:54 -08001897 * @see CaptureRequest#CONTROL_AE_MODE
1898 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001899 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Ruben Brunke6679362014-01-17 17:05:54 -08001900 * @see CaptureRequest#CONTROL_AWB_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001901 * @see CaptureRequest#CONTROL_MODE
Ruben Brunke6679362014-01-17 17:05:54 -08001902 * @see #CONTROL_SCENE_MODE_DISABLED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001903 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1904 * @see #CONTROL_SCENE_MODE_ACTION
1905 * @see #CONTROL_SCENE_MODE_PORTRAIT
1906 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1907 * @see #CONTROL_SCENE_MODE_NIGHT
1908 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1909 * @see #CONTROL_SCENE_MODE_THEATRE
1910 * @see #CONTROL_SCENE_MODE_BEACH
1911 * @see #CONTROL_SCENE_MODE_SNOW
1912 * @see #CONTROL_SCENE_MODE_SUNSET
1913 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1914 * @see #CONTROL_SCENE_MODE_FIREWORKS
1915 * @see #CONTROL_SCENE_MODE_SPORTS
1916 * @see #CONTROL_SCENE_MODE_PARTY
1917 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1918 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07001919 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001920 * @see #CONTROL_SCENE_MODE_HDR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001921 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001922 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001923 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001924 public static final Key<Integer> CONTROL_SCENE_MODE =
1925 new Key<Integer>("android.control.sceneMode", int.class);
1926
1927 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001928 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001929 * active.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07001930 * <p>Video stabilization automatically warps images from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001931 * the camera in order to stabilize motion between consecutive frames.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001932 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07001933 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001934 * <p>Switching between different video stabilization modes may take several
1935 * frames to initialize, the camera device will report the current mode
1936 * in capture result metadata. For example, When "ON" mode is requested,
1937 * the video stabilization modes in the first several capture results may
1938 * still be "OFF", and it will become "ON" when the initialization is
1939 * done.</p>
Jianing Wei2813b0f2015-09-29 14:24:36 -07001940 * <p>In addition, not all recording sizes or frame rates may be supported for
1941 * stabilization by a device that reports stabilization support. It is guaranteed
1942 * that an output targeting a MediaRecorder or MediaCodec will be stabilized if
1943 * the recording resolution is less than or equal to 1920 x 1080 (width less than
1944 * or equal to 1920, height less than or equal to 1080), and the recording
1945 * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult
1946 * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return
1947 * OFF if the recording output is not stabilized, or if there are no output
1948 * Surface types that can be stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001949 * <p>If a camera device supports both this mode and OIS
1950 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
1951 * produce undesirable interaction, so it is recommended not to enable
1952 * both at the same time.</p>
1953 * <p><b>Possible values:</b>
1954 * <ul>
1955 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
1956 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
1957 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001958 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001959 *
Jianing Wei2813b0f2015-09-29 14:24:36 -07001960 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Zhijun He45fa43a12014-06-13 18:29:37 -07001961 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001962 * @see CaptureRequest#SCALER_CROP_REGION
Zhijun He4793af52014-05-05 10:39:12 -07001963 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1964 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001965 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001966 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001967 @NonNull
Zhijun He4793af52014-05-05 10:39:12 -07001968 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1969 new Key<Integer>("android.control.videoStabilizationMode", int.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001970
1971 /**
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07001972 * <p>The amount of additional sensitivity boost applied to output images
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08001973 * after RAW sensor data is captured.</p>
1974 * <p>Some camera devices support additional digital sensitivity boosting in the
1975 * camera processing pipeline after sensor RAW image is captured.
1976 * Such a boost will be applied to YUV/JPEG format output images but will not
1977 * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p>
Yin-Chia Yeh33052d32016-04-11 16:39:02 -07001978 * <p>This key will be <code>null</code> for devices that do not support any RAW format
1979 * outputs. For devices that do support RAW format outputs, this key will always
1980 * present, and if a device does not support post RAW sensitivity boost, it will
1981 * list <code>100</code> in this key.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08001982 * <p>If the camera device cannot apply the exact boost requested, it will reduce the
1983 * boost to the nearest supported value.
1984 * The final boost value used will be available in the output capture result.</p>
1985 * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images
1986 * of such device will have the total sensitivity of
Yin-Chia Yeh67e61b62016-01-26 13:27:35 -08001987 * <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 -08001988 * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p>
1989 * <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
1990 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
1991 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
1992 * <p><b>Range of valid values:</b><br>
1993 * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001994 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08001995 *
1996 * @see CaptureRequest#CONTROL_AE_MODE
1997 * @see CaptureRequest#CONTROL_MODE
1998 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
1999 * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE
2000 * @see CaptureRequest#SENSOR_SENSITIVITY
2001 */
2002 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002003 @NonNull
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002004 public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST =
2005 new Key<Integer>("android.control.postRawSensitivityBoost", int.class);
2006
2007 /**
Chien-Yu Chene4491712017-01-11 11:14:06 -08002008 * <p>Allow camera device to enable zero-shutter-lag mode for requests with
2009 * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p>
2010 * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with
2011 * STILL_CAPTURE capture intent. The camera device may use images captured in the past to
2012 * produce output images for a zero-shutter-lag request. The result metadata including the
2013 * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images.
2014 * Therefore, the contents of the output images and the result metadata may be out of order
2015 * compared to previous regular requests. enableZsl does not affect requests with other
2016 * capture intents.</p>
2017 * <p>For example, when requests are submitted in the following order:
2018 * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW
2019 * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p>
2020 * <p>The output images for request B may have contents captured before the output images for
2021 * request A, and the result metadata for request B may be older than the result metadata for
2022 * request A.</p>
Chien-Yu Chen1d72ee32017-04-18 15:23:06 -07002023 * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in
2024 * the past for requests with STILL_CAPTURE capture intent.</p>
2025 * <p>For applications targeting SDK versions O and newer, the value of enableZsl in
2026 * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always
2027 * <code>false</code> if present.</p>
2028 * <p>For applications targeting SDK versions older than O, the value of enableZsl in all
2029 * capture templates is always <code>false</code> if present.</p>
Chien-Yu Chen81026382017-05-03 12:30:58 -07002030 * <p>For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002031 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Chien-Yu Chene4491712017-01-11 11:14:06 -08002032 *
2033 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
2034 * @see CaptureResult#SENSOR_TIMESTAMP
2035 */
2036 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002037 @NonNull
Chien-Yu Chene4491712017-01-11 11:14:06 -08002038 public static final Key<Boolean> CONTROL_ENABLE_ZSL =
2039 new Key<Boolean>("android.control.enableZsl", boolean.class);
2040
2041 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002042 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08002043 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002044 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
2045 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002046 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08002047 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08002048 * camera device will use the highest-quality enhancement algorithms,
2049 * even if it slows down capture rate. FAST means the camera device will
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002050 * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if
2051 * edge enhancement will slow down capture rate. Every output stream will have a similar
2052 * amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002053 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2054 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2055 * into a final capture when triggered by the user. In this mode, the camera device applies
2056 * edge enhancement to low-resolution streams (below maximum recording resolution) to
2057 * maximize preview quality, but does not apply edge enhancement to high-resolution streams,
2058 * since those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002059 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
2060 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002061 * The camera device may adjust its internal edge enhancement parameters for best
Zhijun He0e99c222015-01-29 15:26:05 -08002062 * 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 -07002063 * <p><b>Possible values:</b>
2064 * <ul>
2065 * <li>{@link #EDGE_MODE_OFF OFF}</li>
2066 * <li>{@link #EDGE_MODE_FAST FAST}</li>
2067 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002068 * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002069 * </ul></p>
2070 * <p><b>Available values for this device:</b><br>
2071 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002072 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002073 * <p><b>Full capability</b> -
2074 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2075 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002076 *
2077 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002078 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002079 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002080 * @see #EDGE_MODE_OFF
2081 * @see #EDGE_MODE_FAST
2082 * @see #EDGE_MODE_HIGH_QUALITY
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002083 * @see #EDGE_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002084 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002085 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002086 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002087 public static final Key<Integer> EDGE_MODE =
2088 new Key<Integer>("android.edge.mode", int.class);
2089
2090 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002091 * <p>The desired mode for for the camera device's flash control.</p>
2092 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002093 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002094 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2095 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2096 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2097 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2098 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2099 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002100 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002101 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2102 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2103 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002104 * <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 -07002105 * <p><b>Possible values:</b>
2106 * <ul>
2107 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2108 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2109 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2110 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002111 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002112 *
2113 * @see CaptureRequest#CONTROL_AE_MODE
2114 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2115 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002116 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002117 * @see #FLASH_MODE_OFF
2118 * @see #FLASH_MODE_SINGLE
2119 * @see #FLASH_MODE_TORCH
2120 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002121 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002122 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002123 public static final Key<Integer> FLASH_MODE =
2124 new Key<Integer>("android.flash.mode", int.class);
2125
2126 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002127 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002128 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002129 * that do not accurately measure the incoming light (i.e. pixels that
2130 * are stuck at an arbitrary value or are oversensitive).</p>
2131 * <p><b>Possible values:</b>
2132 * <ul>
2133 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2134 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2135 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2136 * </ul></p>
2137 * <p><b>Available values for this device:</b><br>
2138 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002139 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002140 *
2141 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002142 * @see #HOT_PIXEL_MODE_OFF
2143 * @see #HOT_PIXEL_MODE_FAST
2144 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2145 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002146 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002147 @NonNull
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002148 public static final Key<Integer> HOT_PIXEL_MODE =
2149 new Key<Integer>("android.hotPixel.mode", int.class);
2150
2151 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002152 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002153 * <p>Setting a location object in a request will include the GPS coordinates of the location
2154 * into any JPEG images captured based on the request. These coordinates can then be
2155 * viewed by anyone who receives the JPEG image.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002156 * <p>This tag is also used for HEIC image capture.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002157 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002158 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002159 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002160 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07002161 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002162 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2163 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2164
2165 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002166 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002167 * EXIF.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002168 * <p>This tag is also used for HEIC image capture.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002169 * <p><b>Range of valid values:</b><br>
2170 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002171 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002172 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002173 */
2174 public static final Key<double[]> JPEG_GPS_COORDINATES =
2175 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2176
2177 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002178 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002179 * include in EXIF.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002180 * <p>This tag is also used for HEIC image capture.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002181 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002182 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002183 */
2184 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2185 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2186
2187 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002188 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002189 * EXIF.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002190 * <p>This tag is also used for HEIC image capture.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002191 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002192 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002193 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002194 */
2195 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2196 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2197
2198 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002199 * <p>The orientation for a JPEG image.</p>
2200 * <p>The clockwise rotation angle in degrees, relative to the orientation
2201 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2202 * upright.</p>
2203 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
Yin-Chia Yehd49ebcc2015-03-27 13:54:04 -07002204 * rotate the image data to match this orientation. When the image data is rotated,
2205 * the thumbnail data will also be rotated.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002206 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2207 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
Emilian Peev3abc7512018-03-28 11:22:26 +01002208 * <p>To translate from the device orientation given by the Android sensor APIs for camera
2209 * sensors which are not EXTERNAL, the following sample code may be used:</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002210 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2211 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2212 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2213 *
2214 * // Round device orientation to a multiple of 90
2215 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2216 *
2217 * // Reverse device orientation for front-facing cameras
2218 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2219 * if (facingFront) deviceOrientation = -deviceOrientation;
2220 *
2221 * // Calculate desired JPEG orientation relative to camera orientation to make
2222 * // the image upright relative to the device orientation
2223 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2224 *
2225 * return jpegOrientation;
2226 * }
2227 * </code></pre>
Emilian Peev3abc7512018-03-28 11:22:26 +01002228 * <p>For EXTERNAL cameras the sensor orientation will always be set to 0 and the facing will
2229 * also be set to EXTERNAL. The above code is not relevant in such case.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002230 * <p>This tag is also used to describe the orientation of the HEIC image capture, in which
2231 * case the rotation is reflected by
2232 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}, and not by
2233 * rotating the image data itself.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002234 * <p><b>Units</b>: Degrees in multiples of 90</p>
2235 * <p><b>Range of valid values:</b><br>
2236 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002237 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002238 *
2239 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002240 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002241 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002242 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002243 public static final Key<Integer> JPEG_ORIENTATION =
2244 new Key<Integer>("android.jpeg.orientation", int.class);
2245
2246 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002247 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002248 * image.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002249 * <p>85-95 is typical usage range. This tag is also used to describe the quality
2250 * of the HEIC image capture.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002251 * <p><b>Range of valid values:</b><br>
2252 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002253 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002254 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002255 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002256 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002257 public static final Key<Byte> JPEG_QUALITY =
2258 new Key<Byte>("android.jpeg.quality", byte.class);
2259
2260 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002261 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002262 * thumbnail.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002263 * <p>This tag is also used to describe the quality of the HEIC image capture.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002264 * <p><b>Range of valid values:</b><br>
2265 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002266 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002267 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002268 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002269 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002270 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2271 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2272
2273 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002274 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002275 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2276 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002277 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2278 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002279 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2280 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2281 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2282 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2283 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2284 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002285 * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested,
2286 * the camera device will handle thumbnail rotation in one of the following ways:</p>
2287 * <ul>
2288 * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
2289 * and keep jpeg and thumbnail image data unrotated.</li>
2290 * <li>Rotate the jpeg and thumbnail image data and not set
2291 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
2292 * case, LIMITED or FULL hardware level devices will report rotated thumnail size in
2293 * capture result, so the width and height will be interchanged if 90 or 270 degree
2294 * orientation is requested. LEGACY device will always report unrotated thumbnail
2295 * size.</li>
2296 * </ul>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08002297 * <p>The tag is also used as thumbnail size for HEIC image format capture, in which case the
2298 * the thumbnail rotation is reflected by
2299 * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}, and not by
2300 * rotating the thumbnail data itself.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002301 * <p><b>Range of valid values:</b><br>
2302 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002303 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002304 *
2305 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Yin-Chia Yeh59883112015-06-22 15:51:40 -07002306 * @see CaptureRequest#JPEG_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002307 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002308 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002309 @NonNull
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002310 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2311 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002312
2313 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002314 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2315 * effective aperture diameter.</p>
2316 * <p>Setting this value is only supported on the camera devices that have a variable
2317 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002318 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2319 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002320 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002321 * to achieve manual exposure control.</p>
2322 * <p>The requested aperture value may take several frames to reach the
2323 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002324 * aperture size in capture result metadata while the aperture is changing.
2325 * 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 -08002326 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2327 * the ON modes, this will be overridden by the camera device
2328 * auto-exposure algorithm, the overridden values are then provided
2329 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002330 * <p><b>Units</b>: The f-number (f/N)</p>
2331 * <p><b>Range of valid values:</b><br>
2332 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002333 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002334 * <p><b>Full capability</b> -
2335 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2336 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002337 *
Zhijun He399f05d2014-01-15 11:31:30 -08002338 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002339 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002340 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002341 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002342 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002343 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002344 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002345 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002346 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002347 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002348 public static final Key<Float> LENS_APERTURE =
2349 new Key<Float>("android.lens.aperture", float.class);
2350
2351 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002352 * <p>The desired setting for the lens neutral density filter(s).</p>
2353 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002354 * <p>Lens filters are typically used to lower the amount of light the
2355 * sensor is exposed to (measured in steps of EV). As used here, an EV
2356 * step is the standard logarithmic representation, which are
2357 * non-negative, and inversely proportional to the amount of light
2358 * hitting the sensor. For example, setting this to 0 would result
2359 * in no reduction of the incoming light, and setting this to 2 would
2360 * mean that the filter is set to reduce incoming light by two stops
2361 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002362 * <p>It may take several frames before the lens filter density changes
2363 * to the requested value. While the filter density is still changing,
2364 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002365 * <p><b>Units</b>: Exposure Value (EV)</p>
2366 * <p><b>Range of valid values:</b><br>
2367 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002368 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002369 * <p><b>Full capability</b> -
2370 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2371 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002372 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002373 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002374 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002375 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002376 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002377 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002378 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002379 public static final Key<Float> LENS_FILTER_DENSITY =
2380 new Key<Float>("android.lens.filterDensity", float.class);
2381
2382 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002383 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002384 * <p>This setting controls the physical focal length of the camera
2385 * device's lens. Changing the focal length changes the field of
2386 * view of the camera device, and is usually used for optical zoom.</p>
2387 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2388 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002389 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002390 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2391 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002392 * <p>Optical zoom will not be supported on most devices.</p>
2393 * <p><b>Units</b>: Millimeters</p>
2394 * <p><b>Range of valid values:</b><br>
2395 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002396 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002397 *
2398 * @see CaptureRequest#LENS_APERTURE
2399 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002400 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002401 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002402 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002403 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002404 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002405 public static final Key<Float> LENS_FOCAL_LENGTH =
2406 new Key<Float>("android.lens.focalLength", float.class);
2407
2408 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002409 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002410 * measured from frontmost surface of the lens.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002411 * <p>This control can be used for setting manual focus, on devices that support
2412 * the MANUAL_SENSOR capability and have a variable-focus lens (see
2413 * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}).</p>
2414 * <p>A value of <code>0.0f</code> means infinity focus. The value set will be clamped to
2415 * <code>[0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code>.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002416 * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied
2417 * instantaneously, and it may take several frames before the lens
2418 * can move to the requested focus distance. While the lens is still moving,
2419 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002420 * <p>LEGACY devices support at most setting this to <code>0.0f</code>
2421 * for infinity focus.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002422 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2423 * <p><b>Range of valid values:</b><br>
2424 * &gt;= 0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002425 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002426 * <p><b>Full capability</b> -
2427 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2428 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002429 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002430 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002431 * @see CaptureRequest#LENS_FOCAL_LENGTH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002432 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Zhijun Heca1b73a2014-02-03 12:39:53 -08002433 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
2434 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002435 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002436 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002437 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002438 public static final Key<Float> LENS_FOCUS_DISTANCE =
2439 new Key<Float>("android.lens.focusDistance", float.class);
2440
2441 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002442 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2443 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002444 * <p>OIS is used to compensate for motion blur due to small
2445 * movements of the camera during capture. Unlike digital image
2446 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2447 * makes use of mechanical elements to stabilize the camera
2448 * sensor, and thus allows for longer exposure times before
2449 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002450 * <p>Switching between different optical stabilization modes may take several
2451 * frames to initialize, the camera device will report the current mode in
2452 * capture result metadata. For example, When "ON" mode is requested, the
2453 * optical stabilization modes in the first several capture results may still
2454 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002455 * <p>If a camera device supports both OIS and digital image stabilization
2456 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2457 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002458 * <p>Not all devices will support OIS; see
2459 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2460 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002461 * <p><b>Possible values:</b>
2462 * <ul>
2463 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2464 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2465 * </ul></p>
2466 * <p><b>Available values for this device:</b><br>
2467 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002468 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002469 * <p><b>Limited capability</b> -
2470 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2471 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002472 *
2473 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002474 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002475 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002476 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2477 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2478 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002479 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002480 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002481 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2482 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2483
2484 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002485 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002486 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08002487 * excessive noise added by the capture process, especially in dark conditions.</p>
2488 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
2489 * YUV domain.</p>
2490 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
2491 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
2492 * This mode is optional, may not be support by all devices. The application should check
2493 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002494 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2495 * will be applied. HIGH_QUALITY mode indicates that the camera device
2496 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002497 * even if it slows down capture rate. FAST means the camera device will not
Chien-Yu Chen9c9167e2015-07-14 16:38:25 -07002498 * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if
2499 * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate.
2500 * Every output stream will have a similar amount of enhancement applied.</p>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002501 * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2502 * buffer of high-resolution images during preview and reprocess image(s) from that buffer
2503 * into a final capture when triggered by the user. In this mode, the camera device applies
2504 * noise reduction to low-resolution streams (below maximum recording resolution) to maximize
2505 * preview quality, but does not apply noise reduction to high-resolution streams, since
2506 * those will be reprocessed later if necessary.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002507 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
2508 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
2509 * may adjust the noise reduction parameters for best image quality based on the
2510 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002511 * <p><b>Possible values:</b>
2512 * <ul>
2513 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2514 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2515 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08002516 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002517 * <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002518 * </ul></p>
2519 * <p><b>Available values for this device:</b><br>
2520 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002521 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002522 * <p><b>Full capability</b> -
2523 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2524 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002525 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002526 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002527 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08002528 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002529 * @see #NOISE_REDUCTION_MODE_OFF
2530 * @see #NOISE_REDUCTION_MODE_FAST
2531 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08002532 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala0dd17502015-07-07 10:43:07 -07002533 * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002534 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002535 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002536 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002537 public static final Key<Integer> NOISE_REDUCTION_MODE =
2538 new Key<Integer>("android.noiseReduction.mode", int.class);
2539
2540 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002541 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002542 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002543 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002544 * <p><b>Units</b>: arbitrary integer assigned by application</p>
2545 * <p><b>Range of valid values:</b><br>
2546 * Any int</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002547 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002548 * @hide
2549 */
2550 public static final Key<Integer> REQUEST_ID =
2551 new Key<Integer>("android.request.id", int.class);
2552
2553 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002554 * <p>The desired region of the sensor to read out for this capture.</p>
2555 * <p>This control can be used to implement digital zoom.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002556 * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
2557 * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being
2558 * the top-left pixel of the active array.</p>
2559 * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate
2560 * system depends on the mode being set.
2561 * When the distortion correction mode is OFF, the coordinate system follows
2562 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with
2563 * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array.
2564 * When the distortion correction mode is not OFF, the coordinate system follows
2565 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
2566 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002567 * <p>Output streams use this rectangle to produce their output,
2568 * cropping to a smaller region if necessary to maintain the
2569 * stream's aspect ratio, then scaling the sensor input to
2570 * match the output's configured resolution.</p>
2571 * <p>The crop region is applied after the RAW to other color
2572 * space (e.g. YUV) conversion. Since raw streams
2573 * (e.g. RAW16) don't have the conversion stage, they are not
2574 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002575 * <p>For non-raw streams, any additional per-stream cropping will
2576 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002577 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002578 * ratio, then 4:3 streams will use the exact crop
2579 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002580 * (letterbox).</p>
2581 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002582 * outputs will crop horizontally (pillarbox), and 16:9
2583 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002584 * be centered within the crop region.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07002585 * <p>If the coordinate system is {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, the width and height
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002586 * of the crop region cannot be set to be smaller than
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002587 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2588 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002589 * <p>If the coordinate system is {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, the width
2590 * and height of the crop region cannot be set to be smaller than
2591 * <code>floor( preCorrectionActiveArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>
2592 * and
2593 * <code>floor( preCorrectionActiveArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>,
2594 * respectively.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002595 * <p>The camera device may adjust the crop region to account
2596 * for rounding and other hardware requirements; the final
2597 * crop region used will be included in the output capture
2598 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002599 * <p><b>Units</b>: Pixel coordinates relative to
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002600 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or
2601 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on distortion correction
2602 * capability and mode</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002603 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002604 *
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002605 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002606 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002607 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002608 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002609 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002610 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002611 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002612 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2613 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2614
2615 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002616 * <p>Duration each pixel is exposed to
2617 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002618 * <p>If the sensor can't expose this exact duration, it will shorten the
2619 * duration exposed to the nearest possible value (rather than expose longer).
2620 * The final exposure time used will be available in the output capture result.</p>
2621 * <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
2622 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2623 * <p><b>Units</b>: Nanoseconds</p>
2624 * <p><b>Range of valid values:</b><br>
2625 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002626 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002627 * <p><b>Full capability</b> -
2628 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2629 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2630 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002631 * @see CaptureRequest#CONTROL_AE_MODE
2632 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002633 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002634 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002635 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002636 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002637 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002638 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2639 new Key<Long>("android.sensor.exposureTime", long.class);
2640
2641 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002642 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002643 * start of next frame exposure.</p>
2644 * <p>The maximum frame rate that can be supported by a camera subsystem is
2645 * a function of many factors:</p>
2646 * <ul>
2647 * <li>Requested resolutions of output image streams</li>
2648 * <li>Availability of binning / skipping modes on the imager</li>
2649 * <li>The bandwidth of the imager interface</li>
2650 * <li>The bandwidth of the various ISP processing blocks</li>
2651 * </ul>
2652 * <p>Since these factors can vary greatly between different ISPs and
2653 * sensors, the camera abstraction tries to represent the bandwidth
2654 * restrictions with as simple a model as possible.</p>
2655 * <p>The model presented has the following characteristics:</p>
2656 * <ul>
2657 * <li>The image sensor is always configured to output the smallest
2658 * resolution possible given the application's requested output stream
2659 * sizes. The smallest resolution is defined as being at least as large
2660 * as the largest requested output stream size; the camera pipeline must
2661 * never digitally upsample sensor data when the crop region covers the
2662 * whole sensor. In general, this means that if only small output stream
2663 * resolutions are configured, the sensor can provide a higher frame
2664 * rate.</li>
2665 * <li>Since any request may use any or all the currently configured
2666 * output streams, the sensor and ISP must be configured to support
2667 * scaling a single capture to all the streams at the same time. This
2668 * means the camera pipeline must be ready to produce the largest
2669 * requested output size without any delay. Therefore, the overall
2670 * frame rate of a given configured stream set is governed only by the
2671 * largest requested stream resolution.</li>
2672 * <li>Using more than one output stream in a request does not affect the
2673 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002674 * <li>Certain format-streams may need to do additional background processing
2675 * before data is consumed/produced by that stream. These processors
2676 * can run concurrently to the rest of the camera pipeline, but
2677 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002678 * </ul>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002679 * <p>The necessary information for the application, given the model above, is provided via
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002680 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002681 * These are used to determine the maximum frame rate / minimum frame duration that is
2682 * possible for a given stream configuration.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002683 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002684 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002685 * device:</p>
2686 * <ol>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002687 * <li>Let the set of currently configured input/output streams be called <code>S</code>.</li>
2688 * <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 }
2689 * (with its respective size/format). Let this set of frame durations be called <code>F</code>.</li>
2690 * <li>For any given request <code>R</code>, the minimum frame duration allowed for <code>R</code> is the maximum
2691 * 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 -08002692 * </ol>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002693 * <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 -08002694 * using its respective size/format), then the frame duration in <code>F</code> determines the steady
2695 * state frame rate that the application will get if it uses <code>R</code> as a repeating request. Let
2696 * this special kind of request be called <code>Rsimple</code>.</p>
2697 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved by a single capture of a
2698 * new request <code>Rstall</code> (which has at least one in-use stream with a non-0 stall time) and if
2699 * <code>Rstall</code> has the same minimum frame duration this will not cause a frame rate loss if all
2700 * buffers from the previous <code>Rstall</code> have already been delivered.</p>
2701 * <p>For more details about stalling, see {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002702 * <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
2703 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2704 * <p><b>Units</b>: Nanoseconds</p>
2705 * <p><b>Range of valid values:</b><br>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002706 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, {@link android.hardware.camera2.params.StreamConfigurationMap }.
2707 * The duration is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002708 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002709 * <p><b>Full capability</b> -
2710 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2711 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002712 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002713 * @see CaptureRequest#CONTROL_AE_MODE
2714 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002715 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002716 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002717 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002718 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002719 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002720 public static final Key<Long> SENSOR_FRAME_DURATION =
2721 new Key<Long>("android.sensor.frameDuration", long.class);
2722
2723 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002724 * <p>The amount of gain applied to sensor data
2725 * before processing.</p>
2726 * <p>The sensitivity is the standard ISO sensitivity value,
2727 * as defined in ISO 12232:2006.</p>
2728 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2729 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2730 * is guaranteed to use only analog amplification for applying the gain.</p>
2731 * <p>If the camera device cannot apply the exact sensitivity
2732 * requested, it will reduce the gain to the nearest supported
2733 * value. The final sensitivity used will be available in the
2734 * output capture result.</p>
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002735 * <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
2736 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002737 * <p><b>Units</b>: ISO arithmetic units</p>
2738 * <p><b>Range of valid values:</b><br>
2739 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002740 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002741 * <p><b>Full capability</b> -
2742 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2743 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002744 *
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08002745 * @see CaptureRequest#CONTROL_AE_MODE
2746 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002747 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002748 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2749 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002750 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002751 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002752 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002753 public static final Key<Integer> SENSOR_SENSITIVITY =
2754 new Key<Integer>("android.sensor.sensitivity", int.class);
2755
2756 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002757 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2758 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2759 * <p>Each color channel is treated as an unsigned 32-bit integer.
2760 * The camera device then uses the most significant X bits
2761 * that correspond to how many bits are in its Bayer raw sensor
2762 * output.</p>
2763 * <p>For example, a sensor with RAW10 Bayer output would use the
2764 * 10 most significant bits from each color channel.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002765 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002766 *
2767 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2768 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002769 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002770 @NonNull
Igor Murashkinc127f052014-01-17 18:06:02 -08002771 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2772 new Key<int[]>("android.sensor.testPatternData", int[].class);
2773
2774 /**
2775 * <p>When enabled, the sensor sends a test pattern instead of
2776 * doing a real exposure from the camera.</p>
2777 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002778 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002779 * work as normal.</p>
2780 * <p>For example, if manual flash is enabled, flash firing should still
2781 * occur (and that the test pattern remain unmodified, since the flash
2782 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002783 * <p>Defaults to OFF.</p>
2784 * <p><b>Possible values:</b>
2785 * <ul>
2786 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
2787 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
2788 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
2789 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
2790 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
2791 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
2792 * </ul></p>
2793 * <p><b>Available values for this device:</b><br>
2794 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002795 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002796 *
2797 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08002798 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2799 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2800 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2801 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2802 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2803 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2804 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002805 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002806 @NonNull
Igor Murashkinc127f052014-01-17 18:06:02 -08002807 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2808 new Key<Integer>("android.sensor.testPatternMode", int.class);
2809
2810 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002811 * <p>Quality of lens shading correction applied
2812 * to the image data.</p>
2813 * <p>When set to OFF mode, no lens shading correction will be applied by the
2814 * camera device, and an identity lens shading map data will be provided
2815 * 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 -07002816 * shading map with size of <code>[ 4, 3 ]</code>,
2817 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
2818 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002819 * <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 -07002820 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2821 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2822 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2823 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2824 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08002825 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002826 * <p>When set to other modes, lens shading correction will be applied by the camera
2827 * device. Applications can request lens shading map data by setting
2828 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
2829 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
2830 * data will be the one applied by the camera device for this capture request.</p>
2831 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
2832 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
2833 * 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>
2834 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
2835 * to be converged before using the returned shading map data.</p>
2836 * <p><b>Possible values:</b>
2837 * <ul>
2838 * <li>{@link #SHADING_MODE_OFF OFF}</li>
2839 * <li>{@link #SHADING_MODE_FAST FAST}</li>
2840 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2841 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002842 * <p><b>Available values for this device:</b><br>
2843 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002844 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002845 * <p><b>Full capability</b> -
2846 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2847 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002848 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002849 * @see CaptureRequest#CONTROL_AE_MODE
2850 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002851 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002852 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002853 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08002854 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2855 * @see #SHADING_MODE_OFF
2856 * @see #SHADING_MODE_FAST
2857 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08002858 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002859 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002860 @NonNull
Zhijun Heba93fe62014-01-17 16:43:05 -08002861 public static final Key<Integer> SHADING_MODE =
2862 new Key<Integer>("android.shading.mode", int.class);
2863
2864 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002865 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002866 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002867 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002868 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002869 * fields.</p>
2870 * <p><b>Possible values:</b>
2871 * <ul>
2872 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
2873 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
2874 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
2875 * </ul></p>
2876 * <p><b>Available values for this device:</b><br>
2877 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
2878 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002879 *
2880 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002881 * @see #STATISTICS_FACE_DETECT_MODE_OFF
2882 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
2883 * @see #STATISTICS_FACE_DETECT_MODE_FULL
2884 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002885 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002886 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002887 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
2888 new Key<Integer>("android.statistics.faceDetectMode", int.class);
2889
2890 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002891 * <p>Operating mode for hot pixel map generation.</p>
2892 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
2893 * If set to <code>false</code>, no hot pixel map will be returned.</p>
2894 * <p><b>Range of valid values:</b><br>
2895 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002896 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002897 *
2898 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
2899 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
2900 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002901 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002902 @NonNull
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002903 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
2904 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
2905
2906 /**
Zhijun Hecc28a412014-02-24 15:11:23 -08002907 * <p>Whether the camera device will output the lens
2908 * shading map in output result metadata.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002909 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002910 * android.statistics.lensShadingMap will be provided in
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002911 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002912 * <p>ON is always supported on devices with the RAW capability.</p>
2913 * <p><b>Possible values:</b>
2914 * <ul>
2915 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
2916 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
2917 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002918 * <p><b>Available values for this device:</b><br>
2919 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002920 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002921 * <p><b>Full capability</b> -
2922 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2923 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2924 *
2925 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002926 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
Eino-Ville Talvalad96748b2013-09-12 11:11:27 -07002927 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2928 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2929 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002930 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002931 @NonNull
Eino-Ville Talvalad96748b2013-09-12 11:11:27 -07002932 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2933 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2934
2935 /**
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07002936 * <p>A control for selecting whether optical stabilization (OIS) position
2937 * information is included in output result metadata.</p>
2938 * <p>Since optical image stabilization generally involves motion much faster than the duration
2939 * of individualq image exposure, multiple OIS samples can be included for a single capture
2940 * result. For example, if the OIS reporting operates at 200 Hz, a typical camera operating
2941 * at 30fps may have 6-7 OIS samples per capture result. This information can be combined
2942 * with the rolling shutter skew to account for lens motion during image exposure in
2943 * post-processing algorithms.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08002944 * <p><b>Possible values:</b>
2945 * <ul>
2946 * <li>{@link #STATISTICS_OIS_DATA_MODE_OFF OFF}</li>
2947 * <li>{@link #STATISTICS_OIS_DATA_MODE_ON ON}</li>
2948 * </ul></p>
2949 * <p><b>Available values for this device:</b><br>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002950 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES android.statistics.info.availableOisDataModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002951 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002952 *
2953 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08002954 * @see #STATISTICS_OIS_DATA_MODE_OFF
2955 * @see #STATISTICS_OIS_DATA_MODE_ON
2956 */
2957 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002958 @NonNull
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08002959 public static final Key<Integer> STATISTICS_OIS_DATA_MODE =
2960 new Key<Integer>("android.statistics.oisDataMode", int.class);
2961
2962 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002963 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08002964 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2965 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002966 * <p>See android.tonemap.curveRed for more details.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002967 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002968 * <p><b>Full capability</b> -
2969 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2970 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002971 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002972 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08002973 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002974 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002975 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002976 public static final Key<float[]> TONEMAP_CURVE_BLUE =
2977 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002978
2979 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002980 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08002981 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2982 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002983 * <p>See android.tonemap.curveRed for more details.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002984 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002985 * <p><b>Full capability</b> -
2986 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2987 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002988 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002989 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08002990 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002991 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002992 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002993 public static final Key<float[]> TONEMAP_CURVE_GREEN =
2994 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002995
2996 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002997 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08002998 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2999 * CONTRAST_CURVE.</p>
3000 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003001 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003002 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08003003 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003004 * <p>These are sorted in order of increasing <code>Pin</code>; it is
3005 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08003006 * define a complete mapping. For input values between control points,
3007 * the camera device must linearly interpolate between the control
3008 * points.</p>
3009 * <p>Each curve can have an independent number of points, and the number
3010 * of points can be less than max (that is, the request doesn't have to
3011 * always provide a curve with number of points equivalent to
3012 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003013 * <p>For devices with MONOCHROME capability, all three channels must have the same set of
3014 * control points.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08003015 * <p>A few examples, and their corresponding graphical mappings; these
3016 * only specify the red channel and the precision is limited to 4
3017 * digits, for conciseness.</p>
3018 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003019 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003020 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003021 * <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 -08003022 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003023 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003024 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003025 * <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 -08003026 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003027 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003028 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
3029 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
3030 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
3031 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003032 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003033 * <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 -08003034 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003035 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003036 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
3037 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
3038 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
3039 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003040 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003041 * <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 -07003042 * <p><b>Range of valid values:</b><br>
3043 * 0-1 on both input and output coordinates, normalized
3044 * as a floating-point value such that 0 == black and 1 == white.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003045 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003046 * <p><b>Full capability</b> -
3047 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3048 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003049 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003050 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08003051 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003052 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003053 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003054 */
3055 public static final Key<float[]> TONEMAP_CURVE_RED =
3056 new Key<float[]>("android.tonemap.curveRed", float[].class);
3057
3058 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003059 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
3060 * is CONTRAST_CURVE.</p>
3061 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
3062 * channels respectively. The following example uses the red channel as an
3063 * example. The same logic applies to green and blue channel.
3064 * Each channel's curve is defined by an array of control points:</p>
3065 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003066 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003067 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
3068 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
3069 * guaranteed that input values 0.0 and 1.0 are included in the list to
3070 * define a complete mapping. For input values between control points,
3071 * the camera device must linearly interpolate between the control
3072 * points.</p>
3073 * <p>Each curve can have an independent number of points, and the number
3074 * of points can be less than max (that is, the request doesn't have to
3075 * always provide a curve with number of points equivalent to
3076 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003077 * <p>For devices with MONOCHROME capability, all three channels must have the same set of
3078 * control points.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003079 * <p>A few examples, and their corresponding graphical mappings; these
3080 * only specify the red channel and the precision is limited to 4
3081 * digits, for conciseness.</p>
3082 * <p>Linear mapping:</p>
3083 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
3084 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003085 * <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 -07003086 * <p>Invert mapping:</p>
3087 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
3088 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003089 * <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 -07003090 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
3091 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003092 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
3093 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
3094 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
3095 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003096 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003097 * <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 -07003098 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
3099 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003100 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
3101 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
3102 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
3103 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003104 * </code></pre>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003105 * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003106 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003107 * <p><b>Full capability</b> -
3108 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3109 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003110 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003111 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003112 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
3113 * @see CaptureRequest#TONEMAP_MODE
3114 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003115 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003116 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07003117 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003118 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
3119 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
3120
3121 /**
Igor Murashkine0060932014-01-17 17:24:11 -08003122 * <p>High-level global contrast/gamma/tonemapping control.</p>
3123 * <p>When switching to an application-defined contrast curve by setting
3124 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
3125 * per-channel with a set of <code>(in, out)</code> points that specify the
3126 * mapping from input high-bit-depth pixel value to the output
3127 * low-bit-depth value. Since the actual pixel ranges of both input
3128 * and output may change depending on the camera pipeline, the values
3129 * are specified by normalized floating-point numbers.</p>
3130 * <p>More-complex color mapping operations such as 3D color look-up
3131 * tables, selective chroma enhancement, or other non-linear color
3132 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3133 * CONTRAST_CURVE.</p>
3134 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003135 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08003136 * These values are always available, and as close as possible to the
3137 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07003138 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08003139 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
3140 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003141 * <p><b>Possible values:</b>
3142 * <ul>
3143 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
3144 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
3145 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003146 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
3147 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003148 * </ul></p>
3149 * <p><b>Available values for this device:</b><br>
3150 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003151 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003152 * <p><b>Full capability</b> -
3153 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3154 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08003155 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003156 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003157 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003158 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08003159 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003160 * @see #TONEMAP_MODE_CONTRAST_CURVE
3161 * @see #TONEMAP_MODE_FAST
3162 * @see #TONEMAP_MODE_HIGH_QUALITY
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003163 * @see #TONEMAP_MODE_GAMMA_VALUE
3164 * @see #TONEMAP_MODE_PRESET_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003165 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003166 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003167 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003168 public static final Key<Integer> TONEMAP_MODE =
3169 new Key<Integer>("android.tonemap.mode", int.class);
3170
3171 /**
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003172 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3173 * GAMMA_VALUE</p>
3174 * <p>The tonemap curve will be defined the following formula:
3175 * * OUT = pow(IN, 1.0 / gamma)
3176 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
3177 * pow is the power function and gamma is the gamma value specified by this
3178 * key.</p>
3179 * <p>The same curve will be applied to all color channels. The camera device
3180 * may clip the input gamma value to its supported range. The actual applied
3181 * value will be returned in capture result.</p>
3182 * <p>The valid range of gamma value varies on different devices, but values
3183 * within [1.0, 5.0] are guaranteed not to be clipped.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003184 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003185 *
3186 * @see CaptureRequest#TONEMAP_MODE
3187 */
3188 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003189 @NonNull
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003190 public static final Key<Float> TONEMAP_GAMMA =
3191 new Key<Float>("android.tonemap.gamma", float.class);
3192
3193 /**
3194 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3195 * PRESET_CURVE</p>
3196 * <p>The tonemap curve will be defined by specified standard.</p>
3197 * <p>sRGB (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003198 * <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 -08003199 * <p>Rec. 709 (approximated by 16 control points):</p>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003200 * <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 -08003201 * <p>Note that above figures show a 16 control points approximation of preset
3202 * curves. Camera devices may apply a different approximation to the curve.</p>
3203 * <p><b>Possible values:</b>
3204 * <ul>
3205 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
3206 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
3207 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003208 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003209 *
3210 * @see CaptureRequest#TONEMAP_MODE
3211 * @see #TONEMAP_PRESET_CURVE_SRGB
3212 * @see #TONEMAP_PRESET_CURVE_REC709
3213 */
3214 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003215 @NonNull
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003216 public static final Key<Integer> TONEMAP_PRESET_CURVE =
3217 new Key<Integer>("android.tonemap.presetCurve", int.class);
3218
3219 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003220 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003221 * that the camera is powered on and may be streaming images back to the
3222 * Application Processor. In certain rare circumstances, the OS may
3223 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003224 * any untrusted applications.</p>
3225 * <p>In particular, the LED <em>must</em> always be on when the data could be
3226 * transmitted off the device. The LED <em>should</em> always be on whenever
3227 * data is stored locally on the device.</p>
3228 * <p>The LED <em>may</em> be off if a trusted application is using the data that
3229 * doesn't violate the above rules.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003230 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003231 * @hide
3232 */
3233 public static final Key<Boolean> LED_TRANSMIT =
3234 new Key<Boolean>("android.led.transmit", boolean.class);
3235
3236 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003237 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003238 * to its current values, or is free to vary.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003239 * <p>When set to <code>true</code> (ON), the values used for black-level
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003240 * compensation will not change until the lock is set to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003241 * <code>false</code> (OFF).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003242 * <p>Since changes to certain capture parameters (such as
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003243 * exposure time) may require resetting of black level
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003244 * compensation, the camera device must report whether setting
3245 * the black level lock was successful in the output result
Igor Murashkinace5bf02013-12-10 17:36:40 -08003246 * metadata.</p>
3247 * <p>For example, if a sequence of requests is as follows:</p>
3248 * <ul>
3249 * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li>
3250 * <li>Request 2: Exposure = 10ms, Black level lock = ON</li>
3251 * <li>Request 3: Exposure = 10ms, Black level lock = ON</li>
3252 * <li>Request 4: Exposure = 20ms, Black level lock = ON</li>
3253 * <li>Request 5: Exposure = 20ms, Black level lock = ON</li>
3254 * <li>Request 6: Exposure = 20ms, Black level lock = ON</li>
3255 * </ul>
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003256 * <p>And the exposure change in Request 4 requires the camera
3257 * device to reset the black level offsets, then the output
3258 * result metadata is expected to be:</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003259 * <ul>
3260 * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li>
3261 * <li>Result 2: Exposure = 10ms, Black level lock = ON</li>
3262 * <li>Result 3: Exposure = 10ms, Black level lock = ON</li>
3263 * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li>
3264 * <li>Result 5: Exposure = 20ms, Black level lock = ON</li>
3265 * <li>Result 6: Exposure = 20ms, Black level lock = ON</li>
3266 * </ul>
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003267 * <p>This indicates to the application that on frame 4, black
3268 * levels were reset due to exposure value changes, and pixel
3269 * values may not be consistent across captures.</p>
3270 * <p>The camera device will maintain the lock to the extent
3271 * possible, only overriding the lock to OFF when changes to
3272 * other request parameters require a black level recalculation
3273 * or reset.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003274 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003275 * <p><b>Full capability</b> -
3276 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3277 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3278 *
3279 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003280 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003281 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003282 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003283 public static final Key<Boolean> BLACK_LEVEL_LOCK =
3284 new Key<Boolean>("android.blackLevel.lock", boolean.class);
3285
Zhijun He0e99c222015-01-29 15:26:05 -08003286 /**
3287 * <p>The amount of exposure time increase factor applied to the original output
3288 * frame by the application processing before sending for reprocessing.</p>
3289 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
3290 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
3291 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
3292 * output frames to effectively reduce the noise to the same level as a frame that was
3293 * captured with longer exposure time. To be more specific, assuming the original captured
3294 * images were captured with a sensitivity of S and an exposure time of T, the model in
3295 * the camera device is that the amount of noise in the image would be approximately what
3296 * would be expected if the original capture parameters had been a sensitivity of
3297 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
3298 * than S and T respectively. If the captured images were processed by the application
3299 * before being sent for reprocessing, then the application may have used image processing
3300 * algorithms and/or multi-frame image fusion to reduce the noise in the
3301 * application-processed images (input images). By using the effectiveExposureFactor
3302 * control, the application can communicate to the camera device the actual noise level
3303 * improvement in the application-processed image. With this information, the camera
3304 * device can select appropriate noise reduction and edge enhancement parameters to avoid
3305 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
3306 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
3307 * <p>For example, for multi-frame image fusion use case, the application may fuse
3308 * multiple output frames together to a final frame for reprocessing. When N image are
3309 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
3310 * square root of N (based on a simple photon shot noise model). The camera device will
3311 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
3312 * produce the best quality images.</p>
3313 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
3314 * buffer in a way that affects its effective exposure time.</p>
3315 * <p>This control is only effective for YUV reprocessing capture request. For noise
3316 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
3317 * Similarly, for edge enhancement reprocessing, it is only effective when
3318 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
3319 * <p><b>Units</b>: Relative exposure time increase factor.</p>
3320 * <p><b>Range of valid values:</b><br>
3321 * &gt;= 1.0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003322 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07003323 * <p><b>Limited capability</b> -
3324 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3325 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0e99c222015-01-29 15:26:05 -08003326 *
3327 * @see CaptureRequest#EDGE_MODE
Zhijun He513f7c32015-04-24 18:23:54 -07003328 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08003329 * @see CaptureRequest#NOISE_REDUCTION_MODE
3330 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3331 */
3332 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003333 @NonNull
Zhijun He0e99c222015-01-29 15:26:05 -08003334 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
3335 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
3336
Eino-Ville Talvala41670722018-03-13 19:43:07 -07003337 /**
3338 * <p>Mode of operation for the lens distortion correction block.</p>
3339 * <p>The lens distortion correction block attempts to improve image quality by fixing
3340 * radial, tangential, or other geometric aberrations in the camera device's optics. If
3341 * available, the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} field documents the lens's distortion parameters.</p>
3342 * <p>OFF means no distortion correction is done.</p>
3343 * <p>FAST/HIGH_QUALITY both mean camera device determined distortion correction will be
3344 * applied. HIGH_QUALITY mode indicates that the camera device will use the highest-quality
3345 * correction algorithms, even if it slows down capture rate. FAST means the camera device
3346 * will not slow down capture rate when applying correction. FAST may be the same as OFF if
3347 * any correction at all would slow down capture rate. Every output stream will have a
3348 * similar amount of enhancement applied.</p>
Shuzhen Wangec5e8d22018-09-28 09:28:48 -07003349 * <p>The correction only applies to processed outputs such as YUV, Y8, JPEG, or DEPTH16; it is
3350 * not applied to any RAW output.</p>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003351 * <p>This control will be on by default on devices that support this control. Applications
3352 * disabling distortion correction need to pay extra attention with the coordinate system of
3353 * metering regions, crop region, and face rectangles. When distortion correction is OFF,
3354 * metadata coordinates follow the coordinate system of
3355 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}. When distortion is not OFF, metadata
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003356 * coordinates follow the coordinate system of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}. The
3357 * camera device will map these metadata fields to match the corrected image produced by the
3358 * camera device, for both capture requests and results. However, this mapping is not very
3359 * precise, since rectangles do not generally map to rectangles when corrected. Only linear
3360 * scaling between the active array and precorrection active array coordinates is
3361 * performed. Applications that require precise correction of metadata need to undo that
3362 * linear scaling, and apply a more complete correction that takes into the account the app's
3363 * own requirements.</p>
3364 * <p>The full list of metadata that is affected in this way by distortion correction is:</p>
3365 * <ul>
3366 * <li>{@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}</li>
3367 * <li>{@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}</li>
3368 * <li>{@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}</li>
3369 * <li>{@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}</li>
3370 * <li>{@link CaptureResult#STATISTICS_FACES android.statistics.faces}</li>
3371 * </ul>
Eino-Ville Talvala41670722018-03-13 19:43:07 -07003372 * <p><b>Possible values:</b>
3373 * <ul>
3374 * <li>{@link #DISTORTION_CORRECTION_MODE_OFF OFF}</li>
3375 * <li>{@link #DISTORTION_CORRECTION_MODE_FAST FAST}</li>
3376 * <li>{@link #DISTORTION_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3377 * </ul></p>
3378 * <p><b>Available values for this device:</b><br>
3379 * {@link CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES android.distortionCorrection.availableModes}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003380 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala41670722018-03-13 19:43:07 -07003381 *
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003382 * @see CaptureRequest#CONTROL_AE_REGIONS
3383 * @see CaptureRequest#CONTROL_AF_REGIONS
3384 * @see CaptureRequest#CONTROL_AWB_REGIONS
Eino-Ville Talvala41670722018-03-13 19:43:07 -07003385 * @see CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES
3386 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003387 * @see CaptureRequest#SCALER_CROP_REGION
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003388 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3389 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07003390 * @see CaptureResult#STATISTICS_FACES
Eino-Ville Talvala41670722018-03-13 19:43:07 -07003391 * @see #DISTORTION_CORRECTION_MODE_OFF
3392 * @see #DISTORTION_CORRECTION_MODE_FAST
3393 * @see #DISTORTION_CORRECTION_MODE_HIGH_QUALITY
3394 */
3395 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003396 @NonNull
Eino-Ville Talvala41670722018-03-13 19:43:07 -07003397 public static final Key<Integer> DISTORTION_CORRECTION_MODE =
3398 new Key<Integer>("android.distortionCorrection.mode", int.class);
3399
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003400 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3401 * End generated code
3402 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07003403
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003404
3405
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003406
3407
3408
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003409}