blob: f8b2a5bd61bf6e9cabed6019ae81dcd9e7b54265 [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;
Emilian Peev2776ca32018-09-18 14:00:39 +010025import android.hardware.camera2.params.RecommendedStreamConfigurationMap;
Emilian Peev75a55702017-11-07 16:09:59 +000026import android.hardware.camera2.params.SessionConfiguration;
Shuzhen Wang23d29382017-11-26 17:24:56 -080027import android.hardware.camera2.utils.ArrayUtils;
Igor Murashkind6d65152014-05-19 16:31:02 -070028import android.hardware.camera2.utils.TypeReference;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070029import android.util.Rational;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070030
Emilian Peev2776ca32018-09-18 14:00:39 +010031import java.util.ArrayList;
Shuzhen Wanga8d36032018-10-15 12:01:53 -070032import java.util.Arrays;
Igor Murashkin7a36a0f2013-09-10 18:13:09 -070033import java.util.Collections;
Shuzhen Wangbde13972018-03-19 10:30:45 -070034import java.util.HashSet;
Igor Murashkin7a36a0f2013-09-10 18:13:09 -070035import java.util.List;
Shuzhen Wangbde13972018-03-19 10:30:45 -070036import java.util.Set;
Igor Murashkin7a36a0f2013-09-10 18:13:09 -070037
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080038/**
39 * <p>The properties describing a
40 * {@link CameraDevice CameraDevice}.</p>
41 *
42 * <p>These properties are fixed for a given CameraDevice, and can be queried
43 * through the {@link CameraManager CameraManager}
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -070044 * interface with {@link CameraManager#getCameraCharacteristics}.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080045 *
Ruben Brunkf967a542014-04-28 16:31:11 -070046 * <p>{@link CameraCharacteristics} objects are immutable.</p>
47 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080048 * @see CameraDevice
49 * @see CameraManager
50 */
Igor Murashkind6d65152014-05-19 16:31:02 -070051public final class CameraCharacteristics extends CameraMetadata<CameraCharacteristics.Key<?>> {
52
53 /**
54 * A {@code Key} is used to do camera characteristics field lookups with
55 * {@link CameraCharacteristics#get}.
56 *
57 * <p>For example, to get the stream configuration map:
58 * <code><pre>
59 * StreamConfigurationMap map = cameraCharacteristics.get(
60 * CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
61 * </pre></code>
62 * </p>
63 *
64 * <p>To enumerate over all possible keys for {@link CameraCharacteristics}, see
65 * {@link CameraCharacteristics#getKeys()}.</p>
66 *
67 * @see CameraCharacteristics#get
68 * @see CameraCharacteristics#getKeys()
69 */
70 public static final class Key<T> {
71 private final CameraMetadataNative.Key<T> mKey;
72
73 /**
74 * Visible for testing and vendor extensions only.
75 *
76 * @hide
77 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +010078 @UnsupportedAppUsage
Emilian Peevde62d842017-03-23 19:20:40 +000079 public Key(String name, Class<T> type, long vendorId) {
80 mKey = new CameraMetadataNative.Key<T>(name, type, vendorId);
81 }
82
83 /**
84 * Visible for testing and vendor extensions only.
85 *
86 * @hide
87 */
Eino-Ville Talvala60331e22019-03-04 15:40:04 -080088 @UnsupportedAppUsage
89 public Key(@NonNull String name, @NonNull String fallbackName, @NonNull Class<T> type) {
Justin Yunf01e40c2018-05-18 20:39:45 +090090 mKey = new CameraMetadataNative.Key<T>(name, fallbackName, type);
91 }
92
93 /**
Eino-Ville Talvala1cf59fd2019-01-25 17:33:05 -080094 * Construct a new Key with a given name and type.
Justin Yunf01e40c2018-05-18 20:39:45 +090095 *
Eino-Ville Talvala1cf59fd2019-01-25 17:33:05 -080096 * <p>Normally, applications should use the existing Key definitions in
97 * {@link CameraCharacteristics}, and not need to construct their own Key objects. However,
98 * they may be useful for testing purposes and for defining custom camera
99 * characteristics.</p>
Justin Yunf01e40c2018-05-18 20:39:45 +0900100 */
Eino-Ville Talvala79d4aac2019-03-06 14:26:10 -0800101 public Key(@NonNull String name, @NonNull Class<T> type) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700102 mKey = new CameraMetadataNative.Key<T>(name, type);
103 }
104
105 /**
106 * Visible for testing and vendor extensions only.
107 *
108 * @hide
109 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100110 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700111 public Key(String name, TypeReference<T> typeReference) {
112 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
113 }
114
115 /**
116 * Return a camelCase, period separated name formatted like:
117 * {@code "root.section[.subsections].name"}.
118 *
119 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
120 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
121 *
122 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
123 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
124 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
125 *
126 * @return String representation of the key name
127 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700128 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700129 public String getName() {
130 return mKey.getName();
131 }
132
133 /**
Emilian Peevde62d842017-03-23 19:20:40 +0000134 * Return vendor tag id.
135 *
136 * @hide
137 */
138 public long getVendorId() {
139 return mKey.getVendorId();
140 }
141
142 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700143 * {@inheritDoc}
144 */
145 @Override
146 public final int hashCode() {
147 return mKey.hashCode();
148 }
149
150 /**
151 * {@inheritDoc}
152 */
153 @SuppressWarnings("unchecked")
154 @Override
155 public final boolean equals(Object o) {
156 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
157 }
158
159 /**
Chien-Yu Chen12a83852015-07-07 12:17:22 -0700160 * Return this {@link Key} as a string representation.
161 *
162 * <p>{@code "CameraCharacteristics.Key(%s)"}, where {@code %s} represents
163 * the name of this key as returned by {@link #getName}.</p>
164 *
165 * @return string representation of {@link Key}
166 */
167 @NonNull
168 @Override
169 public String toString() {
170 return String.format("CameraCharacteristics.Key(%s)", mKey.getName());
171 }
172
173 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700174 * Visible for CameraMetadataNative implementation only; do not use.
175 *
176 * TODO: Make this private or remove it altogether.
177 *
178 * @hide
179 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100180 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700181 public CameraMetadataNative.Key<T> getNativeKey() {
182 return mKey;
183 }
184
185 @SuppressWarnings({
186 "unused", "unchecked"
187 })
188 private Key(CameraMetadataNative.Key<?> nativeKey) {
189 mKey = (CameraMetadataNative.Key<T>) nativeKey;
190 }
191 }
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700192
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100193 @UnsupportedAppUsage
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700194 private final CameraMetadataNative mProperties;
Igor Murashkincc542a42014-06-25 11:52:23 -0700195 private List<CameraCharacteristics.Key<?>> mKeys;
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100196 private List<CameraCharacteristics.Key<?>> mKeysNeedingPermission;
Igor Murashkind6d65152014-05-19 16:31:02 -0700197 private List<CaptureRequest.Key<?>> mAvailableRequestKeys;
Emilian Peev75a55702017-11-07 16:09:59 +0000198 private List<CaptureRequest.Key<?>> mAvailableSessionKeys;
Emilian Peev2100ae72018-01-12 16:56:25 +0000199 private List<CaptureRequest.Key<?>> mAvailablePhysicalRequestKeys;
Igor Murashkind6d65152014-05-19 16:31:02 -0700200 private List<CaptureResult.Key<?>> mAvailableResultKeys;
Emilian Peev2776ca32018-09-18 14:00:39 +0100201 private ArrayList<RecommendedStreamConfigurationMap> mRecommendedConfigurations;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700202
203 /**
204 * Takes ownership of the passed-in properties object
205 * @hide
206 */
Igor Murashkin68f40062013-09-10 12:15:54 -0700207 public CameraCharacteristics(CameraMetadataNative properties) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700208 mProperties = CameraMetadataNative.move(properties);
Emilian Peevde62d842017-03-23 19:20:40 +0000209 setNativeInstance(mProperties);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700210 }
211
Ruben Brunkf967a542014-04-28 16:31:11 -0700212 /**
213 * Returns a copy of the underlying {@link CameraMetadataNative}.
214 * @hide
215 */
216 public CameraMetadataNative getNativeCopy() {
217 return new CameraMetadataNative(mProperties);
218 }
219
Igor Murashkind6d65152014-05-19 16:31:02 -0700220 /**
221 * Get a camera characteristics field value.
222 *
223 * <p>The field definitions can be
224 * found in {@link CameraCharacteristics}.</p>
225 *
226 * <p>Querying the value for the same key more than once will return a value
227 * which is equal to the previous queried value.</p>
228 *
229 * @throws IllegalArgumentException if the key was not valid
230 *
231 * @param key The characteristics field to read.
232 * @return The value of that key, or {@code null} if the field is not set.
233 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700234 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700235 public <T> T get(Key<T> key) {
236 return mProperties.get(key);
237 }
238
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700239 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700240 * {@inheritDoc}
241 * @hide
242 */
243 @SuppressWarnings("unchecked")
244 @Override
245 protected <T> T getProtected(Key<?> key) {
246 return (T) mProperties.get(key);
247 }
248
249 /**
250 * {@inheritDoc}
251 * @hide
252 */
253 @SuppressWarnings("unchecked")
254 @Override
255 protected Class<Key<?>> getKeyClass() {
256 Object thisClass = Key.class;
257 return (Class<Key<?>>)thisClass;
258 }
259
260 /**
261 * {@inheritDoc}
262 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700263 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700264 @Override
265 public List<Key<?>> getKeys() {
Igor Murashkincc542a42014-06-25 11:52:23 -0700266 // List of keys is immutable; cache the results after we calculate them
267 if (mKeys != null) {
268 return mKeys;
269 }
270
271 int[] filterTags = get(REQUEST_AVAILABLE_CHARACTERISTICS_KEYS);
272 if (filterTags == null) {
273 throw new AssertionError("android.request.availableCharacteristicsKeys must be non-null"
274 + " in the characteristics");
275 }
276
277 mKeys = Collections.unmodifiableList(
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100278 getKeys(getClass(), getKeyClass(), this, filterTags, true));
Igor Murashkincc542a42014-06-25 11:52:23 -0700279 return mKeys;
Igor Murashkind6d65152014-05-19 16:31:02 -0700280 }
281
282 /**
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100283 * <p>Returns a subset of the list returned by {@link #getKeys} with all keys that
284 * require camera clients to obtain the {@link android.Manifest.permission#CAMERA} permission.
285 * </p>
286 *
287 * <p>If an application calls {@link CameraManager#getCameraCharacteristics} without holding the
288 * {@link android.Manifest.permission#CAMERA} permission,
289 * all keys in this list will not be available, and calling {@link #get} will
290 * return null for those keys. If the application obtains the
291 * {@link android.Manifest.permission#CAMERA} permission, then the
292 * CameraCharacteristics from a call to a subsequent
293 * {@link CameraManager#getCameraCharacteristics} will have the keys available.</p>
294 *
295 * <p>The list returned is not modifiable, so any attempts to modify it will throw
296 * a {@code UnsupportedOperationException}.</p>
297 *
298 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
299 *
300 * @return List of camera characteristic keys that require the
Emilian Peev5389f1a2019-02-28 10:13:39 -0800301 * {@link android.Manifest.permission#CAMERA} permission. The list can be empty in case
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100302 * there are no currently present keys that need additional permission.
303 */
Emilian Peev5389f1a2019-02-28 10:13:39 -0800304 public @NonNull List<Key<?>> getKeysNeedingPermission() {
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100305 if (mKeysNeedingPermission == null) {
306 Object crKey = CameraCharacteristics.Key.class;
307 Class<CameraCharacteristics.Key<?>> crKeyTyped =
308 (Class<CameraCharacteristics.Key<?>>)crKey;
309
310 int[] filterTags = get(REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION);
311 if (filterTags == null) {
Emilian Peev5389f1a2019-02-28 10:13:39 -0800312 mKeysNeedingPermission = Collections.unmodifiableList(
313 new ArrayList<CameraCharacteristics.Key<?>> ());
314 return mKeysNeedingPermission;
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100315 }
316 mKeysNeedingPermission =
317 getAvailableKeyList(CameraCharacteristics.class, crKeyTyped, filterTags,
318 /*includeSynthetic*/ false);
319 }
320 return mKeysNeedingPermission;
321 }
322
323 /**
Emilian Peev2776ca32018-09-18 14:00:39 +0100324 * <p>Retrieve camera device recommended stream configuration map
325 * {@link RecommendedStreamConfigurationMap} for a given use case.</p>
326 *
327 * <p>The stream configurations advertised here are efficient in terms of power and performance
328 * for common use cases like preview, video, snapshot, etc. The recommended maps are usually
329 * only small subsets of the exhaustive list provided in
330 * {@link #SCALER_STREAM_CONFIGURATION_MAP} and suggested for a particular use case by the
331 * camera device implementation. For further information about the expected configurations in
332 * various scenarios please refer to:
333 * <ul>
334 * <li>{@link RecommendedStreamConfigurationMap#USECASE_PREVIEW}</li>
335 * <li>{@link RecommendedStreamConfigurationMap#USECASE_RECORD}</li>
336 * <li>{@link RecommendedStreamConfigurationMap#USECASE_VIDEO_SNAPSHOT}</li>
337 * <li>{@link RecommendedStreamConfigurationMap#USECASE_SNAPSHOT}</li>
338 * <li>{@link RecommendedStreamConfigurationMap#USECASE_RAW}</li>
339 * <li>{@link RecommendedStreamConfigurationMap#USECASE_ZSL}</li>
340 * </ul>
341 * </p>
342 *
343 * <p>For example on how this can be used by camera clients to find out the maximum recommended
344 * preview and snapshot resolution, consider the following pseudo-code:
345 * </p>
346 * <pre><code>
347 * public static Size getMaxSize(Size... sizes) {
348 * if (sizes == null || sizes.length == 0) {
349 * throw new IllegalArgumentException("sizes was empty");
350 * }
351 *
352 * Size sz = sizes[0];
353 * for (Size size : sizes) {
354 * if (size.getWidth() * size.getHeight() &gt; sz.getWidth() * sz.getHeight()) {
355 * sz = size;
356 * }
357 * }
358 *
359 * return sz;
360 * }
361 *
362 * CameraCharacteristics characteristics =
363 * cameraManager.getCameraCharacteristics(cameraId);
364 * RecommendedStreamConfigurationMap previewConfig =
365 * characteristics.getRecommendedStreamConfigurationMap(
366 * RecommendedStreamConfigurationMap.USECASE_PREVIEW);
367 * RecommendedStreamConfigurationMap snapshotConfig =
368 * characteristics.getRecommendedStreamConfigurationMap(
369 * RecommendedStreamConfigurationMap.USECASE_SNAPSHOT);
370 *
371 * if ((previewConfig != null) &amp;&amp; (snapshotConfig != null)) {
372 *
373 * Set<Size> snapshotSizeSet = snapshotConfig.getOutputSizes(
374 * ImageFormat.JPEG);
375 * Size[] snapshotSizes = new Size[snapshotSizeSet.size()];
376 * snapshotSizes = snapshotSizeSet.toArray(snapshotSizes);
377 * Size suggestedMaxJpegSize = getMaxSize(snapshotSizes);
378 *
379 * Set<Size> previewSizeSet = snapshotConfig.getOutputSizes(
380 * ImageFormat.PRIVATE);
381 * Size[] previewSizes = new Size[previewSizeSet.size()];
382 * previewSizes = previewSizeSet.toArray(previewSizes);
383 * Size suggestedMaxPreviewSize = getMaxSize(previewSizes);
384 * }
385 *
386 * </code></pre>
387 *
388 * <p>Similar logic can be used for other use cases as well.</p>
389 *
390 * <p>Support for recommended stream configurations is optional. In case there a no
391 * suggested configurations for the particular use case, please refer to
392 * {@link #SCALER_STREAM_CONFIGURATION_MAP} for the exhaustive available list.</p>
393 *
394 * @param usecase Use case id.
395 *
396 * @throws IllegalArgumentException In case the use case argument is invalid.
397 * @return Valid {@link RecommendedStreamConfigurationMap} or null in case the camera device
398 * doesn't have any recommendation for this use case or the recommended configurations
399 * are invalid.
400 */
Emilian Peevae4a3412018-11-27 16:47:19 +0000401 public @Nullable RecommendedStreamConfigurationMap getRecommendedStreamConfigurationMap(
Emilian Peev2776ca32018-09-18 14:00:39 +0100402 @RecommendedStreamConfigurationMap.RecommendedUsecase int usecase) {
403 if (((usecase >= RecommendedStreamConfigurationMap.USECASE_PREVIEW) &&
404 (usecase <= RecommendedStreamConfigurationMap.USECASE_RAW)) ||
405 ((usecase >= RecommendedStreamConfigurationMap.USECASE_VENDOR_START) &&
406 (usecase < RecommendedStreamConfigurationMap.MAX_USECASE_COUNT))) {
407 if (mRecommendedConfigurations == null) {
408 mRecommendedConfigurations = mProperties.getRecommendedStreamConfigurations();
409 if (mRecommendedConfigurations == null) {
410 return null;
411 }
412 }
413
414 return mRecommendedConfigurations.get(usecase);
415 }
416
417 throw new IllegalArgumentException(String.format("Invalid use case: %d", usecase));
418 }
419
420 /**
Emilian Peev75a55702017-11-07 16:09:59 +0000421 * <p>Returns a subset of {@link #getAvailableCaptureRequestKeys} keys that the
422 * camera device can pass as part of the capture session initialization.</p>
423 *
424 * <p>This list includes keys that are difficult to apply per-frame and
425 * can result in unexpected delays when modified during the capture session
426 * lifetime. Typical examples include parameters that require a
427 * time-consuming hardware re-configuration or internal camera pipeline
428 * change. For performance reasons we suggest clients to pass their initial
429 * values as part of {@link SessionConfiguration#setSessionParameters}. Once
430 * the camera capture session is enabled it is also recommended to avoid
431 * changing them from their initial values set in
432 * {@link SessionConfiguration#setSessionParameters }.
433 * Control over session parameters can still be exerted in capture requests
434 * but clients should be aware and expect delays during their application.
435 * An example usage scenario could look like this:</p>
436 * <ul>
Emilian Peev2776ca32018-09-18 14:00:39 +0100437 * <li>The camera client starts by querying the session parameter key list via
Emilian Peev75a55702017-11-07 16:09:59 +0000438 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
439 * <li>Before triggering the capture session create sequence, a capture request
440 * must be built via {@link CameraDevice#createCaptureRequest } using an
441 * appropriate template matching the particular use case.</li>
442 * <li>The client should go over the list of session parameters and check
443 * whether some of the keys listed matches with the parameters that
444 * they intend to modify as part of the first capture request.</li>
445 * <li>If there is no such match, the capture request can be passed
446 * unmodified to {@link SessionConfiguration#setSessionParameters }.</li>
447 * <li>If matches do exist, the client should update the respective values
448 * and pass the request to {@link SessionConfiguration#setSessionParameters }.</li>
449 * <li>After the capture session initialization completes the session parameter
450 * key list can continue to serve as reference when posting or updating
451 * further requests. As mentioned above further changes to session
452 * parameters should ideally be avoided, if updates are necessary
453 * however clients could expect a delay/glitch during the
454 * parameter switch.</li>
455 * </ul>
456 *
457 * <p>The list returned is not modifiable, so any attempts to modify it will throw
458 * a {@code UnsupportedOperationException}.</p>
459 *
460 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
461 *
462 * @return List of keys that can be passed during capture session initialization. In case the
463 * camera device doesn't support such keys the list can be null.
464 */
465 @SuppressWarnings({"unchecked"})
466 public List<CaptureRequest.Key<?>> getAvailableSessionKeys() {
467 if (mAvailableSessionKeys == null) {
468 Object crKey = CaptureRequest.Key.class;
469 Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
470
471 int[] filterTags = get(REQUEST_AVAILABLE_SESSION_KEYS);
472 if (filterTags == null) {
473 return null;
474 }
475 mAvailableSessionKeys =
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100476 getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags,
477 /*includeSynthetic*/ false);
Emilian Peev75a55702017-11-07 16:09:59 +0000478 }
479 return mAvailableSessionKeys;
480 }
481
482 /**
Emilian Peev2100ae72018-01-12 16:56:25 +0000483 * <p>Returns a subset of {@link #getAvailableCaptureRequestKeys} keys that can
koprivadebd4ee2018-09-13 10:59:46 -0700484 * be overridden for physical devices backing a logical multi-camera.</p>
Emilian Peev2100ae72018-01-12 16:56:25 +0000485 *
486 * <p>This is a subset of android.request.availableRequestKeys which contains a list
koprivadebd4ee2018-09-13 10:59:46 -0700487 * of keys that can be overridden using {@link CaptureRequest.Builder#setPhysicalCameraKey }.
Emilian Peev2100ae72018-01-12 16:56:25 +0000488 * The respective value of such request key can be obtained by calling
489 * {@link CaptureRequest.Builder#getPhysicalCameraKey }. Capture requests that contain
490 * individual physical device requests must be built via
491 * {@link android.hardware.camera2.CameraDevice#createCaptureRequest(int, Set)}.
492 * Such extended capture requests can be passed only to
493 * {@link CameraCaptureSession#capture } or {@link CameraCaptureSession#captureBurst } and
494 * not to {@link CameraCaptureSession#setRepeatingRequest } or
495 * {@link CameraCaptureSession#setRepeatingBurst }.</p>
496 *
497 * <p>The list returned is not modifiable, so any attempts to modify it will throw
498 * a {@code UnsupportedOperationException}.</p>
499 *
500 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
501 *
koprivadebd4ee2018-09-13 10:59:46 -0700502 * @return List of keys that can be overridden in individual physical device requests.
Emilian Peev2100ae72018-01-12 16:56:25 +0000503 * In case the camera device doesn't support such keys the list can be null.
504 */
505 @SuppressWarnings({"unchecked"})
506 public List<CaptureRequest.Key<?>> getAvailablePhysicalCameraRequestKeys() {
Emilian Peevf60f4fb2018-02-08 17:40:48 +0000507 if (mAvailablePhysicalRequestKeys == null) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000508 Object crKey = CaptureRequest.Key.class;
509 Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
510
511 int[] filterTags = get(REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS);
512 if (filterTags == null) {
513 return null;
514 }
515 mAvailablePhysicalRequestKeys =
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100516 getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags,
517 /*includeSynthetic*/ false);
Emilian Peev2100ae72018-01-12 16:56:25 +0000518 }
519 return mAvailablePhysicalRequestKeys;
520 }
521
522 /**
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700523 * Returns the list of keys supported by this {@link CameraDevice} for querying
524 * with a {@link CaptureRequest}.
525 *
526 * <p>The list returned is not modifiable, so any attempts to modify it will throw
527 * a {@code UnsupportedOperationException}.</p>
528 *
529 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
530 *
Igor Murashkin68f40062013-09-10 12:15:54 -0700531 * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700532 * {@link #getKeys()} instead.</p>
533 *
534 * @return List of keys supported by this CameraDevice for CaptureRequests.
535 */
Igor Murashkind6d65152014-05-19 16:31:02 -0700536 @SuppressWarnings({"unchecked"})
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700537 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700538 public List<CaptureRequest.Key<?>> getAvailableCaptureRequestKeys() {
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700539 if (mAvailableRequestKeys == null) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700540 Object crKey = CaptureRequest.Key.class;
541 Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
542
Igor Murashkincc542a42014-06-25 11:52:23 -0700543 int[] filterTags = get(REQUEST_AVAILABLE_REQUEST_KEYS);
544 if (filterTags == null) {
545 throw new AssertionError("android.request.availableRequestKeys must be non-null "
546 + "in the characteristics");
547 }
548 mAvailableRequestKeys =
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100549 getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags,
550 /*includeSynthetic*/ true);
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700551 }
552 return mAvailableRequestKeys;
553 }
554
555 /**
556 * Returns the list of keys supported by this {@link CameraDevice} for querying
557 * with a {@link CaptureResult}.
558 *
559 * <p>The list returned is not modifiable, so any attempts to modify it will throw
560 * a {@code UnsupportedOperationException}.</p>
561 *
562 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
563 *
Igor Murashkin68f40062013-09-10 12:15:54 -0700564 * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700565 * {@link #getKeys()} instead.</p>
566 *
567 * @return List of keys supported by this CameraDevice for CaptureResults.
568 */
Igor Murashkind6d65152014-05-19 16:31:02 -0700569 @SuppressWarnings({"unchecked"})
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700570 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700571 public List<CaptureResult.Key<?>> getAvailableCaptureResultKeys() {
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700572 if (mAvailableResultKeys == null) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700573 Object crKey = CaptureResult.Key.class;
574 Class<CaptureResult.Key<?>> crKeyTyped = (Class<CaptureResult.Key<?>>)crKey;
575
Igor Murashkincc542a42014-06-25 11:52:23 -0700576 int[] filterTags = get(REQUEST_AVAILABLE_RESULT_KEYS);
577 if (filterTags == null) {
578 throw new AssertionError("android.request.availableResultKeys must be non-null "
579 + "in the characteristics");
580 }
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100581 mAvailableResultKeys = getAvailableKeyList(CaptureResult.class, crKeyTyped, filterTags,
582 /*includeSynthetic*/ true);
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700583 }
584 return mAvailableResultKeys;
585 }
586
587 /**
588 * Returns the list of keys supported by this {@link CameraDevice} by metadataClass.
589 *
590 * <p>The list returned is not modifiable, so any attempts to modify it will throw
591 * a {@code UnsupportedOperationException}.</p>
592 *
593 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
594 *
595 * @param metadataClass The subclass of CameraMetadata that you want to get the keys for.
Igor Murashkind6d65152014-05-19 16:31:02 -0700596 * @param keyClass The class of the metadata key, e.g. CaptureRequest.Key.class
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100597 * @param filterTags An array of tags to be used for filtering
598 * @param includeSynthetic Include public syntethic tag by default.
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700599 *
600 * @return List of keys supported by this CameraDevice for metadataClass.
601 *
602 * @throws IllegalArgumentException if metadataClass is not a subclass of CameraMetadata
603 */
Igor Murashkind6d65152014-05-19 16:31:02 -0700604 private <TKey> List<TKey>
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100605 getAvailableKeyList(Class<?> metadataClass, Class<TKey> keyClass, int[] filterTags,
606 boolean includeSynthetic) {
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700607
608 if (metadataClass.equals(CameraMetadata.class)) {
609 throw new AssertionError(
610 "metadataClass must be a strict subclass of CameraMetadata");
611 } else if (!CameraMetadata.class.isAssignableFrom(metadataClass)) {
612 throw new AssertionError(
613 "metadataClass must be a subclass of CameraMetadata");
614 }
615
Emilian Peevde62d842017-03-23 19:20:40 +0000616 List<TKey> staticKeyList = getKeys(
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100617 metadataClass, keyClass, /*instance*/null, filterTags, includeSynthetic);
Igor Murashkind6d65152014-05-19 16:31:02 -0700618 return Collections.unmodifiableList(staticKeyList);
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700619 }
620
Shuzhen Wang23d29382017-11-26 17:24:56 -0800621 /**
Shuzhen Wangbde13972018-03-19 10:30:45 -0700622 * Returns the set of physical camera ids that this logical {@link CameraDevice} is
Shuzhen Wang23d29382017-11-26 17:24:56 -0800623 * made up of.
624 *
625 * <p>A camera device is a logical camera if it has
626 * REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA capability. If the camera device
Shuzhen Wangbde13972018-03-19 10:30:45 -0700627 * doesn't have the capability, the return value will be an empty set. </p>
Shuzhen Wang23d29382017-11-26 17:24:56 -0800628 *
Shuzhen Wang123deefc2018-08-20 12:00:05 -0700629 * <p>Prior to API level 29, all returned IDs are guaranteed to be returned by {@link
630 * CameraManager#getCameraIdList}, and can be opened directly by
631 * {@link CameraManager#openCamera}. Starting from API level 29, for each of the returned ID,
632 * if it's also returned by {@link CameraManager#getCameraIdList}, it can be used as a
633 * standalone camera by {@link CameraManager#openCamera}. Otherwise, the camera ID can only be
634 * used as part of the current logical camera.</p>
635 *
Shuzhen Wangbde13972018-03-19 10:30:45 -0700636 * <p>The set returned is not modifiable, so any attempts to modify it will throw
Shuzhen Wang23d29382017-11-26 17:24:56 -0800637 * a {@code UnsupportedOperationException}.</p>
638 *
Shuzhen Wangbde13972018-03-19 10:30:45 -0700639 * @return Set of physical camera ids for this logical camera device.
Shuzhen Wang23d29382017-11-26 17:24:56 -0800640 */
641 @NonNull
Shuzhen Wangbde13972018-03-19 10:30:45 -0700642 public Set<String> getPhysicalCameraIds() {
Shuzhen Wang23d29382017-11-26 17:24:56 -0800643 int[] availableCapabilities = get(REQUEST_AVAILABLE_CAPABILITIES);
644 if (availableCapabilities == null) {
645 throw new AssertionError("android.request.availableCapabilities must be non-null "
646 + "in the characteristics");
647 }
648
649 if (!ArrayUtils.contains(availableCapabilities,
650 REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA)) {
Shuzhen Wangbde13972018-03-19 10:30:45 -0700651 return Collections.emptySet();
Shuzhen Wang23d29382017-11-26 17:24:56 -0800652 }
653 byte[] physicalCamIds = get(LOGICAL_MULTI_CAMERA_PHYSICAL_IDS);
654
655 String physicalCamIdString = null;
656 try {
657 physicalCamIdString = new String(physicalCamIds, "UTF-8");
658 } catch (java.io.UnsupportedEncodingException e) {
659 throw new AssertionError("android.logicalCam.physicalIds must be UTF-8 string");
660 }
Shuzhen Wangbde13972018-03-19 10:30:45 -0700661 String[] physicalCameraIdArray = physicalCamIdString.split("\0");
Shuzhen Wang23d29382017-11-26 17:24:56 -0800662
Shuzhen Wangbde13972018-03-19 10:30:45 -0700663 return Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(physicalCameraIdArray)));
Shuzhen Wang23d29382017-11-26 17:24:56 -0800664 }
665
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700666 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
667 * The key entries below this point are generated from metadata
668 * definitions in /system/media/camera/docs. Do not modify by hand or
669 * modify the comment blocks at the start or end.
670 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800671
672 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700673 * <p>List of aberration correction modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode} that are
674 * supported by this camera device.</p>
675 * <p>This key lists the valid modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}. If no
676 * aberration correction modes are available for a device, this list will solely include
Yin-Chia Yeh941aac02015-01-06 10:32:47 -0800677 * OFF mode. All camera devices will support either OFF or FAST mode.</p>
678 * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always list
679 * OFF mode. This includes all FULL level devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700680 * <p>LEGACY devices will always only support FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700681 * <p><b>Range of valid values:</b><br>
682 * Any value listed in {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700683 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700684 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700685 * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
Zhijun Hea05e59d2014-07-08 18:27:47 -0700686 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700687 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800688 @NonNull
Zhijun He9e4e4392014-08-18 11:12:32 -0700689 public static final Key<int[]> COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES =
690 new Key<int[]>("android.colorCorrection.availableAberrationModes", int[].class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700691
692 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700693 * <p>List of auto-exposure antibanding modes for {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} that are
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800694 * supported by this camera device.</p>
695 * <p>Not all of the auto-exposure anti-banding modes may be
696 * supported by a given camera device. This field lists the
697 * valid anti-banding modes that the application may request
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700698 * for this camera device with the
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800699 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} control.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700700 * <p><b>Range of valid values:</b><br>
701 * Any value listed in {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700702 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700703 *
704 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800705 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700706 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800707 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700708 public static final Key<int[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES =
709 new Key<int[]>("android.control.aeAvailableAntibandingModes", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800710
711 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700712 * <p>List of auto-exposure modes for {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} that are supported by this camera
713 * device.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800714 * <p>Not all the auto-exposure modes may be supported by a
715 * given camera device, especially if no flash unit is
716 * available. This entry lists the valid modes for
717 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} for this camera device.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700718 * <p>All camera devices support ON, and all camera devices with flash
719 * units support ON_AUTO_FLASH and ON_ALWAYS_FLASH.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -0800720 * <p>FULL mode camera devices always support OFF mode,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800721 * which enables application control of camera exposure time,
722 * sensitivity, and frame duration.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700723 * <p>LEGACY mode camera devices never support OFF mode.
724 * LIMITED mode devices support OFF if they support the MANUAL_SENSOR
725 * capability.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700726 * <p><b>Range of valid values:</b><br>
727 * Any value listed in {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700728 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800729 *
730 * @see CaptureRequest#CONTROL_AE_MODE
731 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700732 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800733 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700734 public static final Key<int[]> CONTROL_AE_AVAILABLE_MODES =
735 new Key<int[]>("android.control.aeAvailableModes", int[].class);
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800736
737 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700738 * <p>List of frame rate ranges for {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} supported by
739 * this camera device.</p>
Yin-Chia Yeh58551622015-05-21 11:27:06 -0700740 * <p>For devices at the LEGACY level or above:</p>
741 * <ul>
Yin-Chia Yeh5fdf0a12015-11-20 15:39:36 -0800742 * <li>
743 * <p>For constant-framerate recording, for each normal
744 * {@link android.media.CamcorderProfile CamcorderProfile}, that is, a
Yin-Chia Yeh58551622015-05-21 11:27:06 -0700745 * {@link android.media.CamcorderProfile CamcorderProfile} that has
746 * {@link android.media.CamcorderProfile#quality quality} in
747 * the range [{@link android.media.CamcorderProfile#QUALITY_LOW QUALITY_LOW},
748 * {@link android.media.CamcorderProfile#QUALITY_2160P QUALITY_2160P}], if the profile is
749 * supported by the device and has
750 * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code>, this list will
Yin-Chia Yeh5fdf0a12015-11-20 15:39:36 -0800751 * always include (<code>x</code>,<code>x</code>).</p>
752 * </li>
753 * <li>
754 * <p>Also, a camera device must either not support any
755 * {@link android.media.CamcorderProfile CamcorderProfile},
756 * or support at least one
757 * normal {@link android.media.CamcorderProfile CamcorderProfile} that has
758 * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code> &gt;= 24.</p>
759 * </li>
Yin-Chia Yeh58551622015-05-21 11:27:06 -0700760 * </ul>
761 * <p>For devices at the LIMITED level or above:</p>
762 * <ul>
763 * <li>For YUV_420_888 burst capture use case, this list will always include (<code>min</code>, <code>max</code>)
764 * and (<code>max</code>, <code>max</code>) where <code>min</code> &lt;= 15 and <code>max</code> = the maximum output frame rate of the
765 * maximum YUV_420_888 output size.</li>
766 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700767 * <p><b>Units</b>: Frames per second (FPS)</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700768 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700769 *
770 * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800771 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700772 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800773 @NonNull
Igor Murashkin78712a82014-05-27 18:32:18 -0700774 public static final Key<android.util.Range<Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES =
775 new Key<android.util.Range<Integer>[]>("android.control.aeAvailableTargetFpsRanges", new TypeReference<android.util.Range<Integer>[]>() {{ }});
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800776
777 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700778 * <p>Maximum and minimum exposure compensation values for
779 * {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}, in counts of {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep},
780 * that are supported by this camera device.</p>
781 * <p><b>Range of valid values:</b><br></p>
Zhijun Hef1745ce2015-02-04 13:55:14 -0800782 * <p>Range [0,0] indicates that exposure compensation is not supported.</p>
783 * <p>For LIMITED and FULL devices, range must follow below requirements if exposure
784 * compensation is supported (<code>range != [0, 0]</code>):</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700785 * <p><code>Min.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &lt;= -2 EV</code></p>
786 * <p><code>Max.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &gt;= 2 EV</code></p>
Zhijun Hef1745ce2015-02-04 13:55:14 -0800787 * <p>LEGACY devices may support a smaller range than this.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700788 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800789 *
790 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700791 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800792 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700793 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800794 @NonNull
Igor Murashkin78712a82014-05-27 18:32:18 -0700795 public static final Key<android.util.Range<Integer>> CONTROL_AE_COMPENSATION_RANGE =
796 new Key<android.util.Range<Integer>>("android.control.aeCompensationRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800797
798 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700799 * <p>Smallest step by which the exposure compensation
800 * can be changed.</p>
801 * <p>This is the unit for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}. For example, if this key has
802 * a value of <code>1/2</code>, then a setting of <code>-2</code> for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} means
803 * that the target EV offset for the auto-exposure routine is -1 EV.</p>
804 * <p>One unit of EV compensation changes the brightness of the captured image by a factor
805 * of two. +1 EV doubles the image brightness, while -1 EV halves the image brightness.</p>
806 * <p><b>Units</b>: Exposure Value (EV)</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700807 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700808 *
809 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800810 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700811 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800812 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700813 public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP =
814 new Key<Rational>("android.control.aeCompensationStep", Rational.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800815
816 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700817 * <p>List of auto-focus (AF) modes for {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} that are
818 * supported by this camera device.</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800819 * <p>Not all the auto-focus modes may be supported by a
820 * given camera device. This entry lists the valid modes for
821 * {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} for this camera device.</p>
Ruben Brunk6f387092014-09-22 16:13:54 -0700822 * <p>All LIMITED and FULL mode camera devices will support OFF mode, and all
823 * camera devices with adjustable focuser units
824 * (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>) will support AUTO mode.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700825 * <p>LEGACY devices will support OFF mode only if they support
826 * focusing to infinity (by also setting {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} to
827 * <code>0.0f</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700828 * <p><b>Range of valid values:</b><br>
829 * Any value listed in {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700830 * <p>This key is available on all devices.</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800831 *
832 * @see CaptureRequest#CONTROL_AF_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700833 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Zhijun He78146ec2014-01-14 18:12:13 -0800834 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800835 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700836 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800837 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700838 public static final Key<int[]> CONTROL_AF_AVAILABLE_MODES =
839 new Key<int[]>("android.control.afAvailableModes", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800840
841 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700842 * <p>List of color effects for {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode} that are supported by this camera
843 * device.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800844 * <p>This list contains the color effect modes that can be applied to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700845 * images produced by the camera device.
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800846 * Implementations are not expected to be consistent across all devices.
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700847 * If no color effect modes are available for a device, this will only list
848 * OFF.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800849 * <p>A color effect will only be applied if
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700850 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF. OFF is always included in this list.</p>
851 * <p>This control has no effect on the operation of other control routines such
852 * as auto-exposure, white balance, or focus.</p>
853 * <p><b>Range of valid values:</b><br>
854 * Any value listed in {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700855 * <p>This key is available on all devices.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800856 *
857 * @see CaptureRequest#CONTROL_EFFECT_MODE
858 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700859 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700860 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800861 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700862 public static final Key<int[]> CONTROL_AVAILABLE_EFFECTS =
863 new Key<int[]>("android.control.availableEffects", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700864
865 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700866 * <p>List of scene modes for {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} that are supported by this camera
867 * device.</p>
Ruben Brunk8237d342014-01-17 15:33:02 -0800868 * <p>This list contains scene modes that can be set for the camera device.
869 * Only scene modes that have been fully implemented for the
870 * camera device may be included here. Implementations are not expected
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700871 * to be consistent across all devices.</p>
872 * <p>If no scene modes are supported by the camera device, this
873 * will be set to DISABLED. Otherwise DISABLED will not be listed.</p>
874 * <p>FACE_PRIORITY is always listed if face detection is
875 * supported (i.e.<code>{@link CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT android.statistics.info.maxFaceCount} &gt;
876 * 0</code>).</p>
877 * <p><b>Range of valid values:</b><br>
878 * Any value listed in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700879 * <p>This key is available on all devices.</p>
Ruben Brunk8237d342014-01-17 15:33:02 -0800880 *
881 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700882 * @see CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700883 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700884 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800885 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700886 public static final Key<int[]> CONTROL_AVAILABLE_SCENE_MODES =
887 new Key<int[]>("android.control.availableSceneModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700888
889 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700890 * <p>List of video stabilization modes for {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}
891 * that are supported by this camera device.</p>
892 * <p>OFF will always be listed.</p>
893 * <p><b>Range of valid values:</b><br>
894 * Any value listed in {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700895 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700896 *
897 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700898 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700899 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800900 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700901 public static final Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES =
902 new Key<int[]>("android.control.availableVideoStabilizationModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700903
904 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700905 * <p>List of auto-white-balance modes for {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} that are supported by this
906 * camera device.</p>
Zhijun He399f05d2014-01-15 11:31:30 -0800907 * <p>Not all the auto-white-balance modes may be supported by a
908 * given camera device. This entry lists the valid modes for
909 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} for this camera device.</p>
910 * <p>All camera devices will support ON mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700911 * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always support OFF
912 * mode, which enables application control of white balance, by using
913 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}({@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} must be set to TRANSFORM_MATRIX). This includes all FULL
914 * mode camera devices.</p>
915 * <p><b>Range of valid values:</b><br>
916 * Any value listed in {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700917 * <p>This key is available on all devices.</p>
Zhijun He399f05d2014-01-15 11:31:30 -0800918 *
Zhijun He399f05d2014-01-15 11:31:30 -0800919 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800920 * @see CaptureRequest#COLOR_CORRECTION_MODE
921 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
922 * @see CaptureRequest#CONTROL_AWB_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700923 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700924 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800925 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700926 public static final Key<int[]> CONTROL_AWB_AVAILABLE_MODES =
927 new Key<int[]>("android.control.awbAvailableModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700928
929 /**
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800930 * <p>List of the maximum number of regions that can be used for metering in
931 * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
932 * this corresponds to the the maximum number of elements in
933 * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}, {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions},
934 * and {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700935 * <p><b>Range of valid values:</b><br></p>
936 * <p>Value must be &gt;= 0 for each element. For full-capability devices
937 * this value must be &gt;= 1 for AE and AF. The order of the elements is:
938 * <code>(AE, AWB, AF)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700939 * <p>This key is available on all devices.</p>
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800940 *
941 * @see CaptureRequest#CONTROL_AE_REGIONS
942 * @see CaptureRequest#CONTROL_AF_REGIONS
943 * @see CaptureRequest#CONTROL_AWB_REGIONS
Igor Murashkin78712a82014-05-27 18:32:18 -0700944 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700945 */
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800946 public static final Key<int[]> CONTROL_MAX_REGIONS =
947 new Key<int[]>("android.control.maxRegions", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700948
949 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700950 * <p>The maximum number of metering regions that can be used by the auto-exposure (AE)
951 * routine.</p>
952 * <p>This corresponds to the the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700953 * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700954 * <p><b>Range of valid values:</b><br>
955 * Value will be &gt;= 0. For FULL-capability devices, this
956 * value will be &gt;= 1.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700957 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700958 *
959 * @see CaptureRequest#CONTROL_AE_REGIONS
960 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700961 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800962 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -0700963 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700964 public static final Key<Integer> CONTROL_MAX_REGIONS_AE =
965 new Key<Integer>("android.control.maxRegionsAe", int.class);
966
967 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700968 * <p>The maximum number of metering regions that can be used by the auto-white balance (AWB)
969 * routine.</p>
970 * <p>This corresponds to the the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700971 * {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700972 * <p><b>Range of valid values:</b><br>
973 * Value will be &gt;= 0.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700974 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700975 *
976 * @see CaptureRequest#CONTROL_AWB_REGIONS
977 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700978 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800979 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -0700980 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700981 public static final Key<Integer> CONTROL_MAX_REGIONS_AWB =
982 new Key<Integer>("android.control.maxRegionsAwb", int.class);
983
984 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700985 * <p>The maximum number of metering regions that can be used by the auto-focus (AF) routine.</p>
986 * <p>This corresponds to the the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700987 * {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700988 * <p><b>Range of valid values:</b><br>
989 * Value will be &gt;= 0. For FULL-capability devices, this
990 * value will be &gt;= 1.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700991 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700992 *
993 * @see CaptureRequest#CONTROL_AF_REGIONS
994 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700995 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800996 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -0700997 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700998 public static final Key<Integer> CONTROL_MAX_REGIONS_AF =
999 new Key<Integer>("android.control.maxRegionsAf", int.class);
1000
1001 /**
Zhijun Hefab663e2015-05-26 19:46:31 -07001002 * <p>List of available high speed video size, fps range and max batch size configurations
1003 * supported by the camera device, in the format of (width, height, fps_min, fps_max, batch_size_max).</p>
Zhijun He3c1ff682015-06-23 09:21:43 -07001004 * <p>When CONSTRAINED_HIGH_SPEED_VIDEO is supported in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities},
Zhijun Hefab663e2015-05-26 19:46:31 -07001005 * this metadata will list the supported high speed video size, fps range and max batch size
1006 * configurations. All the sizes listed in this configuration will be a subset of the sizes
1007 * reported by {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes }
1008 * for processed non-stalling formats.</p>
1009 * <p>For the high speed video use case, the application must
Zhijun Hee0404182014-06-26 13:17:09 -07001010 * select the video size and fps range from this metadata to configure the recording and
1011 * preview streams and setup the recording requests. For example, if the application intends
1012 * to do high speed recording, it can select the maximum size reported by this metadata to
1013 * configure output streams. Once the size is selected, application can filter this metadata
1014 * by selected size and get the supported fps ranges, and use these fps ranges to setup the
Yin-Chia Yeh12da1402014-07-15 10:37:31 -07001015 * recording requests. Note that for the use case of multiple output streams, application
Zhijun Hefab663e2015-05-26 19:46:31 -07001016 * must select one unique size from this metadata to use (e.g., preview and recording streams
1017 * must have the same size). Otherwise, the high speed capture session creation will fail.</p>
1018 * <p>The min and max fps will be multiple times of 30fps.</p>
1019 * <p>High speed video streaming extends significant performance pressue to camera hardware,
1020 * to achieve efficient high speed streaming, the camera device may have to aggregate
1021 * multiple frames together and send to camera device for processing where the request
1022 * controls are same for all the frames in this batch. Max batch size indicates
1023 * the max possible number of frames the camera device will group together for this high
1024 * speed stream configuration. This max batch size will be used to generate a high speed
1025 * recording request list by
Eino-Ville Talvala639fffe2015-06-30 10:34:48 -07001026 * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList }.
Zhijun Hefab663e2015-05-26 19:46:31 -07001027 * The max batch size for each configuration will satisfy below conditions:</p>
1028 * <ul>
1029 * <li>Each max batch size will be a divisor of its corresponding fps_max / 30. For example,
1030 * if max_fps is 300, max batch size will only be 1, 2, 5, or 10.</li>
1031 * <li>The camera device may choose smaller internal batch size for each configuration, but
1032 * the actual batch size will be a divisor of max batch size. For example, if the max batch
1033 * size is 8, the actual batch size used by camera device will only be 1, 2, 4, or 8.</li>
1034 * <li>The max batch size in each configuration entry must be no larger than 32.</li>
1035 * </ul>
1036 * <p>The camera device doesn't have to support batch mode to achieve high speed video recording,
1037 * in such case, batch_size_max will be reported as 1 in each configuration entry.</p>
1038 * <p>This fps ranges in this configuration list can only be used to create requests
1039 * that are submitted to a high speed camera capture session created by
1040 * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }.
1041 * The fps ranges reported in this metadata must not be used to setup capture requests for
1042 * normal capture session, or it will cause request error.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001043 * <p><b>Range of valid values:</b><br></p>
Zhijun Hefab663e2015-05-26 19:46:31 -07001044 * <p>For each configuration, the fps_max &gt;= 120fps.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001045 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001046 * <p><b>Limited capability</b> -
1047 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1048 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hee0404182014-06-26 13:17:09 -07001049 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001050 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He3c1ff682015-06-23 09:21:43 -07001051 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Zhijun Hee0404182014-06-26 13:17:09 -07001052 * @hide
1053 */
Yin-Chia Yeh12da1402014-07-15 10:37:31 -07001054 public static final Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]> CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS =
1055 new Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]>("android.control.availableHighSpeedVideoConfigurations", android.hardware.camera2.params.HighSpeedVideoConfiguration[].class);
Zhijun Hee0404182014-06-26 13:17:09 -07001056
1057 /**
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001058 * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</p>
Yin-Chia Yeh7e3e4312015-04-02 14:34:30 -07001059 * <p>Devices with MANUAL_SENSOR capability or BURST_CAPTURE capability will always
1060 * list <code>true</code>. This includes FULL devices.</p>
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001061 * <p>This key is available on all devices.</p>
1062 *
1063 * @see CaptureRequest#CONTROL_AE_LOCK
1064 */
1065 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001066 @NonNull
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001067 public static final Key<Boolean> CONTROL_AE_LOCK_AVAILABLE =
1068 new Key<Boolean>("android.control.aeLockAvailable", boolean.class);
1069
1070 /**
1071 * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</p>
Yin-Chia Yeh7e3e4312015-04-02 14:34:30 -07001072 * <p>Devices with MANUAL_POST_PROCESSING capability or BURST_CAPTURE capability will
1073 * always list <code>true</code>. This includes FULL devices.</p>
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001074 * <p>This key is available on all devices.</p>
1075 *
1076 * @see CaptureRequest#CONTROL_AWB_LOCK
1077 */
1078 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001079 @NonNull
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001080 public static final Key<Boolean> CONTROL_AWB_LOCK_AVAILABLE =
1081 new Key<Boolean>("android.control.awbLockAvailable", boolean.class);
1082
1083 /**
1084 * <p>List of control modes for {@link CaptureRequest#CONTROL_MODE android.control.mode} that are supported by this camera
1085 * device.</p>
1086 * <p>This list contains control modes that can be set for the camera device.
1087 * LEGACY mode devices will always support AUTO mode. LIMITED and FULL
1088 * devices will always support OFF, AUTO modes.</p>
1089 * <p><b>Range of valid values:</b><br>
1090 * Any value listed in {@link CaptureRequest#CONTROL_MODE android.control.mode}</p>
1091 * <p>This key is available on all devices.</p>
1092 *
1093 * @see CaptureRequest#CONTROL_MODE
1094 */
1095 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001096 @NonNull
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001097 public static final Key<int[]> CONTROL_AVAILABLE_MODES =
1098 new Key<int[]>("android.control.availableModes", int[].class);
1099
1100 /**
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08001101 * <p>Range of boosts for {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} supported
1102 * by this camera device.</p>
1103 * <p>Devices support post RAW sensitivity boost will advertise
1104 * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} key for controling
1105 * post RAW sensitivity boost.</p>
1106 * <p>This key will be <code>null</code> for devices that do not support any RAW format
1107 * outputs. For devices that do support RAW format outputs, this key will always
1108 * present, and if a device does not support post RAW sensitivity boost, it will
1109 * list <code>(100, 100)</code> in this key.</p>
1110 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001111 * <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 -08001112 *
1113 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
1114 * @see CaptureRequest#SENSOR_SENSITIVITY
1115 */
1116 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001117 @NonNull
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08001118 public static final Key<android.util.Range<Integer>> CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE =
1119 new Key<android.util.Range<Integer>>("android.control.postRawSensitivityBoostRange", new TypeReference<android.util.Range<Integer>>() {{ }});
1120
1121 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001122 * <p>List of edge enhancement modes for {@link CaptureRequest#EDGE_MODE android.edge.mode} that are supported by this camera
1123 * device.</p>
Chien-Yu Chen72333912015-07-08 11:55:19 -07001124 * <p>Full-capability camera devices must always support OFF; camera devices that support
1125 * YUV_REPROCESSING or PRIVATE_REPROCESSING will list ZERO_SHUTTER_LAG; all devices will
1126 * list FAST.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001127 * <p><b>Range of valid values:</b><br>
1128 * Any value listed in {@link CaptureRequest#EDGE_MODE android.edge.mode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001129 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001130 * <p><b>Full capability</b> -
1131 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1132 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001133 *
1134 * @see CaptureRequest#EDGE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001135 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001136 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001137 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001138 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001139 public static final Key<int[]> EDGE_AVAILABLE_EDGE_MODES =
1140 new Key<int[]>("android.edge.availableEdgeModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001141
1142 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08001143 * <p>Whether this camera device has a
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001144 * flash unit.</p>
1145 * <p>Will be <code>false</code> if no flash is available.</p>
1146 * <p>If there is no flash unit, none of the flash controls do
1147 * anything.
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001148 * This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001149 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001150 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001151 @NonNull
Zhijun Heca1b73a2014-02-03 12:39:53 -08001152 public static final Key<Boolean> FLASH_INFO_AVAILABLE =
1153 new Key<Boolean>("android.flash.info.available", boolean.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001154
1155 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001156 * <p>List of hot pixel correction modes for {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode} that are supported by this
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001157 * camera device.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001158 * <p>FULL mode camera devices will always support FAST.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001159 * <p><b>Range of valid values:</b><br>
1160 * Any value listed in {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001161 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001162 *
1163 * @see CaptureRequest#HOT_PIXEL_MODE
1164 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001165 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001166 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001167 public static final Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES =
1168 new Key<int[]>("android.hotPixel.availableHotPixelModes", int[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001169
1170 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001171 * <p>List of JPEG thumbnail sizes for {@link CaptureRequest#JPEG_THUMBNAIL_SIZE android.jpeg.thumbnailSize} supported by this
1172 * camera device.</p>
1173 * <p>This list will include at least one non-zero resolution, plus <code>(0,0)</code> for indicating no
1174 * thumbnail should be generated.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001175 * <p>Below condiditions will be satisfied for this size list:</p>
Zhijun He5a9ff372013-12-26 11:49:09 -08001176 * <ul>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001177 * <li>The sizes will be sorted by increasing pixel area (width x height).
1178 * If several resolutions have the same area, they will be sorted by increasing width.</li>
1179 * <li>The aspect ratio of the largest thumbnail size will be same as the
Igor Murashkin9c595172014-05-12 13:56:20 -07001180 * aspect ratio of largest JPEG output size in android.scaler.availableStreamConfigurations.
Zhijun He5a9ff372013-12-26 11:49:09 -08001181 * The largest size is defined as the size that has the largest pixel area
1182 * in a given size list.</li>
Igor Murashkin9c595172014-05-12 13:56:20 -07001183 * <li>Each output JPEG size in android.scaler.availableStreamConfigurations will have at least
Zhijun He5a9ff372013-12-26 11:49:09 -08001184 * one corresponding size that has the same aspect ratio in availableThumbnailSizes,
1185 * and vice versa.</li>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08001186 * <li>All non-<code>(0, 0)</code> sizes will have non-zero widths and heights.</li>
Zhijun He5a9ff372013-12-26 11:49:09 -08001187 * </ul>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08001188 * <p>This list is also used as supported thumbnail sizes for HEIC image format capture.</p>
1189 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001190 *
1191 * @see CaptureRequest#JPEG_THUMBNAIL_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001192 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001193 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001194 @NonNull
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001195 public static final Key<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES =
1196 new Key<android.util.Size[]>("android.jpeg.availableThumbnailSizes", android.util.Size[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001197
1198 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001199 * <p>List of aperture size values for {@link CaptureRequest#LENS_APERTURE android.lens.aperture} that are
1200 * supported by this camera device.</p>
1201 * <p>If the camera device doesn't support a variable lens aperture,
1202 * this list will contain only one value, which is the fixed aperture size.</p>
1203 * <p>If the camera device supports a variable aperture, the aperture values
Zhijun Hefb46c642014-01-14 17:57:23 -08001204 * in this list will be sorted in ascending order.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001205 * <p><b>Units</b>: The aperture f-number</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001206 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001207 * <p><b>Full capability</b> -
1208 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1209 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1210 *
1211 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001212 * @see CaptureRequest#LENS_APERTURE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001213 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001214 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001215 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001216 public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES =
1217 new Key<float[]>("android.lens.info.availableApertures", float[].class);
1218
1219 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001220 * <p>List of neutral density filter values for
1221 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} that are supported by this camera device.</p>
1222 * <p>If a neutral density filter is not supported by this camera device,
1223 * this list will contain only 0. Otherwise, this list will include every
1224 * filter density supported by the camera device, in ascending order.</p>
1225 * <p><b>Units</b>: Exposure value (EV)</p>
1226 * <p><b>Range of valid values:</b><br></p>
1227 * <p>Values are &gt;= 0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001228 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001229 * <p><b>Full capability</b> -
1230 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1231 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001232 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001233 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08001234 * @see CaptureRequest#LENS_FILTER_DENSITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001235 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001236 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001237 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001238 public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES =
1239 new Key<float[]>("android.lens.info.availableFilterDensities", float[].class);
1240
1241 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001242 * <p>List of focal lengths for {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength} that are supported by this camera
1243 * device.</p>
1244 * <p>If optical zoom is not supported, this list will only contain
1245 * a single value corresponding to the fixed focal length of the
1246 * device. Otherwise, this list will include every focal length supported
1247 * by the camera device, in ascending order.</p>
1248 * <p><b>Units</b>: Millimeters</p>
1249 * <p><b>Range of valid values:</b><br></p>
1250 * <p>Values are &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001251 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08001252 *
1253 * @see CaptureRequest#LENS_FOCAL_LENGTH
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001254 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001255 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001256 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001257 public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS =
1258 new Key<float[]>("android.lens.info.availableFocalLengths", float[].class);
1259
1260 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001261 * <p>List of optical image stabilization (OIS) modes for
1262 * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} that are supported by this camera device.</p>
1263 * <p>If OIS is not supported by a given camera device, this list will
Ruben Brunk00849b32014-01-17 18:30:23 -08001264 * contain only OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001265 * <p><b>Range of valid values:</b><br>
1266 * Any value listed in {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001267 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001268 * <p><b>Limited capability</b> -
1269 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1270 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk00849b32014-01-17 18:30:23 -08001271 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001272 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk00849b32014-01-17 18:30:23 -08001273 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001274 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001275 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001276 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001277 public static final Key<int[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION =
1278 new Key<int[]>("android.lens.info.availableOpticalStabilization", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001279
1280 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001281 * <p>Hyperfocal distance for this lens.</p>
Zhijun Heff413932014-02-07 15:44:30 -08001282 * <p>If the lens is not fixed focus, the camera device will report this
1283 * field when {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} is APPROXIMATE or CALIBRATED.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001284 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1285 * <p><b>Range of valid values:</b><br>
1286 * If lens is fixed focus, &gt;= 0. If lens has focuser unit, the value is
1287 * within <code>(0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001288 * <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 -07001289 * <p><b>Limited capability</b> -
1290 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1291 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001292 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001293 *
1294 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1295 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
1296 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1297 */
1298 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001299 @NonNull
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001300 public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE =
1301 new Key<Float>("android.lens.info.hyperfocalDistance", float.class);
1302
1303 /**
1304 * <p>Shortest distance from frontmost surface
1305 * of the lens that can be brought into sharp focus.</p>
1306 * <p>If the lens is fixed-focus, this will be
1307 * 0.</p>
1308 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1309 * <p><b>Range of valid values:</b><br>
1310 * &gt;= 0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001311 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001312 * <p><b>Limited capability</b> -
1313 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1314 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001315 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Zhijun Heff413932014-02-07 15:44:30 -08001316 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001317 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heff413932014-02-07 15:44:30 -08001318 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001319 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001320 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001321 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001322 public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE =
1323 new Key<Float>("android.lens.info.minimumFocusDistance", float.class);
1324
1325 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08001326 * <p>Dimensions of lens shading map.</p>
1327 * <p>The map should be on the order of 30-40 rows and columns, and
1328 * must be smaller than 64x64.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001329 * <p><b>Range of valid values:</b><br>
1330 * Both values &gt;= 1</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>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001332 * <p><b>Full capability</b> -
1333 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1334 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1335 *
1336 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07001337 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001338 */
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001339 public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
1340 new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001341
1342 /**
Zhijun Heff413932014-02-07 15:44:30 -08001343 * <p>The lens focus distance calibration quality.</p>
1344 * <p>The lens focus distance calibration quality determines the reliability of
1345 * focus related metadata entries, i.e. {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1346 * {@link CaptureResult#LENS_FOCUS_RANGE android.lens.focusRange}, {@link CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE android.lens.info.hyperfocalDistance}, and
1347 * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001348 * <p>APPROXIMATE and CALIBRATED devices report the focus metadata in
1349 * units of diopters (1/meter), so <code>0.0f</code> represents focusing at infinity,
1350 * and increasing positive numbers represent focusing closer and closer
1351 * to the camera device. The focus distance control also uses diopters
1352 * on these devices.</p>
1353 * <p>UNCALIBRATED devices do not use units that are directly comparable
1354 * to any real physical measurement, but <code>0.0f</code> still represents farthest
1355 * focus, and {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} represents the
1356 * nearest focus the device can achieve.</p>
1357 * <p><b>Possible values:</b>
1358 * <ul>
1359 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED UNCALIBRATED}</li>
1360 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE APPROXIMATE}</li>
1361 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED CALIBRATED}</li>
1362 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001363 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001364 * <p><b>Limited capability</b> -
1365 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1366 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heff413932014-02-07 15:44:30 -08001367 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001368 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heff413932014-02-07 15:44:30 -08001369 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1370 * @see CaptureResult#LENS_FOCUS_RANGE
1371 * @see CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE
1372 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1373 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED
1374 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE
1375 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED
1376 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001377 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001378 @NonNull
Zhijun Heff413932014-02-07 15:44:30 -08001379 public static final Key<Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION =
1380 new Key<Integer>("android.lens.info.focusDistanceCalibration", int.class);
1381
1382 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001383 * <p>Direction the camera faces relative to
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001384 * device screen.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001385 * <p><b>Possible values:</b>
1386 * <ul>
1387 * <li>{@link #LENS_FACING_FRONT FRONT}</li>
1388 * <li>{@link #LENS_FACING_BACK BACK}</li>
Zhijun He503e8152015-01-12 15:16:56 -08001389 * <li>{@link #LENS_FACING_EXTERNAL EXTERNAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001390 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001391 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001392 * @see #LENS_FACING_FRONT
1393 * @see #LENS_FACING_BACK
Zhijun He503e8152015-01-12 15:16:56 -08001394 * @see #LENS_FACING_EXTERNAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001395 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001396 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001397 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001398 public static final Key<Integer> LENS_FACING =
1399 new Key<Integer>("android.lens.facing", int.class);
1400
1401 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001402 * <p>The orientation of the camera relative to the sensor
1403 * coordinate system.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001404 * <p>The four coefficients that describe the quaternion
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001405 * rotation from the Android sensor coordinate system to a
1406 * camera-aligned coordinate system where the X-axis is
1407 * aligned with the long side of the image sensor, the Y-axis
1408 * is aligned with the short side of the image sensor, and
1409 * the Z-axis is aligned with the optical axis of the sensor.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001410 * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001411 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
1412 * amount <code>theta</code>, the following formulas can be used:</p>
1413 * <pre><code> theta = 2 * acos(w)
1414 * a_x = x / sin(theta/2)
1415 * a_y = y / sin(theta/2)
1416 * a_z = z / sin(theta/2)
1417 * </code></pre>
1418 * <p>To create a 3x3 rotation matrix that applies the rotation
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001419 * defined by this quaternion, the following matrix can be
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001420 * used:</p>
1421 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
1422 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
1423 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
1424 * </code></pre>
1425 * <p>This matrix can then be used to apply the rotation to a
1426 * column vector point with</p>
1427 * <p><code>p' = Rp</code></p>
1428 * <p>where <code>p</code> is in the device sensor coordinate system, and
1429 * <code>p'</code> is in the camera-oriented coordinate system.</p>
1430 * <p><b>Units</b>:
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001431 * Quaternion coefficients</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001432 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001433 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001434 */
1435 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001436 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001437 public static final Key<float[]> LENS_POSE_ROTATION =
1438 new Key<float[]>("android.lens.poseRotation", float[].class);
1439
1440 /**
1441 * <p>Position of the camera optical center.</p>
Eino-Ville Talvalad3dbfb32015-05-29 17:17:04 -07001442 * <p>The position of the camera device's lens optical center,
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001443 * as a three-dimensional vector <code>(x,y,z)</code>.</p>
1444 * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
1445 * is relative to the optical center of the largest camera device facing in the same
1446 * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
1447 * coordinate axes}. Note that only the axis definitions are shared with the sensor
1448 * coordinate system, but not the origin.</p>
1449 * <p>If this device is the largest or only camera device with a given facing, then this
1450 * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
1451 * from the main sensor along the +X axis (to the right from the user's perspective) will
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001452 * report <code>(0.03, 0, 0)</code>. Note that this means that, for many computer vision
1453 * applications, the position needs to be negated to convert it to a translation from the
1454 * camera to the origin.</p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001455 * <p>To transform a pixel coordinates between two cameras facing the same direction, first
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001456 * the source camera {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} must be corrected for. Then the source
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001457 * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
1458 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
1459 * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
1460 * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
1461 * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
1462 * coordinates.</p>
1463 * <p>To compare this against a real image from the destination camera, the destination camera
1464 * image then needs to be corrected for radial distortion before comparison or sampling.</p>
1465 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001466 * the center of the primary gyroscope on the device. The axis definitions are the same as
1467 * with PRIMARY_CAMERA.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001468 * <p><b>Units</b>: Meters</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001469 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001470 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001471 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001472 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001473 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001474 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001475 * @see CameraCharacteristics#LENS_POSE_ROTATION
1476 */
1477 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001478 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001479 public static final Key<float[]> LENS_POSE_TRANSLATION =
1480 new Key<float[]>("android.lens.poseTranslation", float[].class);
1481
1482 /**
1483 * <p>The parameters for this camera device's intrinsic
1484 * calibration.</p>
1485 * <p>The five calibration parameters that describe the
1486 * transform from camera-centric 3D coordinates to sensor
1487 * pixel coordinates:</p>
1488 * <pre><code>[f_x, f_y, c_x, c_y, s]
1489 * </code></pre>
1490 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
1491 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
1492 * axis, and <code>s</code> is a skew parameter for the sensor plane not
1493 * being aligned with the lens plane.</p>
1494 * <p>These are typically used within a transformation matrix K:</p>
1495 * <pre><code>K = [ f_x, s, c_x,
1496 * 0, f_y, c_y,
1497 * 0 0, 1 ]
1498 * </code></pre>
1499 * <p>which can then be combined with the camera pose rotation
1500 * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001501 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respectively) to calculate the
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001502 * complete transform from world coordinates to pixel
1503 * coordinates:</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001504 * <pre><code>P = [ K 0 * [ R -Rt
1505 * 0 1 ] 0 1 ]
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001506 * </code></pre>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001507 * <p>(Note the negation of poseTranslation when mapping from camera
1508 * to world coordinates, and multiplication by the rotation).</p>
1509 * <p>With <code>p_w</code> being a point in the world coordinate system
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001510 * and <code>p_s</code> being a point in the camera active pixel array
1511 * coordinate system, and with the mapping including the
1512 * homogeneous division by z:</p>
1513 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
1514 * p_s = p_h / z_h
1515 * </code></pre>
1516 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
1517 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
1518 * (depth) in pixel coordinates.</p>
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001519 * <p>Note that the coordinate system for this transform is the
1520 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
1521 * where <code>(0,0)</code> is the top-left of the
1522 * preCorrectionActiveArraySize rectangle. Once the pose and
1523 * intrinsic calibration transforms have been applied to a
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001524 * world point, then the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001525 * transform needs to be applied, and the result adjusted to
1526 * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
1527 * system (where <code>(0, 0)</code> is the top-left of the
1528 * activeArraySize rectangle), to determine the final pixel
1529 * coordinate of the world point for processed (non-RAW)
1530 * output buffers.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001531 * <p>For camera devices, the center of pixel <code>(x,y)</code> is located at
1532 * coordinate <code>(x + 0.5, y + 0.5)</code>. So on a device with a
1533 * precorrection active array of size <code>(10,10)</code>, the valid pixel
1534 * indices go from <code>(0,0)-(9,9)</code>, and an perfectly-built camera would
1535 * have an optical center at the exact center of the pixel grid, at
1536 * coordinates <code>(5.0, 5.0)</code>, which is the top-left corner of pixel
1537 * <code>(5,5)</code>.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001538 * <p><b>Units</b>:
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001539 * Pixels in the
1540 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1541 * coordinate system.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001542 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001543 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001544 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001545 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001546 * @see CameraCharacteristics#LENS_POSE_ROTATION
1547 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07001548 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001549 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001550 */
1551 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001552 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001553 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
1554 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
1555
1556 /**
1557 * <p>The correction coefficients to correct for this camera device's
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001558 * radial and tangential lens distortion.</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001559 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001560 * kappa_3]</code> and two tangential distortion coefficients
1561 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
1562 * lens's geometric distortion with the mapping equations:</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001563 * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001564 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001565 * y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001566 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001567 * </code></pre>
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001568 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
1569 * input image that correspond to the pixel values in the
1570 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
1571 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
1572 * </code></pre>
1573 * <p>The pixel coordinates are defined in a normalized
1574 * coordinate system related to the
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001575 * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001576 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
1577 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
1578 * of both x and y coordinates are normalized to be 1 at the
1579 * edge further from the optical center, so the range
1580 * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
1581 * <p>Finally, <code>r</code> represents the radial distance from the
1582 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
1583 * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
1584 * <p>The distortion model used is the Brown-Conrady model.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001585 * <p><b>Units</b>:
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001586 * Unitless coefficients.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001587 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001588 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001589 *
1590 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001591 * @deprecated
1592 * <p>This field was inconsistently defined in terms of its
1593 * normalization. Use {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} instead.</p>
1594 *
1595 * @see CameraCharacteristics#LENS_DISTORTION
1596
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001597 */
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001598 @Deprecated
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001599 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001600 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001601 public static final Key<float[]> LENS_RADIAL_DISTORTION =
1602 new Key<float[]>("android.lens.radialDistortion", float[].class);
1603
1604 /**
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001605 * <p>The origin for {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}.</p>
1606 * <p>Different calibration methods and use cases can produce better or worse results
1607 * depending on the selected coordinate origin.</p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001608 * <p><b>Possible values:</b>
1609 * <ul>
1610 * <li>{@link #LENS_POSE_REFERENCE_PRIMARY_CAMERA PRIMARY_CAMERA}</li>
1611 * <li>{@link #LENS_POSE_REFERENCE_GYROSCOPE GYROSCOPE}</li>
1612 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001613 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001614 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001615 *
1616 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
1617 * @see #LENS_POSE_REFERENCE_PRIMARY_CAMERA
1618 * @see #LENS_POSE_REFERENCE_GYROSCOPE
1619 */
1620 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001621 @NonNull
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001622 public static final Key<Integer> LENS_POSE_REFERENCE =
1623 new Key<Integer>("android.lens.poseReference", int.class);
1624
1625 /**
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001626 * <p>The correction coefficients to correct for this camera device's
1627 * radial and tangential lens distortion.</p>
1628 * <p>Replaces the deprecated {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} field, which was
1629 * inconsistently defined.</p>
1630 * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2,
1631 * kappa_3]</code> and two tangential distortion coefficients
1632 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
1633 * lens's geometric distortion with the mapping equations:</p>
1634 * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1635 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
1636 * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1637 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
1638 * </code></pre>
1639 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
1640 * input image that correspond to the pixel values in the
1641 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
1642 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
1643 * </code></pre>
1644 * <p>The pixel coordinates are defined in a coordinate system
1645 * related to the {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
1646 * calibration fields; see that entry for details of the mapping stages.
1647 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code>
1648 * have <code>(0,0)</code> at the lens optical center <code>[c_x, c_y]</code>, and
1649 * the range of the coordinates depends on the focal length
1650 * terms of the intrinsic calibration.</p>
1651 * <p>Finally, <code>r</code> represents the radial distance from the
1652 * optical center, <code>r^2 = x_i^2 + y_i^2</code>.</p>
1653 * <p>The distortion model used is the Brown-Conrady model.</p>
1654 * <p><b>Units</b>:
1655 * Unitless coefficients.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001656 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001657 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001658 *
1659 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
1660 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
1661 */
1662 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001663 @NonNull
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001664 public static final Key<float[]> LENS_DISTORTION =
1665 new Key<float[]>("android.lens.distortion", float[].class);
1666
1667 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001668 * <p>List of noise reduction modes for {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} that are supported
1669 * by this camera device.</p>
1670 * <p>Full-capability camera devices will always support OFF and FAST.</p>
Chien-Yu Chen72333912015-07-08 11:55:19 -07001671 * <p>Camera devices that support YUV_REPROCESSING or PRIVATE_REPROCESSING will support
1672 * ZERO_SHUTTER_LAG.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001673 * <p>Legacy-capability camera devices will only support FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001674 * <p><b>Range of valid values:</b><br>
1675 * Any value listed in {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001676 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001677 * <p><b>Limited capability</b> -
1678 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1679 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001680 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001681 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001682 * @see CaptureRequest#NOISE_REDUCTION_MODE
1683 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001684 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001685 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001686 public static final Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES =
1687 new Key<int[]>("android.noiseReduction.availableNoiseReductionModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001688
1689 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001690 * <p>If set to 1, the HAL will always split result
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001691 * metadata for a single capture into multiple buffers,
Igor Murashkinace5bf02013-12-10 17:36:40 -08001692 * returned using multiple process_capture_result calls.</p>
1693 * <p>Does not need to be listed in static
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001694 * metadata. Support for partial results will be reworked in
1695 * future versions of camera service. This quirk will stop
1696 * working at that point; DO NOT USE without careful
Igor Murashkinace5bf02013-12-10 17:36:40 -08001697 * consideration of future support.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001698 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001699 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001700 * <p>Not used in HALv3 or newer; replaced by better partials mechanism</p>
1701
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001702 * @hide
1703 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001704 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001705 public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
1706 new Key<Byte>("android.quirks.usePartialResult", byte.class);
1707
1708 /**
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001709 * <p>The maximum numbers of different types of output streams
1710 * that can be configured and used simultaneously by a camera device.</p>
1711 * <p>This is a 3 element tuple that contains the max number of output simultaneous
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001712 * streams for raw sensor, processed (but not stalling), and processed (and stalling)
1713 * formats respectively. For example, assuming that JPEG is typically a processed and
1714 * stalling stream, if max raw sensor format output stream number is 1, max YUV streams
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001715 * number is 3, and max JPEG stream number is 2, then this tuple should be <code>(1, 3, 2)</code>.</p>
1716 * <p>This lists the upper bound of the number of output streams supported by
1717 * the camera device. Using more streams simultaneously may require more hardware and
Igor Murashkin78712a82014-05-27 18:32:18 -07001718 * CPU resources that will consume more power. The image format for an output stream can
Igor Murashkin9c595172014-05-12 13:56:20 -07001719 * be any supported format provided by android.scaler.availableStreamConfigurations.
1720 * The formats defined in android.scaler.availableStreamConfigurations can be catergorized
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001721 * into the 3 stream types as below:</p>
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001722 * <ul>
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001723 * <li>Processed (but stalling): any non-RAW format with a stallDurations &gt; 0.
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001724 * Typically {@link android.graphics.ImageFormat#JPEG JPEG format}.</li>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001725 * <li>Raw formats: {@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}, {@link android.graphics.ImageFormat#RAW10 RAW10}, or
1726 * {@link android.graphics.ImageFormat#RAW12 RAW12}.</li>
1727 * <li>Processed (but not-stalling): any non-RAW format without a stall duration. Typically
1728 * {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888},
Shuzhen Wangec5e8d22018-09-28 09:28:48 -07001729 * {@link android.graphics.ImageFormat#NV21 NV21}, {@link android.graphics.ImageFormat#YV12 YV12}, or {@link android.graphics.ImageFormat#Y8 Y8} .</li>
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001730 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001731 * <p><b>Range of valid values:</b><br></p>
1732 * <p>For processed (and stalling) format streams, &gt;= 1.</p>
1733 * <p>For Raw format (either stalling or non-stalling) streams, &gt;= 0.</p>
1734 * <p>For processed (but not stalling) format streams, &gt;= 3
1735 * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1736 * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001737 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001738 *
1739 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001740 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001741 */
1742 public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
1743 new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
1744
1745 /**
Igor Murashkin78712a82014-05-27 18:32:18 -07001746 * <p>The maximum numbers of different types of output streams
1747 * that can be configured and used simultaneously by a camera device
1748 * for any <code>RAW</code> formats.</p>
1749 * <p>This value contains the max number of output simultaneous
1750 * streams from the raw sensor.</p>
1751 * <p>This lists the upper bound of the number of output streams supported by
1752 * the camera device. Using more streams simultaneously may require more hardware and
1753 * CPU resources that will consume more power. The image format for this kind of an output stream can
1754 * be any <code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1755 * <p>In particular, a <code>RAW</code> format is typically one of:</p>
1756 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001757 * <li>{@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}</li>
1758 * <li>{@link android.graphics.ImageFormat#RAW10 RAW10}</li>
1759 * <li>{@link android.graphics.ImageFormat#RAW12 RAW12}</li>
Igor Murashkin78712a82014-05-27 18:32:18 -07001760 * </ul>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001761 * <p>LEGACY mode devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> LEGACY)
1762 * never support raw streams.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001763 * <p><b>Range of valid values:</b><br></p>
1764 * <p>&gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001765 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001766 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001767 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001768 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1769 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001770 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001771 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07001772 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001773 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_RAW =
1774 new Key<Integer>("android.request.maxNumOutputRaw", int.class);
1775
1776 /**
1777 * <p>The maximum numbers of different types of output streams
1778 * that can be configured and used simultaneously by a camera device
1779 * for any processed (but not-stalling) formats.</p>
1780 * <p>This value contains the max number of output simultaneous
1781 * streams for any processed (but not-stalling) formats.</p>
1782 * <p>This lists the upper bound of the number of output streams supported by
1783 * the camera device. Using more streams simultaneously may require more hardware and
1784 * CPU resources that will consume more power. The image format for this kind of an output stream can
1785 * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1786 * <p>Processed (but not-stalling) is defined as any non-RAW format without a stall duration.
1787 * Typically:</p>
1788 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001789 * <li>{@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888}</li>
1790 * <li>{@link android.graphics.ImageFormat#NV21 NV21}</li>
1791 * <li>{@link android.graphics.ImageFormat#YV12 YV12}</li>
1792 * <li>Implementation-defined formats, i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class) }</li>
Shuzhen Wangec5e8d22018-09-28 09:28:48 -07001793 * <li>{@link android.graphics.ImageFormat#Y8 Y8}</li>
Igor Murashkin78712a82014-05-27 18:32:18 -07001794 * </ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001795 * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1796 * processed format -- it will return 0 for a non-stalling stream.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001797 * <p>LEGACY devices will support at least 2 processing/non-stalling streams.</p>
1798 * <p><b>Range of valid values:</b><br></p>
1799 * <p>&gt;= 3
1800 * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1801 * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001802 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001803 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001804 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001805 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1806 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001807 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001808 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07001809 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001810 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC =
1811 new Key<Integer>("android.request.maxNumOutputProc", int.class);
1812
1813 /**
1814 * <p>The maximum numbers of different types of output streams
1815 * that can be configured and used simultaneously by a camera device
1816 * for any processed (and stalling) formats.</p>
1817 * <p>This value contains the max number of output simultaneous
1818 * streams for any processed (but not-stalling) formats.</p>
1819 * <p>This lists the upper bound of the number of output streams supported by
1820 * the camera device. Using more streams simultaneously may require more hardware and
1821 * CPU resources that will consume more power. The image format for this kind of an output stream can
1822 * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001823 * <p>A processed and stalling format is defined as any non-RAW format with a stallDurations
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001824 * &gt; 0. Typically only the {@link android.graphics.ImageFormat#JPEG JPEG format} is a stalling format.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001825 * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1826 * processed format -- it will return a non-0 value for a stalling stream.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001827 * <p>LEGACY devices will support up to 1 processing/stalling stream.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001828 * <p><b>Range of valid values:</b><br></p>
1829 * <p>&gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001830 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001831 *
1832 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1833 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001834 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001835 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07001836 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001837 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING =
1838 new Key<Integer>("android.request.maxNumOutputProcStalling", int.class);
1839
1840 /**
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001841 * <p>The maximum numbers of any type of input streams
1842 * that can be configured and used simultaneously by a camera device.</p>
1843 * <p>When set to 0, it means no input stream is supported.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001844 * <p>The image format for a input stream can be any supported format returned by {@link android.hardware.camera2.params.StreamConfigurationMap#getInputFormats }. When using an
1845 * input stream, there must be at least one output stream configured to to receive the
1846 * reprocessed images.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08001847 * <p>When an input stream and some output streams are used in a reprocessing request,
1848 * only the input buffer will be used to produce these output stream buffers, and a
1849 * new sensor image will not be captured.</p>
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001850 * <p>For example, for Zero Shutter Lag (ZSL) still capture use case, the input
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001851 * stream image format will be PRIVATE, the associated output stream image format
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001852 * should be JPEG.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001853 * <p><b>Range of valid values:</b><br></p>
1854 * <p>0 or 1.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001855 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001856 * <p><b>Full capability</b> -
1857 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1858 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1859 *
1860 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001861 */
Zhijun He0e99c222015-01-29 15:26:05 -08001862 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001863 @NonNull
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001864 public static final Key<Integer> REQUEST_MAX_NUM_INPUT_STREAMS =
1865 new Key<Integer>("android.request.maxNumInputStreams", int.class);
1866
1867 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08001868 * <p>Specifies the number of maximum pipeline stages a frame
1869 * has to go through from when it's exposed to when it's available
1870 * to the framework.</p>
1871 * <p>A typical minimum value for this is 2 (one stage to expose,
1872 * one stage to readout) from the sensor. The ISP then usually adds
1873 * its own stages to do custom HW processing. Further stages may be
1874 * added by SW processing.</p>
1875 * <p>Depending on what settings are used (e.g. YUV, JPEG) and what
1876 * processing is enabled (e.g. face detection), the actual pipeline
1877 * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than
1878 * the max pipeline depth.</p>
1879 * <p>A pipeline depth of X stages is equivalent to a pipeline latency of
1880 * X frame intervals.</p>
Zhijun Hefab663e2015-05-26 19:46:31 -07001881 * <p>This value will normally be 8 or less, however, for high speed capture session,
1882 * the max pipeline depth will be up to 8 x size of high speed capture request list.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001883 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08001884 *
1885 * @see CaptureResult#REQUEST_PIPELINE_DEPTH
1886 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001887 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001888 @NonNull
Igor Murashkinc127f052014-01-17 18:06:02 -08001889 public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH =
1890 new Key<Byte>("android.request.pipelineMaxDepth", byte.class);
1891
1892 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001893 * <p>Defines how many sub-components
Igor Murashkin2086b582014-01-17 18:30:59 -08001894 * a result will be composed of.</p>
1895 * <p>In order to combat the pipeline latency, partial results
1896 * may be delivered to the application layer from the camera device as
1897 * soon as they are available.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001898 * <p>Optional; defaults to 1. A value of 1 means that partial
1899 * results are not supported, and only the final TotalCaptureResult will
1900 * be produced by the camera device.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001901 * <p>A typical use case for this might be: after requesting an
1902 * auto-focus (AF) lock the new AF state might be available 50%
1903 * of the way through the pipeline. The camera device could
1904 * then immediately dispatch this state via a partial result to
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001905 * the application, and the rest of the metadata via later
1906 * partial results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001907 * <p><b>Range of valid values:</b><br>
1908 * &gt;= 1</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001909 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin2086b582014-01-17 18:30:59 -08001910 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001911 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001912 @NonNull
Igor Murashkin2086b582014-01-17 18:30:59 -08001913 public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
1914 new Key<Integer>("android.request.partialResultCount", int.class);
1915
1916 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001917 * <p>List of capabilities that this camera device
Igor Murashkine46c0da2014-02-07 18:34:37 -08001918 * advertises as fully supporting.</p>
1919 * <p>A capability is a contract that the camera device makes in order
1920 * to be able to satisfy one or more use cases.</p>
1921 * <p>Listing a capability guarantees that the whole set of features
1922 * required to support a common use will all be available.</p>
1923 * <p>Using a subset of the functionality provided by an unsupported
1924 * capability may be possible on a specific camera device implementation;
1925 * to do this query each of android.request.availableRequestKeys,
1926 * android.request.availableResultKeys,
1927 * android.request.availableCharacteristicsKeys.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001928 * <p>The following capabilities are guaranteed to be available on
1929 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL devices:</p>
1930 * <ul>
1931 * <li>MANUAL_SENSOR</li>
Zhijun Hedf9b7472014-06-04 13:42:41 -07001932 * <li>MANUAL_POST_PROCESSING</li>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001933 * </ul>
1934 * <p>Other capabilities may be available on either FULL or LIMITED
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001935 * devices, but the application should query this key to be sure.</p>
1936 * <p><b>Possible values:</b>
1937 * <ul>
1938 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE BACKWARD_COMPATIBLE}</li>
1939 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR MANUAL_SENSOR}</li>
1940 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING MANUAL_POST_PROCESSING}</li>
1941 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}</li>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001942 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING PRIVATE_REPROCESSING}</li>
Ruben Brunk0c22e692014-11-11 12:00:34 -08001943 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}</li>
Eino-Ville Talvala126a7462014-11-04 16:31:01 -08001944 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08001945 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING YUV_REPROCESSING}</li>
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07001946 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT DEPTH_OUTPUT}</li>
Zhijun Hefab663e2015-05-26 19:46:31 -07001947 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO CONSTRAINED_HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001948 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING MOTION_TRACKING}</li>
Shuzhen Wang23d29382017-11-26 17:24:56 -08001949 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA LOGICAL_MULTI_CAMERA}</li>
Shuzhen Wang51248bf2018-03-22 00:04:45 -07001950 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME MONOCHROME}</li>
Jayant Chowdharyd88b4832019-01-24 18:11:09 -08001951 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA SECURE_IMAGE_DATA}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001952 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001953 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001954 *
1955 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala08bc3b02014-07-09 10:07:36 -07001956 * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
Igor Murashkine46c0da2014-02-07 18:34:37 -08001957 * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
Zhijun He50f72432014-05-28 13:52:04 -07001958 * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING
Eino-Ville Talvala611fece2014-07-10 17:29:38 -07001959 * @see #REQUEST_AVAILABLE_CAPABILITIES_RAW
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001960 * @see #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING
Ruben Brunk0c22e692014-11-11 12:00:34 -08001961 * @see #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS
Eino-Ville Talvala126a7462014-11-04 16:31:01 -08001962 * @see #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE
Zhijun He0e99c222015-01-29 15:26:05 -08001963 * @see #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07001964 * @see #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT
Zhijun Hefab663e2015-05-26 19:46:31 -07001965 * @see #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001966 * @see #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING
Shuzhen Wang23d29382017-11-26 17:24:56 -08001967 * @see #REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA
Shuzhen Wang51248bf2018-03-22 00:04:45 -07001968 * @see #REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME
Jayant Chowdharyd88b4832019-01-24 18:11:09 -08001969 * @see #REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA
Igor Murashkine46c0da2014-02-07 18:34:37 -08001970 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001971 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001972 @NonNull
Zhijun He421ddbe2014-05-29 13:41:49 -07001973 public static final Key<int[]> REQUEST_AVAILABLE_CAPABILITIES =
1974 new Key<int[]>("android.request.availableCapabilities", int[].class);
Igor Murashkine46c0da2014-02-07 18:34:37 -08001975
1976 /**
1977 * <p>A list of all keys that the camera device has available
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001978 * to use with {@link android.hardware.camera2.CaptureRequest }.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001979 * <p>Attempting to set a key into a CaptureRequest that is not
1980 * listed here will result in an invalid request and will be rejected
1981 * by the camera device.</p>
1982 * <p>This field can be used to query the feature set of a camera device
1983 * at a more granular level than capabilities. This is especially
1984 * important for optional keys that are not listed under any capability
1985 * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001986 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001987 *
1988 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1989 * @hide
1990 */
1991 public static final Key<int[]> REQUEST_AVAILABLE_REQUEST_KEYS =
1992 new Key<int[]>("android.request.availableRequestKeys", int[].class);
1993
1994 /**
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001995 * <p>A list of all keys that the camera device has available to use with {@link android.hardware.camera2.CaptureResult }.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001996 * <p>Attempting to get a key from a CaptureResult that is not
1997 * listed here will always return a <code>null</code> value. Getting a key from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001998 * a CaptureResult that is listed here will generally never return a <code>null</code>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001999 * value.</p>
2000 * <p>The following keys may return <code>null</code> unless they are enabled:</p>
2001 * <ul>
Ruben Brunk57493682014-05-27 18:58:08 -07002002 * <li>android.statistics.lensShadingMap (non-null iff {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON)</li>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002003 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002004 * <p>(Those sometimes-null keys will nevertheless be listed here
Igor Murashkine46c0da2014-02-07 18:34:37 -08002005 * if they are available.)</p>
2006 * <p>This field can be used to query the feature set of a camera device
2007 * at a more granular level than capabilities. This is especially
2008 * important for optional keys that are not listed under any capability
2009 * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002010 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002011 *
2012 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkine46c0da2014-02-07 18:34:37 -08002013 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2014 * @hide
2015 */
2016 public static final Key<int[]> REQUEST_AVAILABLE_RESULT_KEYS =
2017 new Key<int[]>("android.request.availableResultKeys", int[].class);
2018
2019 /**
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002020 * <p>A list of all keys that the camera device has available to use with {@link android.hardware.camera2.CameraCharacteristics }.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002021 * <p>This entry follows the same rules as
2022 * android.request.availableResultKeys (except that it applies for
2023 * CameraCharacteristics instead of CaptureResult). See above for more
2024 * details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002025 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002026 * @hide
2027 */
2028 public static final Key<int[]> REQUEST_AVAILABLE_CHARACTERISTICS_KEYS =
2029 new Key<int[]>("android.request.availableCharacteristicsKeys", int[].class);
2030
2031 /**
Emilian Peev75a55702017-11-07 16:09:59 +00002032 * <p>A subset of the available request keys that the camera device
2033 * can pass as part of the capture session initialization.</p>
2034 * <p>This is a subset of android.request.availableRequestKeys which
2035 * contains a list of keys that are difficult to apply per-frame and
2036 * can result in unexpected delays when modified during the capture session
2037 * lifetime. Typical examples include parameters that require a
2038 * time-consuming hardware re-configuration or internal camera pipeline
2039 * change. For performance reasons we advise clients to pass their initial
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08002040 * values as part of
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002041 * {@link SessionConfiguration#setSessionParameters }.
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08002042 * Once the camera capture session is enabled it is also recommended to avoid
Emilian Peev75a55702017-11-07 16:09:59 +00002043 * changing them from their initial values set in
2044 * {@link SessionConfiguration#setSessionParameters }.
2045 * Control over session parameters can still be exerted in capture requests
2046 * but clients should be aware and expect delays during their application.
2047 * An example usage scenario could look like this:</p>
2048 * <ul>
2049 * <li>The camera client starts by quering the session parameter key list via
2050 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
2051 * <li>Before triggering the capture session create sequence, a capture request
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08002052 * must be built via
2053 * {@link CameraDevice#createCaptureRequest }
2054 * using an appropriate template matching the particular use case.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00002055 * <li>The client should go over the list of session parameters and check
2056 * whether some of the keys listed matches with the parameters that
2057 * they intend to modify as part of the first capture request.</li>
2058 * <li>If there is no such match, the capture request can be passed
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08002059 * unmodified to
2060 * {@link SessionConfiguration#setSessionParameters }.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00002061 * <li>If matches do exist, the client should update the respective values
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08002062 * and pass the request to
2063 * {@link SessionConfiguration#setSessionParameters }.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00002064 * <li>After the capture session initialization completes the session parameter
2065 * key list can continue to serve as reference when posting or updating
2066 * further requests. As mentioned above further changes to session
2067 * parameters should ideally be avoided, if updates are necessary
2068 * however clients could expect a delay/glitch during the
2069 * parameter switch.</li>
2070 * </ul>
2071 * <p>This key is available on all devices.</p>
2072 * @hide
2073 */
2074 public static final Key<int[]> REQUEST_AVAILABLE_SESSION_KEYS =
2075 new Key<int[]>("android.request.availableSessionKeys", int[].class);
2076
2077 /**
koprivadebd4ee2018-09-13 10:59:46 -07002078 * <p>A subset of the available request keys that can be overridden for
Emilian Peev2100ae72018-01-12 16:56:25 +00002079 * physical devices backing a logical multi-camera.</p>
2080 * <p>This is a subset of android.request.availableRequestKeys which contains a list
koprivadebd4ee2018-09-13 10:59:46 -07002081 * of keys that can be overridden using {@link CaptureRequest.Builder#setPhysicalCameraKey }.
Emilian Peev2100ae72018-01-12 16:56:25 +00002082 * The respective value of such request key can be obtained by calling
2083 * {@link CaptureRequest.Builder#getPhysicalCameraKey }. Capture requests that contain
2084 * individual physical device requests must be built via
Emilian Peevf60f4fb2018-02-08 17:40:48 +00002085 * {@link android.hardware.camera2.CameraDevice#createCaptureRequest(int, Set)}.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002086 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev2100ae72018-01-12 16:56:25 +00002087 * <p><b>Limited capability</b> -
2088 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2089 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2090 *
2091 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2092 * @hide
2093 */
2094 public static final Key<int[]> REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS =
2095 new Key<int[]>("android.request.availablePhysicalCameraRequestKeys", int[].class);
2096
2097 /**
Emilian Peeva7fea4c2018-09-03 16:37:06 +01002098 * <p>A list of camera characteristics keys that are only available
2099 * in case the camera client has camera permission.</p>
2100 * <p>The entry contains a subset of
2101 * {@link android.hardware.camera2.CameraCharacteristics#getKeys } that require camera clients
2102 * to acquire the {@link android.Manifest.permission#CAMERA } permission before calling
2103 * {@link android.hardware.camera2.CameraManager#getCameraCharacteristics }. If the
2104 * permission is not held by the camera client, then the values of the repsective properties
2105 * will not be present in {@link android.hardware.camera2.CameraCharacteristics }.</p>
2106 * <p>This key is available on all devices.</p>
2107 * @hide
2108 */
2109 public static final Key<int[]> REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION =
2110 new Key<int[]>("android.request.characteristicKeysNeedingPermission", int[].class);
2111
2112 /**
Zhijun Hef3b16df2014-01-17 13:37:59 -08002113 * <p>The list of image formats that are supported by this
Igor Murashkin418f6df2014-02-07 18:20:48 -08002114 * camera device for output streams.</p>
Zhijun Hef3b16df2014-01-17 13:37:59 -08002115 * <p>All camera devices will support JPEG and YUV_420_888 formats.</p>
2116 * <p>When set to YUV_420_888, application can access the YUV420 data directly.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002117 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002118 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002119 * <p>Not used in HALv3 or newer</p>
2120
Igor Murashkin9c595172014-05-12 13:56:20 -07002121 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002122 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002123 @Deprecated
Igor Murashkinb519cc52013-07-02 11:23:44 -07002124 public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
2125 new Key<int[]>("android.scaler.availableFormats", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002126
2127 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002128 * <p>The minimum frame duration that is supported
Igor Murashkin9c595172014-05-12 13:56:20 -07002129 * for each resolution in android.scaler.availableJpegSizes.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002130 * <p>This corresponds to the minimum steady-state frame duration when only
2131 * that JPEG stream is active and captured in a burst, with all
2132 * processing (typically in android.*.mode) set to FAST.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002133 * <p>When multiple streams are configured, the minimum
2134 * frame duration will be &gt;= max(individual stream min
2135 * durations)</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002136 * <p><b>Units</b>: Nanoseconds</p>
2137 * <p><b>Range of valid values:</b><br>
2138 * TODO: Remove property.</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>
Igor Murashkin9c595172014-05-12 13:56:20 -07002140 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002141 * <p>Not used in HALv3 or newer</p>
2142
Igor Murashkin9c595172014-05-12 13:56:20 -07002143 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002144 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002145 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002146 public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
2147 new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002148
2149 /**
Zhijun Hef3b16df2014-01-17 13:37:59 -08002150 * <p>The JPEG resolutions that are supported by this camera device.</p>
2151 * <p>The resolutions are listed as <code>(width, height)</code> pairs. All camera devices will support
2152 * sensor maximum resolution (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002153 * <p><b>Range of valid values:</b><br>
2154 * TODO: Remove property.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002155 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Zhijun Hef3b16df2014-01-17 13:37:59 -08002156 *
2157 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Igor Murashkin9c595172014-05-12 13:56:20 -07002158 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002159 * <p>Not used in HALv3 or newer</p>
2160
Igor Murashkin9c595172014-05-12 13:56:20 -07002161 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002162 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002163 @Deprecated
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002164 public static final Key<android.util.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
2165 new Key<android.util.Size[]>("android.scaler.availableJpegSizes", android.util.Size[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002166
2167 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002168 * <p>The maximum ratio between both active area width
2169 * and crop region width, and active area height and
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002170 * crop region height, for {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002171 * <p>This represents the maximum amount of zooming possible by
2172 * the camera device, or equivalently, the minimum cropping
2173 * window size.</p>
2174 * <p>Crop regions that have a width or height that is smaller
2175 * than this ratio allows will be rounded up to the minimum
2176 * allowed size by the camera device.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002177 * <p><b>Units</b>: Zoom scale factor</p>
2178 * <p><b>Range of valid values:</b><br>
2179 * &gt;=1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002180 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002181 *
2182 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002183 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002184 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002185 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002186 public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM =
2187 new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002188
2189 /**
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002190 * <p>For each available processed output size (defined in
Igor Murashkin9c595172014-05-12 13:56:20 -07002191 * android.scaler.availableProcessedSizes), this property lists the
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002192 * minimum supportable frame duration for that size.</p>
2193 * <p>This should correspond to the frame duration when only that processed
2194 * stream is active, with all processing (typically in android.*.mode)
2195 * set to FAST.</p>
2196 * <p>When multiple streams are configured, the minimum frame duration will
2197 * be &gt;= max(individual stream min durations).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002198 * <p><b>Units</b>: Nanoseconds</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002199 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002200 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002201 * <p>Not used in HALv3 or newer</p>
2202
Igor Murashkin9c595172014-05-12 13:56:20 -07002203 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002204 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002205 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002206 public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
2207 new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002208
2209 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002210 * <p>The resolutions available for use with
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002211 * processed output streams, such as YV12, NV12, and
2212 * platform opaque YUV/RGB streams to the GPU or video
Zhijun Hef3b16df2014-01-17 13:37:59 -08002213 * encoders.</p>
2214 * <p>The resolutions are listed as <code>(width, height)</code> pairs.</p>
2215 * <p>For a given use case, the actual maximum supported resolution
2216 * may be lower than what is listed here, depending on the destination
2217 * Surface for the image data. For example, for recording video,
2218 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2219 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2220 * can provide.</p>
2221 * <p>Please reference the documentation for the image data destination to
2222 * check if it limits the maximum size for image data.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002223 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002224 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002225 * <p>Not used in HALv3 or newer</p>
2226
Igor Murashkin9c595172014-05-12 13:56:20 -07002227 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002228 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002229 @Deprecated
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002230 public static final Key<android.util.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
2231 new Key<android.util.Size[]>("android.scaler.availableProcessedSizes", android.util.Size[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002232
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002233 /**
Igor Murashkin418f6df2014-02-07 18:20:48 -08002234 * <p>The mapping of image formats that are supported by this
2235 * camera device for input streams, to their corresponding output formats.</p>
2236 * <p>All camera devices with at least 1
Zhijun He0e99c222015-01-29 15:26:05 -08002237 * {@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} will have at least one
Igor Murashkin418f6df2014-02-07 18:20:48 -08002238 * available input format.</p>
2239 * <p>The camera device will support the following map of formats,
Zhijun He0e99c222015-01-29 15:26:05 -08002240 * if its dependent capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002241 * <table>
2242 * <thead>
2243 * <tr>
2244 * <th align="left">Input Format</th>
2245 * <th align="left">Output Format</th>
2246 * <th align="left">Capability</th>
2247 * </tr>
2248 * </thead>
2249 * <tbody>
2250 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002251 * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
2252 * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07002253 * <td align="left">PRIVATE_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002254 * </tr>
2255 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002256 * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
2257 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07002258 * <td align="left">PRIVATE_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002259 * </tr>
2260 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002261 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2262 * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
Zhijun He0e99c222015-01-29 15:26:05 -08002263 * <td align="left">YUV_REPROCESSING</td>
2264 * </tr>
2265 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002266 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2267 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Zhijun He0e99c222015-01-29 15:26:05 -08002268 * <td align="left">YUV_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002269 * </tr>
2270 * </tbody>
2271 * </table>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002272 * <p>PRIVATE refers to a device-internal format that is not directly application-visible. A
Chien-Yu Chen8062d312015-05-12 14:24:10 -07002273 * PRIVATE input surface can be acquired by {@link android.media.ImageReader#newInstance }
2274 * with {@link android.graphics.ImageFormat#PRIVATE } as the format.</p>
2275 * <p>For a PRIVATE_REPROCESSING-capable camera device, using the PRIVATE format as either input
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002276 * or output will never hurt maximum frame rate (i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration getOutputStallDuration(ImageFormat.PRIVATE, size)} is always 0),</p>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002277 * <p>Attempting to configure an input stream with output streams not
2278 * listed as available in this map is not valid.</p>
Shuzhen Wangec5e8d22018-09-28 09:28:48 -07002279 * <p>Additionally, if the camera device is MONOCHROME with Y8 support, it will also support
2280 * the following map of formats if its dependent capability
2281 * ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
2282 * <table>
2283 * <thead>
2284 * <tr>
2285 * <th align="left">Input Format</th>
2286 * <th align="left">Output Format</th>
2287 * <th align="left">Capability</th>
2288 * </tr>
2289 * </thead>
2290 * <tbody>
2291 * <tr>
2292 * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
2293 * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2294 * <td align="left">PRIVATE_REPROCESSING</td>
2295 * </tr>
2296 * <tr>
2297 * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2298 * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
2299 * <td align="left">YUV_REPROCESSING</td>
2300 * </tr>
2301 * <tr>
2302 * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2303 * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2304 * <td align="left">YUV_REPROCESSING</td>
2305 * </tr>
2306 * </tbody>
2307 * </table>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002308 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002309 *
Zhijun He0e99c222015-01-29 15:26:05 -08002310 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2311 * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
Igor Murashkin9c595172014-05-12 13:56:20 -07002312 * @hide
Igor Murashkin418f6df2014-02-07 18:20:48 -08002313 */
Chien-Yu Chen0a551f12015-04-03 17:57:35 -07002314 public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP =
2315 new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
Igor Murashkin418f6df2014-02-07 18:20:48 -08002316
2317 /**
Igor Murashkina23ffb52014-02-07 18:52:34 -08002318 * <p>The available stream configurations that this
2319 * camera device supports
2320 * (i.e. format, width, height, output/input stream).</p>
2321 * <p>The configurations are listed as <code>(format, width, height, input?)</code>
2322 * tuples.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002323 * <p>For a given use case, the actual maximum supported resolution
2324 * may be lower than what is listed here, depending on the destination
2325 * Surface for the image data. For example, for recording video,
2326 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2327 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2328 * can provide.</p>
2329 * <p>Please reference the documentation for the image data destination to
2330 * check if it limits the maximum size for image data.</p>
2331 * <p>Not all output formats may be supported in a configuration with
2332 * an input stream of a particular format. For more details, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002333 * android.scaler.availableInputOutputFormatsMap.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002334 * <p>The following table describes the minimum required output stream
2335 * configurations based on the hardware level
2336 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
2337 * <table>
2338 * <thead>
2339 * <tr>
2340 * <th align="center">Format</th>
2341 * <th align="center">Size</th>
2342 * <th align="center">Hardware Level</th>
2343 * <th align="center">Notes</th>
2344 * </tr>
2345 * </thead>
2346 * <tbody>
2347 * <tr>
2348 * <td align="center">JPEG</td>
2349 * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
2350 * <td align="center">Any</td>
2351 * <td align="center"></td>
2352 * </tr>
2353 * <tr>
2354 * <td align="center">JPEG</td>
2355 * <td align="center">1920x1080 (1080p)</td>
2356 * <td align="center">Any</td>
2357 * <td align="center">if 1080p &lt;= activeArraySize</td>
2358 * </tr>
2359 * <tr>
2360 * <td align="center">JPEG</td>
2361 * <td align="center">1280x720 (720)</td>
2362 * <td align="center">Any</td>
2363 * <td align="center">if 720p &lt;= activeArraySize</td>
2364 * </tr>
2365 * <tr>
2366 * <td align="center">JPEG</td>
2367 * <td align="center">640x480 (480p)</td>
2368 * <td align="center">Any</td>
2369 * <td align="center">if 480p &lt;= activeArraySize</td>
2370 * </tr>
2371 * <tr>
2372 * <td align="center">JPEG</td>
2373 * <td align="center">320x240 (240p)</td>
2374 * <td align="center">Any</td>
2375 * <td align="center">if 240p &lt;= activeArraySize</td>
2376 * </tr>
2377 * <tr>
2378 * <td align="center">YUV_420_888</td>
2379 * <td align="center">all output sizes available for JPEG</td>
2380 * <td align="center">FULL</td>
2381 * <td align="center"></td>
2382 * </tr>
2383 * <tr>
2384 * <td align="center">YUV_420_888</td>
2385 * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
2386 * <td align="center">LIMITED</td>
2387 * <td align="center"></td>
2388 * </tr>
2389 * <tr>
2390 * <td align="center">IMPLEMENTATION_DEFINED</td>
2391 * <td align="center">same as YUV_420_888</td>
2392 * <td align="center">Any</td>
2393 * <td align="center"></td>
2394 * </tr>
2395 * </tbody>
2396 * </table>
2397 * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional
2398 * mandatory stream configurations on a per-capability basis.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002399 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002400 *
2401 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2402 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkina23ffb52014-02-07 18:52:34 -08002403 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Igor Murashkin9c595172014-05-12 13:56:20 -07002404 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08002405 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002406 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS =
2407 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08002408
2409 /**
2410 * <p>This lists the minimum frame duration for each
2411 * format/size combination.</p>
2412 * <p>This should correspond to the frame duration when only that
2413 * stream is active, with all processing (typically in android.*.mode)
2414 * set to either OFF or FAST.</p>
2415 * <p>When multiple streams are used in a request, the minimum frame
2416 * duration will be max(individual stream min durations).</p>
2417 * <p>The minimum frame duration of a stream (of a particular format, size)
2418 * is the same regardless of whether the stream is input or output.</p>
2419 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
Igor Murashkin9c595172014-05-12 13:56:20 -07002420 * android.scaler.availableStallDurations for more details about
Igor Murashkina23ffb52014-02-07 18:52:34 -08002421 * calculating the max frame rate.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002422 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002423 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002424 *
Igor Murashkina23ffb52014-02-07 18:52:34 -08002425 * @see CaptureRequest#SENSOR_FRAME_DURATION
Igor Murashkin9c595172014-05-12 13:56:20 -07002426 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08002427 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002428 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS =
2429 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08002430
2431 /**
2432 * <p>This lists the maximum stall duration for each
Zhijun He513f7c32015-04-24 18:23:54 -07002433 * output format/size combination.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002434 * <p>A stall duration is how much extra time would get added
2435 * to the normal minimum frame duration for a repeating request
2436 * that has streams with non-zero stall.</p>
2437 * <p>For example, consider JPEG captures which have the following
2438 * characteristics:</p>
2439 * <ul>
2440 * <li>JPEG streams act like processed YUV streams in requests for which
2441 * they are not included; in requests in which they are directly
2442 * referenced, they act as JPEG streams. This is because supporting a
2443 * JPEG stream requires the underlying YUV data to always be ready for
2444 * use by a JPEG encoder, but the encoder will only be used (and impact
2445 * frame duration) on requests that actually reference a JPEG stream.</li>
2446 * <li>The JPEG processor can run concurrently to the rest of the camera
2447 * pipeline, but cannot process more than 1 capture at a time.</li>
2448 * </ul>
2449 * <p>In other words, using a repeating YUV request would result
2450 * in a steady frame rate (let's say it's 30 FPS). If a single
2451 * JPEG request is submitted periodically, the frame rate will stay
2452 * at 30 FPS (as long as we wait for the previous JPEG to return each
2453 * time). If we try to submit a repeating YUV + JPEG request, then
2454 * the frame rate will drop from 30 FPS.</p>
2455 * <p>In general, submitting a new request with a non-0 stall time
2456 * stream will <em>not</em> cause a frame rate drop unless there are still
2457 * outstanding buffers for that stream from previous requests.</p>
2458 * <p>Submitting a repeating request with streams (call this <code>S</code>)
2459 * is the same as setting the minimum frame duration from
2460 * the normal minimum frame duration corresponding to <code>S</code>, added with
2461 * the maximum stall duration for <code>S</code>.</p>
2462 * <p>If interleaving requests with and without a stall duration,
2463 * a request will stall by the maximum of the remaining times
2464 * for each can-stall stream with outstanding buffers.</p>
2465 * <p>This means that a stalling request will not have an exposure start
2466 * until the stall has completed.</p>
2467 * <p>This should correspond to the stall duration when only that stream is
2468 * active, with all processing (typically in android.*.mode) set to FAST
2469 * or OFF. Setting any of the processing modes to HIGH_QUALITY
2470 * effectively results in an indeterminate stall duration for all
2471 * streams in a request (the regular stall calculation rules are
2472 * ignored).</p>
2473 * <p>The following formats may always have a stall duration:</p>
2474 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002475 * <li>{@link android.graphics.ImageFormat#JPEG }</li>
2476 * <li>{@link android.graphics.ImageFormat#RAW_SENSOR }</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002477 * </ul>
2478 * <p>The following formats will never have a stall duration:</p>
2479 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002480 * <li>{@link android.graphics.ImageFormat#YUV_420_888 }</li>
2481 * <li>{@link android.graphics.ImageFormat#RAW10 }</li>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002482 * <li>{@link android.graphics.ImageFormat#RAW12 }</li>
Shuzhen Wangec5e8d22018-09-28 09:28:48 -07002483 * <li>{@link android.graphics.ImageFormat#Y8 }</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002484 * </ul>
2485 * <p>All other formats may or may not have an allowed stall duration on
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002486 * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Igor Murashkina23ffb52014-02-07 18:52:34 -08002487 * for more details.</p>
2488 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} for more information about
2489 * calculating the max frame rate (absent stalls).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002490 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002491 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002492 *
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002493 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkina23ffb52014-02-07 18:52:34 -08002494 * @see CaptureRequest#SENSOR_FRAME_DURATION
Igor Murashkin9c595172014-05-12 13:56:20 -07002495 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08002496 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002497 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS =
2498 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
2499
2500 /**
2501 * <p>The available stream configurations that this
2502 * camera device supports; also includes the minimum frame durations
2503 * and the stall durations for each format/size combination.</p>
2504 * <p>All camera devices will support sensor maximum resolution (defined by
2505 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.</p>
2506 * <p>For a given use case, the actual maximum supported resolution
2507 * may be lower than what is listed here, depending on the destination
2508 * Surface for the image data. For example, for recording video,
2509 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2510 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2511 * can provide.</p>
2512 * <p>Please reference the documentation for the image data destination to
2513 * check if it limits the maximum size for image data.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002514 * <p>The following table describes the minimum required output stream
2515 * configurations based on the hardware level
2516 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
2517 * <table>
2518 * <thead>
2519 * <tr>
2520 * <th align="center">Format</th>
2521 * <th align="center">Size</th>
2522 * <th align="center">Hardware Level</th>
2523 * <th align="center">Notes</th>
2524 * </tr>
2525 * </thead>
2526 * <tbody>
2527 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002528 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002529 * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} (*1)</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002530 * <td align="center">Any</td>
2531 * <td align="center"></td>
2532 * </tr>
2533 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002534 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002535 * <td align="center">1920x1080 (1080p)</td>
2536 * <td align="center">Any</td>
2537 * <td align="center">if 1080p &lt;= activeArraySize</td>
2538 * </tr>
2539 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002540 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002541 * <td align="center">1280x720 (720p)</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002542 * <td align="center">Any</td>
2543 * <td align="center">if 720p &lt;= activeArraySize</td>
2544 * </tr>
2545 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002546 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002547 * <td align="center">640x480 (480p)</td>
2548 * <td align="center">Any</td>
2549 * <td align="center">if 480p &lt;= activeArraySize</td>
2550 * </tr>
2551 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002552 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002553 * <td align="center">320x240 (240p)</td>
2554 * <td align="center">Any</td>
2555 * <td align="center">if 240p &lt;= activeArraySize</td>
2556 * </tr>
2557 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002558 * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002559 * <td align="center">all output sizes available for JPEG</td>
2560 * <td align="center">FULL</td>
2561 * <td align="center"></td>
2562 * </tr>
2563 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002564 * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002565 * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
2566 * <td align="center">LIMITED</td>
2567 * <td align="center"></td>
2568 * </tr>
2569 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002570 * <td align="center">{@link android.graphics.ImageFormat#PRIVATE }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002571 * <td align="center">same as YUV_420_888</td>
2572 * <td align="center">Any</td>
2573 * <td align="center"></td>
2574 * </tr>
2575 * </tbody>
2576 * </table>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002577 * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} and {@link android.hardware.camera2.CameraDevice#createCaptureSession } for additional mandatory
2578 * stream configurations on a per-capability basis.</p>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002579 * <p>*1: For JPEG format, the sizes may be restricted by below conditions:</p>
2580 * <ul>
2581 * <li>The HAL may choose the aspect ratio of each Jpeg size to be one of well known ones
2582 * (e.g. 4:3, 16:9, 3:2 etc.). If the sensor maximum resolution
2583 * (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) has an aspect ratio other than these,
2584 * it does not have to be included in the supported JPEG sizes.</li>
2585 * <li>Some hardware JPEG encoders may have pixel boundary alignment requirements, such as
2586 * the dimensions being a multiple of 16.
2587 * Therefore, the maximum JPEG size may be smaller than sensor maximum resolution.
2588 * However, the largest JPEG size will be as close as possible to the sensor maximum
2589 * resolution given above constraints. It is required that after aspect ratio adjustments,
2590 * additional size reduction due to other issues must be less than 3% in area. For example,
2591 * if the sensor maximum resolution is 3280x2464, if the maximum JPEG size has aspect
2592 * ratio 4:3, and the JPEG encoder alignment requirement is 16, the maximum JPEG size will be
2593 * 3264x2448.</li>
2594 * </ul>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002595 * <p>This key is available on all devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002596 *
2597 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2598 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2599 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2600 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002601 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002602 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07002603 @SyntheticKey
Igor Murashkin9c595172014-05-12 13:56:20 -07002604 public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP =
2605 new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08002606
2607 /**
Zhijun He14986152014-05-22 21:17:37 -07002608 * <p>The crop type that this camera device supports.</p>
2609 * <p>When passing a non-centered crop region ({@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}) to a camera
2610 * device that only supports CENTER_ONLY cropping, the camera device will move the
2611 * crop region to the center of the sensor active array ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize})
2612 * and keep the crop region width and height unchanged. The camera device will return the
2613 * final used crop region in metadata result {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
2614 * <p>Camera devices that support FREEFORM cropping will support any crop region that
2615 * is inside of the active array. The camera device will apply the same crop region and
2616 * return the final used crop region in capture result metadata {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
Eino-Ville Talvala81e89282015-06-30 16:34:24 -07002617 * <p>LEGACY capability devices will only support CENTER_ONLY cropping.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002618 * <p><b>Possible values:</b>
2619 * <ul>
2620 * <li>{@link #SCALER_CROPPING_TYPE_CENTER_ONLY CENTER_ONLY}</li>
2621 * <li>{@link #SCALER_CROPPING_TYPE_FREEFORM FREEFORM}</li>
2622 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002623 * <p>This key is available on all devices.</p>
Zhijun He14986152014-05-22 21:17:37 -07002624 *
Zhijun He14986152014-05-22 21:17:37 -07002625 * @see CaptureRequest#SCALER_CROP_REGION
2626 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2627 * @see #SCALER_CROPPING_TYPE_CENTER_ONLY
2628 * @see #SCALER_CROPPING_TYPE_FREEFORM
2629 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002630 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002631 @NonNull
Zhijun He14986152014-05-22 21:17:37 -07002632 public static final Key<Integer> SCALER_CROPPING_TYPE =
2633 new Key<Integer>("android.scaler.croppingType", int.class);
2634
2635 /**
Emilian Peev2776ca32018-09-18 14:00:39 +01002636 * <p>Recommended stream configurations for common client use cases.</p>
2637 * <p>Optional subset of the android.scaler.availableStreamConfigurations that contains
2638 * similar tuples listed as
2639 * (i.e. width, height, format, output/input stream, usecase bit field).
2640 * Camera devices will be able to suggest particular stream configurations which are
2641 * power and performance efficient for specific use cases. For more information about
2642 * retrieving the suggestions see
2643 * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002644 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev2776ca32018-09-18 14:00:39 +01002645 * @hide
2646 */
2647 public static final Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]> SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS =
2648 new Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]>("android.scaler.availableRecommendedStreamConfigurations", android.hardware.camera2.params.RecommendedStreamConfiguration[].class);
2649
2650 /**
2651 * <p>Recommended mappings of image formats that are supported by this
2652 * camera device for input streams, to their corresponding output formats.</p>
2653 * <p>This is a recommended subset of the complete list of mappings found in
2654 * android.scaler.availableInputOutputFormatsMap. The same requirements apply here as well.
2655 * The list however doesn't need to contain all available and supported mappings. Instead of
2656 * this developers must list only recommended and efficient entries.
2657 * If set, the information will be available in the ZERO_SHUTTER_LAG recommended stream
2658 * configuration see
2659 * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002660 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev2776ca32018-09-18 14:00:39 +01002661 * @hide
2662 */
2663 public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP =
2664 new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableRecommendedInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
2665
2666 /**
Emilian Peev423cbd72018-11-10 18:37:45 +00002667 * <p>An array of mandatory stream combinations generated according to the camera device
2668 * {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL }
2669 * and {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES }.
2670 * This is an app-readable conversion of the mandatory stream combination
2671 * {@link android.hardware.camera2.CameraDevice#createCaptureSession tables}.</p>
2672 * <p>The array of
2673 * {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
2674 * generated according to the documented
2675 * {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} based on
2676 * specific device level and capabilities.
2677 * Clients can use the array as a quick reference to find an appropriate camera stream
2678 * combination.
2679 * As per documentation, the stream combinations with given PREVIEW, RECORD and
2680 * MAXIMUM resolutions and anything smaller from the list given by
2681 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes } are
2682 * guaranteed to work.
2683 * The mandatory stream combination array will be {@code null} in case the device is a
2684 * physical camera not independently exposed in
2685 * {@link android.hardware.camera2.CameraManager#getCameraIdList } or is not backward
2686 * compatible.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002687 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev423cbd72018-11-10 18:37:45 +00002688 * <p><b>Limited capability</b> -
2689 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2690 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2691 *
2692 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2693 */
2694 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002695 @NonNull
Emilian Peev423cbd72018-11-10 18:37:45 +00002696 @SyntheticKey
2697 public static final Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_STREAM_COMBINATIONS =
2698 new Key<android.hardware.camera2.params.MandatoryStreamCombination[]>("android.scaler.mandatoryStreamCombinations", android.hardware.camera2.params.MandatoryStreamCombination[].class);
2699
2700 /**
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002701 * <p>The area of the image sensor which corresponds to active pixels after any geometric
2702 * distortion correction has been applied.</p>
2703 * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2704 * the region that actually receives light from the scene) after any geometric correction
2705 * has been applied, and should be treated as the maximum size in pixels of any of the
2706 * image output formats aside from the raw formats.</p>
2707 * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
2708 * the full pixel array, and the size of the full pixel array is given by
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002709 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002710 * <p>The coordinate system for most other keys that list pixel coordinates, including
2711 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, is defined relative to the active array rectangle given in
2712 * this field, with <code>(0, 0)</code> being the top-left of this rectangle.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002713 * <p>The active array may be smaller than the full pixel array, since the full array may
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002714 * include black calibration pixels or other inactive regions.</p>
2715 * <p>For devices that do not support {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the active
2716 * array must be the same as {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.</p>
2717 * <p>For devices that support {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the active array must
2718 * be enclosed by {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}. The difference between
2719 * pre-correction active array and active array accounts for scaling or cropping caused
2720 * by lens geometric distortion correction.</p>
2721 * <p>In general, application should always refer to active array size for controls like
2722 * metering regions or crop region. Two exceptions are when the application is dealing with
2723 * RAW image buffers (RAW_SENSOR, RAW10, RAW12 etc), or when application explicitly set
2724 * {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} to OFF. In these cases, application should refer
2725 * to {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002726 * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002727 * <p>This key is available on all devices.</p>
2728 *
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002729 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002730 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002731 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002732 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002733 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002734 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002735 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002736 public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE =
2737 new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002738
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002739 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002740 * <p>Range of sensitivities for {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} supported by this
2741 * camera device.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002742 * <p>The values are the standard ISO sensitivity values,
2743 * as defined in ISO 12232:2006.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002744 * <p><b>Range of valid values:</b><br>
2745 * Min &lt;= 100, Max &gt;= 800</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002746 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002747 * <p><b>Full capability</b> -
2748 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2749 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002750 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002751 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002752 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002753 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002754 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002755 @NonNull
Ruben Brunk57493682014-05-27 18:58:08 -07002756 public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE =
2757 new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002758
2759 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002760 * <p>The arrangement of color filters on sensor;
Zhijun Hed1784962014-04-08 17:41:46 -07002761 * represents the colors in the top-left 2x2 section of
Shuzhen Wanga8d36032018-10-15 12:01:53 -07002762 * the sensor, in reading order, for a Bayer camera, or the
2763 * light spectrum it captures for MONOCHROME camera.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002764 * <p><b>Possible values:</b>
2765 * <ul>
2766 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB RGGB}</li>
2767 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG GRBG}</li>
2768 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG GBRG}</li>
2769 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR BGGR}</li>
2770 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB RGB}</li>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07002771 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO MONO}</li>
2772 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR NIR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002773 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002774 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002775 * <p><b>Full capability</b> -
2776 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2777 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2778 *
2779 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Hed1784962014-04-08 17:41:46 -07002780 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB
2781 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG
2782 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG
2783 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR
2784 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB
Shuzhen Wanga8d36032018-10-15 12:01:53 -07002785 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO
2786 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR
Zhijun Hed1784962014-04-08 17:41:46 -07002787 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002788 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002789 @NonNull
Zhijun Hed1784962014-04-08 17:41:46 -07002790 public static final Key<Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT =
2791 new Key<Integer>("android.sensor.info.colorFilterArrangement", int.class);
2792
2793 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002794 * <p>The range of image exposure times for {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} supported
2795 * by this camera device.</p>
2796 * <p><b>Units</b>: Nanoseconds</p>
2797 * <p><b>Range of valid values:</b><br>
2798 * The minimum exposure time will be less than 100 us. For FULL
Zhijun He28288ca2014-06-25 15:49:13 -07002799 * capability devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL),
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002800 * the maximum exposure time will be greater than 100ms.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002801 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002802 * <p><b>Full capability</b> -
2803 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2804 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08002805 *
Zhijun He28288ca2014-06-25 15:49:13 -07002806 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08002807 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002808 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002809 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002810 @NonNull
Ruben Brunk57493682014-05-27 18:58:08 -07002811 public static final Key<android.util.Range<Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE =
2812 new Key<android.util.Range<Long>>("android.sensor.info.exposureTimeRange", new TypeReference<android.util.Range<Long>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002813
2814 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002815 * <p>The maximum possible frame duration (minimum frame rate) for
2816 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} that is supported this camera device.</p>
2817 * <p>Attempting to use frame durations beyond the maximum will result in the frame
2818 * duration being clipped to the maximum. See that control for a full definition of frame
2819 * durations.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002820 * <p>Refer to {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
2821 * for the minimum frame duration values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002822 * <p><b>Units</b>: Nanoseconds</p>
2823 * <p><b>Range of valid values:</b><br>
2824 * For FULL capability devices
2825 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL), at least 100ms.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002826 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002827 * <p><b>Full capability</b> -
2828 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2829 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08002830 *
Zhijun He28288ca2014-06-25 15:49:13 -07002831 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002832 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002833 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002834 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002835 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002836 public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION =
2837 new Key<Long>("android.sensor.info.maxFrameDuration", long.class);
2838
2839 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002840 * <p>The physical dimensions of the full pixel
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002841 * array.</p>
2842 * <p>This is the physical size of the sensor pixel
2843 * array defined by {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002844 * <p><b>Units</b>: Millimeters</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002845 * <p>This key is available on all devices.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002846 *
2847 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002848 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002849 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002850 @NonNull
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002851 public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE =
2852 new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002853
2854 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002855 * <p>Dimensions of the full pixel array, possibly
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002856 * including black calibration pixels.</p>
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002857 * <p>The pixel count of the full pixel array of the image sensor, which covers
2858 * {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area. This represents the full pixel dimensions of
2859 * the raw buffers produced by this sensor.</p>
2860 * <p>If a camera device supports raw sensor formats, either this or
2861 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is the maximum dimensions for the raw
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002862 * output formats listed in {@link android.hardware.camera2.params.StreamConfigurationMap }
2863 * (this depends on whether or not the image sensor returns buffers containing pixels that
2864 * are not part of the active array region for blacklevel calibration or other purposes).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002865 * <p>Some parts of the full pixel array may not receive light from the scene,
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002866 * or be otherwise inactive. The {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} key
2867 * defines the rectangle of active pixels that will be included in processed image
2868 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002869 * <p><b>Units</b>: Pixels</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002870 * <p>This key is available on all devices.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002871 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002872 * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002873 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002874 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002875 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002876 @NonNull
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002877 public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE =
2878 new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class);
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002879
2880 /**
Ruben Brunke60e29552014-02-18 10:44:17 -08002881 * <p>Maximum raw value output by sensor.</p>
2882 * <p>This specifies the fully-saturated encoding level for the raw
2883 * sample values from the sensor. This is typically caused by the
2884 * sensor becoming highly non-linear or clipping. The minimum for
2885 * each channel is specified by the offset in the
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002886 * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} key.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08002887 * <p>The white level is typically determined either by sensor bit depth
Ruben Brunke89b1202014-03-24 17:10:35 -07002888 * (8-14 bits is expected), or by the point where the sensor response
Ruben Brunke60e29552014-02-18 10:44:17 -08002889 * becomes too non-linear to be useful. The default value for this is
2890 * maximum representable value for a 16-bit raw sample (2^16 - 1).</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08002891 * <p>The white level values of captured images may vary for different
2892 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
2893 * represents a coarse approximation for such case. It is recommended
2894 * to use {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} for captures when supported
2895 * by the camera device, which provides more accurate white level values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002896 * <p><b>Range of valid values:</b><br>
2897 * &gt; 255 (8-bit output)</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002898 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08002899 *
2900 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
Zhijun Hecd950b62015-11-12 17:47:52 -08002901 * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
2902 * @see CaptureRequest#SENSOR_SENSITIVITY
Ruben Brunke60e29552014-02-18 10:44:17 -08002903 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002904 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002905 @NonNull
Ruben Brunke60e29552014-02-18 10:44:17 -08002906 public static final Key<Integer> SENSOR_INFO_WHITE_LEVEL =
2907 new Key<Integer>("android.sensor.info.whiteLevel", int.class);
2908
2909 /**
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002910 * <p>The time base source for sensor capture start timestamps.</p>
2911 * <p>The timestamps provided for captures are always in nanoseconds and monotonic, but
2912 * may not based on a time source that can be compared to other system time sources.</p>
2913 * <p>This characteristic defines the source for the timestamps, and therefore whether they
2914 * can be compared against other system time sources/timestamps.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002915 * <p><b>Possible values:</b>
2916 * <ul>
2917 * <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN UNKNOWN}</li>
2918 * <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME REALTIME}</li>
2919 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002920 * <p>This key is available on all devices.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002921 * @see #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN
2922 * @see #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME
Zhijun He45fa43a12014-06-13 18:29:37 -07002923 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002924 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002925 @NonNull
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002926 public static final Key<Integer> SENSOR_INFO_TIMESTAMP_SOURCE =
2927 new Key<Integer>("android.sensor.info.timestampSource", int.class);
Zhijun He45fa43a12014-06-13 18:29:37 -07002928
2929 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002930 * <p>Whether the RAW images output from this camera device are subject to
2931 * lens shading correction.</p>
2932 * <p>If TRUE, all images produced by the camera device in the RAW image formats will
2933 * have lens shading correction already applied to it. If FALSE, the images will
2934 * not be adjusted for lens shading correction.
2935 * See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image formats.</p>
2936 * <p>This key will be <code>null</code> for all devices do not report this information.
2937 * Devices with RAW capability will always report this information in this key.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002938 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002939 *
2940 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
2941 */
2942 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002943 @NonNull
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002944 public static final Key<Boolean> SENSOR_INFO_LENS_SHADING_APPLIED =
2945 new Key<Boolean>("android.sensor.info.lensShadingApplied", boolean.class);
2946
2947 /**
Ruben Brunk1b02df42015-07-01 12:53:45 -07002948 * <p>The area of the image sensor which corresponds to active pixels prior to the
2949 * application of any geometric distortion correction.</p>
2950 * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2951 * the region that actually receives light from the scene) before any geometric correction
2952 * has been applied, and should be treated as the active region rectangle for any of the
2953 * raw formats. All metadata associated with raw processing (e.g. the lens shading
2954 * correction map, and radial distortion fields) treats the top, left of this rectangle as
2955 * the origin, (0,0).</p>
2956 * <p>The size of this region determines the maximum field of view and the maximum number of
2957 * pixels that an image from this sensor can contain, prior to the application of
2958 * geometric distortion correction. The effective maximum pixel dimensions of a
2959 * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}
2960 * field, and the effective maximum field of view for a post-distortion-corrected image
2961 * can be calculated by applying the geometric distortion correction fields to this
2962 * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2963 * <p>E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the
2964 * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel,
2965 * (x', y'), in the raw pixel array with dimensions give in
2966 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:</p>
2967 * <ol>
2968 * <li>Choose a pixel (x', y') within the active array region of the raw buffer given in
2969 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, otherwise this pixel is considered
2970 * to be outside of the FOV, and will not be shown in the processed output image.</li>
2971 * <li>Apply geometric distortion correction to get the post-distortion pixel coordinate,
2972 * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw
2973 * buffers is defined relative to the top, left of the
2974 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} rectangle.</li>
2975 * <li>If the resulting corrected pixel coordinate is within the region given in
2976 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the
2977 * processed output image buffer is <code>(x_i - activeArray.left, y_i - activeArray.top)</code>,
2978 * when the top, left coordinate of that buffer is treated as (0, 0).</li>
2979 * </ol>
2980 * <p>Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}
2981 * is (100,100), {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is (10, 10, 100, 100),
2982 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion
2983 * correction doesn't change the pixel coordinate, the resulting pixel selected in
2984 * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer
2985 * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5)
2986 * relative to the top,left of post-processed YUV output buffer with dimensions given in
2987 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2988 * <p>The currently supported fields that correct for geometric distortion are:</p>
2989 * <ol>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002990 * <li>{@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}.</li>
Ruben Brunk1b02df42015-07-01 12:53:45 -07002991 * </ol>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002992 * <p>If the camera device doesn't support geometric distortion correction, or all of the
2993 * geometric distortion fields are no-ops, this rectangle will be the same as the
2994 * post-distortion-corrected rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Ruben Brunk1b02df42015-07-01 12:53:45 -07002995 * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
2996 * the full pixel array, and the size of the full pixel array is given by
2997 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
2998 * <p>The pre-correction active array may be smaller than the full pixel array, since the
2999 * full array may include black calibration pixels or other inactive regions.</p>
3000 * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
3001 * <p>This key is available on all devices.</p>
3002 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003003 * @see CameraCharacteristics#LENS_DISTORTION
Ruben Brunk1b02df42015-07-01 12:53:45 -07003004 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3005 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3006 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
3007 */
3008 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003009 @NonNull
Ruben Brunk1b02df42015-07-01 12:53:45 -07003010 public static final Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE =
3011 new Key<android.graphics.Rect>("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class);
3012
3013 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07003014 * <p>The standard reference illuminant used as the scene light source when
3015 * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
3016 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
3017 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} matrices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003018 * <p>The values in this key correspond to the values defined for the
Ruben Brunk7c062362014-04-15 23:53:53 -07003019 * EXIF LightSource tag. These illuminants are standard light sources
3020 * that are often used calibrating camera devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003021 * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
Ruben Brunk7c062362014-04-15 23:53:53 -07003022 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
3023 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} will also be present.</p>
3024 * <p>Some devices may choose to provide a second set of calibration
3025 * information for improved quality, including
3026 * {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2} and its corresponding matrices.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003027 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3028 * the camera device has RAW capability.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003029 * <p><b>Possible values:</b>
3030 * <ul>
3031 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT DAYLIGHT}</li>
3032 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT FLUORESCENT}</li>
3033 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN TUNGSTEN}</li>
3034 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLASH FLASH}</li>
3035 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER FINE_WEATHER}</li>
3036 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER CLOUDY_WEATHER}</li>
3037 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_SHADE SHADE}</li>
3038 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT DAYLIGHT_FLUORESCENT}</li>
3039 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT DAY_WHITE_FLUORESCENT}</li>
3040 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT COOL_WHITE_FLUORESCENT}</li>
3041 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT WHITE_FLUORESCENT}</li>
3042 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A STANDARD_A}</li>
3043 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B STANDARD_B}</li>
3044 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C STANDARD_C}</li>
3045 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D55 D55}</li>
3046 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D65 D65}</li>
3047 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D75 D75}</li>
3048 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D50 D50}</li>
3049 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN ISO_STUDIO_TUNGSTEN}</li>
3050 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003051 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003052 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003053 *
3054 * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1
3055 * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM1
3056 * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX1
3057 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3058 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT
3059 * @see #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT
3060 * @see #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN
3061 * @see #SENSOR_REFERENCE_ILLUMINANT1_FLASH
3062 * @see #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER
3063 * @see #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER
3064 * @see #SENSOR_REFERENCE_ILLUMINANT1_SHADE
3065 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT
3066 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT
3067 * @see #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT
3068 * @see #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT
3069 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A
3070 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B
3071 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C
3072 * @see #SENSOR_REFERENCE_ILLUMINANT1_D55
3073 * @see #SENSOR_REFERENCE_ILLUMINANT1_D65
3074 * @see #SENSOR_REFERENCE_ILLUMINANT1_D75
3075 * @see #SENSOR_REFERENCE_ILLUMINANT1_D50
3076 * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN
3077 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003078 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003079 @NonNull
Ruben Brunk7c062362014-04-15 23:53:53 -07003080 public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 =
3081 new Key<Integer>("android.sensor.referenceIlluminant1", int.class);
3082
3083 /**
3084 * <p>The standard reference illuminant used as the scene light source when
3085 * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
3086 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
3087 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} matrices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003088 * <p>See {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1} for more details.</p>
3089 * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
Ruben Brunk7c062362014-04-15 23:53:53 -07003090 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
3091 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} will also be present.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003092 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3093 * the camera device has RAW capability.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003094 * <p><b>Range of valid values:</b><br>
3095 * Any value listed in {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003096 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003097 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003098 *
3099 * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2
3100 * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM2
3101 * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2
3102 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3103 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003104 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003105 @NonNull
Ruben Brunk7c062362014-04-15 23:53:53 -07003106 public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 =
3107 new Key<Byte>("android.sensor.referenceIlluminant2", byte.class);
3108
3109 /**
3110 * <p>A per-device calibration transform matrix that maps from the
3111 * reference sensor colorspace to the actual device sensor colorspace.</p>
3112 * <p>This matrix is used to correct for per-device variations in the
3113 * sensor colorspace, and is used for processing raw buffer data.</p>
3114 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3115 * contains a per-device calibration transform that maps colors
3116 * from reference sensor color space (i.e. the "golden module"
3117 * colorspace) into this camera device's native sensor color
3118 * space under the first reference illuminant
3119 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003120 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3121 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003122 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003123 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003124 *
3125 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3126 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003127 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003128 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003129 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1 =
3130 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003131
3132 /**
3133 * <p>A per-device calibration transform matrix that maps from the
3134 * reference sensor colorspace to the actual device sensor colorspace
3135 * (this is the colorspace of the raw buffer data).</p>
3136 * <p>This matrix is used to correct for per-device variations in the
3137 * sensor colorspace, and is used for processing raw buffer data.</p>
3138 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3139 * contains a per-device calibration transform that maps colors
3140 * from reference sensor color space (i.e. the "golden module"
3141 * colorspace) into this camera device's native sensor color
3142 * space under the second reference illuminant
3143 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
3144 * <p>This matrix will only be present if the second reference
3145 * illuminant is present.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003146 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3147 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003148 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003149 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003150 *
3151 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3152 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003153 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003154 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003155 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2 =
3156 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003157
3158 /**
3159 * <p>A matrix that transforms color values from CIE XYZ color space to
3160 * reference sensor color space.</p>
3161 * <p>This matrix is used to convert from the standard CIE XYZ color
3162 * space to the reference sensor colorspace, and is used when processing
3163 * raw buffer data.</p>
3164 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3165 * contains a color transform matrix that maps colors from the CIE
3166 * XYZ color space to the reference sensor color space (i.e. the
3167 * "golden module" colorspace) under the first reference illuminant
3168 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
3169 * <p>The white points chosen in both the reference sensor color space
3170 * and the CIE XYZ colorspace when calculating this transform will
3171 * match the standard white point for the first reference illuminant
3172 * (i.e. no chromatic adaptation will be applied by this transform).</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003173 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3174 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003175 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003176 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003177 *
3178 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3179 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003180 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003181 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003182 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1 =
3183 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003184
3185 /**
3186 * <p>A matrix that transforms color values from CIE XYZ color space to
3187 * reference sensor color space.</p>
3188 * <p>This matrix is used to convert from the standard CIE XYZ color
3189 * space to the reference sensor colorspace, and is used when processing
3190 * raw buffer data.</p>
3191 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3192 * contains a color transform matrix that maps colors from the CIE
3193 * XYZ color space to the reference sensor color space (i.e. the
3194 * "golden module" colorspace) under the second reference illuminant
3195 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
3196 * <p>The white points chosen in both the reference sensor color space
3197 * and the CIE XYZ colorspace when calculating this transform will
3198 * match the standard white point for the second reference illuminant
3199 * (i.e. no chromatic adaptation will be applied by this transform).</p>
3200 * <p>This matrix will only be present if the second reference
3201 * illuminant is present.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003202 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3203 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003204 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003205 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003206 *
3207 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3208 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003209 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003210 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003211 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2 =
3212 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003213
3214 /**
3215 * <p>A matrix that transforms white balanced camera colors from the reference
3216 * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
3217 * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
3218 * is used when processing raw buffer data.</p>
3219 * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
3220 * a color transform matrix that maps white balanced colors from the
3221 * reference sensor color space to the CIE XYZ color space with a D50 white
3222 * point.</p>
3223 * <p>Under the first reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1})
3224 * this matrix is chosen so that the standard white point for this reference
3225 * illuminant in the reference sensor colorspace is mapped to D50 in the
3226 * CIE XYZ colorspace.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003227 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3228 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003229 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003230 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003231 *
3232 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3233 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003234 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003235 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003236 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1 =
3237 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003238
3239 /**
3240 * <p>A matrix that transforms white balanced camera colors from the reference
3241 * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
3242 * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
3243 * is used when processing raw buffer data.</p>
3244 * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
3245 * a color transform matrix that maps white balanced colors from the
3246 * reference sensor color space to the CIE XYZ color space with a D50 white
3247 * point.</p>
3248 * <p>Under the second reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2})
3249 * this matrix is chosen so that the standard white point for this reference
3250 * illuminant in the reference sensor colorspace is mapped to D50 in the
3251 * CIE XYZ colorspace.</p>
3252 * <p>This matrix will only be present if the second reference
3253 * illuminant is present.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003254 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3255 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003256 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003257 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003258 *
3259 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3260 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003261 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003262 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003263 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2 =
3264 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003265
3266 /**
Ruben Brunk67b47022014-02-07 15:26:29 -08003267 * <p>A fixed black level offset for each of the color filter arrangement
3268 * (CFA) mosaic channels.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003269 * <p>This key specifies the zero light value for each of the CFA mosaic
Ruben Brunke60e29552014-02-18 10:44:17 -08003270 * channels in the camera sensor. The maximal value output by the
3271 * sensor is represented by the value in {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}.</p>
Ruben Brunk52842e72014-06-05 13:16:45 -07003272 * <p>The values are given in the same order as channels listed for the CFA
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003273 * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
Ruben Brunk52842e72014-06-05 13:16:45 -07003274 * nth value given corresponds to the black level offset for the nth
3275 * color channel listed in the CFA.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08003276 * <p>The black level values of captured images may vary for different
3277 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
3278 * represents a coarse approximation for such case. It is recommended to
3279 * use {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} or use pixels from
3280 * {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} directly for captures when
3281 * supported by the camera device, which provides more accurate black
3282 * level values. For raw capture in particular, it is recommended to use
3283 * pixels from {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} to calculate black
3284 * level values for each frame.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003285 * <p>For a MONOCHROME camera device, all of the 2x2 channels must have the same values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003286 * <p><b>Range of valid values:</b><br>
3287 * &gt;= 0 for each.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003288 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08003289 *
Zhijun Hecd950b62015-11-12 17:47:52 -08003290 * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
Ruben Brunk52842e72014-06-05 13:16:45 -07003291 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
Ruben Brunke60e29552014-02-18 10:44:17 -08003292 * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
Zhijun Hecd950b62015-11-12 17:47:52 -08003293 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3294 * @see CaptureRequest#SENSOR_SENSITIVITY
Ruben Brunk67b47022014-02-07 15:26:29 -08003295 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003296 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003297 @NonNull
Ruben Brunk52842e72014-06-05 13:16:45 -07003298 public static final Key<android.hardware.camera2.params.BlackLevelPattern> SENSOR_BLACK_LEVEL_PATTERN =
3299 new Key<android.hardware.camera2.params.BlackLevelPattern>("android.sensor.blackLevelPattern", android.hardware.camera2.params.BlackLevelPattern.class);
Ruben Brunk67b47022014-02-07 15:26:29 -08003300
3301 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003302 * <p>Maximum sensitivity that is implemented
Zhijun He153ac102014-02-03 12:25:12 -08003303 * purely through analog gain.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003304 * <p>For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003305 * equal to this, all applied gain must be analog. For
Zhijun He153ac102014-02-03 12:25:12 -08003306 * values above this, the gain applied can be a mix of analog and
3307 * digital.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003308 * <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 -08003309 * <p><b>Full capability</b> -
3310 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3311 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Alex Raye83c4eb2013-10-02 17:14:36 -07003312 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003313 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08003314 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003315 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003316 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003317 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003318 public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY =
3319 new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class);
3320
3321 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003322 * <p>Clockwise angle through which the output image needs to be rotated to be
3323 * upright on the device screen in its native orientation.</p>
3324 * <p>Also defines the direction of rolling shutter readout, which is from top to bottom in
3325 * the sensor's coordinate system.</p>
3326 * <p><b>Units</b>: Degrees of clockwise rotation; always a multiple of
3327 * 90</p>
3328 * <p><b>Range of valid values:</b><br>
3329 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003330 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003331 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003332 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003333 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003334 public static final Key<Integer> SENSOR_ORIENTATION =
3335 new Key<Integer>("android.sensor.orientation", int.class);
3336
3337 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003338 * <p>List of sensor test pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}
3339 * supported by this camera device.</p>
3340 * <p>Defaults to OFF, and always includes OFF if defined.</p>
3341 * <p><b>Range of valid values:</b><br>
3342 * Any value listed in {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003343 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08003344 *
3345 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
Igor Murashkinc127f052014-01-17 18:06:02 -08003346 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003347 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003348 @NonNull
Zhijun Hea4866242014-03-27 23:51:34 -07003349 public static final Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES =
3350 new Key<int[]>("android.sensor.availableTestPatternModes", int[].class);
Igor Murashkinc127f052014-01-17 18:06:02 -08003351
3352 /**
Zhijun Hecd950b62015-11-12 17:47:52 -08003353 * <p>List of disjoint rectangles indicating the sensor
3354 * optically shielded black pixel regions.</p>
3355 * <p>In most camera sensors, the active array is surrounded by some
3356 * optically shielded pixel areas. By blocking light, these pixels
3357 * provides a reliable black reference for black level compensation
3358 * in active array region.</p>
3359 * <p>This key provides a list of disjoint rectangles specifying the
3360 * regions of optically shielded (with metal shield) black pixel
3361 * regions if the camera device is capable of reading out these black
3362 * pixels in the output raw images. In comparison to the fixed black
3363 * level values reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern}, this key
3364 * may provide a more accurate way for the application to calculate
3365 * black level of each captured raw images.</p>
3366 * <p>When this key is reported, the {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} and
3367 * {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} will also be reported.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003368 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08003369 *
3370 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
3371 * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
3372 * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
3373 */
3374 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003375 @NonNull
Zhijun Hecd950b62015-11-12 17:47:52 -08003376 public static final Key<android.graphics.Rect[]> SENSOR_OPTICAL_BLACK_REGIONS =
3377 new Key<android.graphics.Rect[]>("android.sensor.opticalBlackRegions", android.graphics.Rect[].class);
3378
3379 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003380 * <p>List of lens shading modes for {@link CaptureRequest#SHADING_MODE android.shading.mode} that are supported by this camera device.</p>
3381 * <p>This list contains lens shading modes that can be set for the camera device.
3382 * Camera devices that support the MANUAL_POST_PROCESSING capability will always
3383 * list OFF and FAST mode. This includes all FULL level devices.
3384 * LEGACY devices will always only support FAST mode.</p>
3385 * <p><b>Range of valid values:</b><br>
3386 * Any value listed in {@link CaptureRequest#SHADING_MODE android.shading.mode}</p>
3387 * <p>This key is available on all devices.</p>
3388 *
3389 * @see CaptureRequest#SHADING_MODE
3390 */
3391 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003392 @NonNull
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003393 public static final Key<int[]> SHADING_AVAILABLE_MODES =
3394 new Key<int[]>("android.shading.availableModes", int[].class);
3395
3396 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003397 * <p>List of face detection modes for {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} that are
3398 * supported by this camera device.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003399 * <p>OFF is always supported.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003400 * <p><b>Range of valid values:</b><br>
3401 * Any value listed in {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003402 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003403 *
3404 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003405 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003406 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003407 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003408 public static final Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES =
3409 new Key<int[]>("android.statistics.info.availableFaceDetectModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003410
3411 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003412 * <p>The maximum number of simultaneously detectable
3413 * faces.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003414 * <p><b>Range of valid values:</b><br>
3415 * 0 for cameras without available face detection; otherwise:
3416 * <code>&gt;=4</code> for LIMITED or FULL hwlevel devices or
3417 * <code>&gt;0</code> for LEGACY devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003418 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003419 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003420 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003421 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003422 public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT =
3423 new Key<Integer>("android.statistics.info.maxFaceCount", int.class);
3424
3425 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003426 * <p>List of hot pixel map output modes for {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode} that are
3427 * supported by this camera device.</p>
3428 * <p>If no hotpixel map output is available for this camera device, this will contain only
3429 * <code>false</code>.</p>
3430 * <p>ON is always supported on devices with the RAW capability.</p>
3431 * <p><b>Range of valid values:</b><br>
3432 * Any value listed in {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003433 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003434 *
3435 * @see CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE
3436 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003437 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003438 @NonNull
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003439 public static final Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES =
3440 new Key<boolean[]>("android.statistics.info.availableHotPixelMapModes", boolean[].class);
3441
3442 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003443 * <p>List of lens shading map output modes for {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} that
3444 * are supported by this camera device.</p>
3445 * <p>If no lens shading map output is available for this camera device, this key will
3446 * contain only OFF.</p>
3447 * <p>ON is always supported on devices with the RAW capability.
3448 * LEGACY mode devices will always only support OFF.</p>
3449 * <p><b>Range of valid values:</b><br>
3450 * Any value listed in {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003451 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003452 *
3453 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3454 */
3455 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003456 @NonNull
Yin-Chia Yeh656931d2015-05-22 16:37:27 -07003457 public static final Key<int[]> STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES =
3458 new Key<int[]>("android.statistics.info.availableLensShadingMapModes", int[].class);
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003459
3460 /**
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003461 * <p>List of OIS data output modes for {@link CaptureRequest#STATISTICS_OIS_DATA_MODE android.statistics.oisDataMode} that
3462 * are supported by this camera device.</p>
3463 * <p>If no OIS data output is available for this camera device, this key will
3464 * contain only OFF.</p>
3465 * <p><b>Range of valid values:</b><br>
3466 * Any value listed in {@link CaptureRequest#STATISTICS_OIS_DATA_MODE android.statistics.oisDataMode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003467 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003468 *
3469 * @see CaptureRequest#STATISTICS_OIS_DATA_MODE
3470 */
3471 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003472 @NonNull
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003473 public static final Key<int[]> STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES =
3474 new Key<int[]>("android.statistics.info.availableOisDataModes", int[].class);
3475
3476 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003477 * <p>Maximum number of supported points in the
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003478 * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003479 * <p>If the actual number of points provided by the application (in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}*) is
3480 * less than this maximum, the camera device will resample the curve to its internal
3481 * representation, using linear interpolation.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08003482 * <p>The output curves in the result metadata may have a different number
3483 * of points than the input curves, and will represent the actual
3484 * hardware curves used as closely as possible when linearly interpolated.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003485 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003486 * <p><b>Full capability</b> -
3487 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3488 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkine0060932014-01-17 17:24:11 -08003489 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003490 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003491 * @see CaptureRequest#TONEMAP_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003492 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003493 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003494 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003495 public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS =
3496 new Key<Integer>("android.tonemap.maxCurvePoints", int.class);
3497
3498 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003499 * <p>List of tonemapping modes for {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} that are supported by this camera
3500 * device.</p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003501 * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always contain
3502 * at least one of below mode combinations:</p>
3503 * <ul>
Yin-Chia Yehfba08dd2015-04-02 14:05:14 -07003504 * <li>CONTRAST_CURVE, FAST and HIGH_QUALITY</li>
3505 * <li>GAMMA_VALUE, PRESET_CURVE, FAST and HIGH_QUALITY</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003506 * </ul>
3507 * <p>This includes all FULL level devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003508 * <p><b>Range of valid values:</b><br>
3509 * Any value listed in {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003510 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003511 * <p><b>Full capability</b> -
3512 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3513 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003514 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003515 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003516 * @see CaptureRequest#TONEMAP_MODE
3517 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003518 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003519 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003520 public static final Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES =
3521 new Key<int[]>("android.tonemap.availableToneMapModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003522
3523 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003524 * <p>A list of camera LEDs that are available on this system.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003525 * <p><b>Possible values:</b>
3526 * <ul>
3527 * <li>{@link #LED_AVAILABLE_LEDS_TRANSMIT TRANSMIT}</li>
3528 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003529 * <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 -07003530 * @see #LED_AVAILABLE_LEDS_TRANSMIT
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003531 * @hide
3532 */
3533 public static final Key<int[]> LED_AVAILABLE_LEDS =
3534 new Key<int[]>("android.led.availableLeds", int[].class);
3535
3536 /**
Igor Murashkine46c0da2014-02-07 18:34:37 -08003537 * <p>Generally classifies the overall set of the camera device functionality.</p>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003538 * <p>The supported hardware level is a high-level description of the camera device's
3539 * capabilities, summarizing several capabilities into one field. Each level adds additional
3540 * features to the previous one, and is always a strict superset of the previous level.
3541 * The ordering is <code>LEGACY &lt; LIMITED &lt; FULL &lt; LEVEL_3</code>.</p>
3542 * <p>Starting from <code>LEVEL_3</code>, the level enumerations are guaranteed to be in increasing
3543 * numerical value as well. To check if a given device is at least at a given hardware level,
3544 * the following code snippet can be used:</p>
3545 * <pre><code>// Returns true if the device supports the required hardware level, or better.
3546 * boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) {
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003547 * final int[] sortedHwLevels = {
3548 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY,
3549 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL,
3550 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
3551 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL,
3552 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_3
3553 * };
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003554 * int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003555 * if (requiredLevel == deviceLevel) {
3556 * return true;
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003557 * }
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003558 *
3559 * for (int sortedlevel : sortedHwLevels) {
3560 * if (sortedlevel == requiredLevel) {
3561 * return true;
3562 * } else if (sortedlevel == deviceLevel) {
3563 * return false;
3564 * }
3565 * }
3566 * return false; // Should never reach here
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003567 * }
3568 * </code></pre>
3569 * <p>At a high level, the levels are:</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08003570 * <ul>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003571 * <li><code>LEGACY</code> devices operate in a backwards-compatibility mode for older
3572 * Android devices, and have very limited capabilities.</li>
3573 * <li><code>LIMITED</code> devices represent the
3574 * baseline feature set, and may also include additional capabilities that are
3575 * subsets of <code>FULL</code>.</li>
3576 * <li><code>FULL</code> devices additionally support per-frame manual control of sensor, flash, lens and
3577 * post-processing settings, and image capture at a high rate.</li>
3578 * <li><code>LEVEL_3</code> devices additionally support YUV reprocessing and RAW image capture, along
3579 * with additional output stream configurations.</li>
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003580 * <li><code>EXTERNAL</code> devices are similar to <code>LIMITED</code> devices with exceptions like some sensor or
3581 * lens information not reorted or less stable framerates.</li>
Igor Murashkine46c0da2014-02-07 18:34:37 -08003582 * </ul>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003583 * <p>See the individual level enums for full descriptions of the supported capabilities. The
3584 * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} entry describes the device's capabilities at a
3585 * finer-grain level, if needed. In addition, many controls have their available settings or
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003586 * ranges defined in individual entries from {@link android.hardware.camera2.CameraCharacteristics }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003587 * <p>Some features are not part of any particular hardware level or capability and must be
3588 * queried separately. These include:</p>
3589 * <ul>
3590 * <li>Calibrated timestamps ({@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME)</li>
3591 * <li>Precision lens control ({@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} <code>==</code> CALIBRATED)</li>
3592 * <li>Face detection ({@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes})</li>
3593 * <li>Optical or electrical image stabilization
3594 * ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization},
3595 * {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes})</li>
3596 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003597 * <p><b>Possible values:</b>
3598 * <ul>
3599 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED}</li>
3600 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}</li>
3601 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}</li>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003602 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_3 3}</li>
Yin-Chia Yeh43cea5a2018-01-19 11:38:12 -08003603 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL EXTERNAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003604 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003605 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08003606 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003607 * @see CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES
3608 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
3609 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Igor Murashkine46c0da2014-02-07 18:34:37 -08003610 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003611 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
3612 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003613 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
3614 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
Ruben Brunk4a61a862014-07-01 16:00:26 -07003615 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003616 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_3
Yin-Chia Yeh43cea5a2018-01-19 11:38:12 -08003617 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003618 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003619 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003620 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003621 public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
3622 new Key<Integer>("android.info.supportedHardwareLevel", int.class);
3623
Igor Murashkin3865a842014-01-17 18:18:39 -08003624 /**
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08003625 * <p>A short string for manufacturer version information about the camera device, such as
3626 * ISP hardware, sensors, etc.</p>
3627 * <p>This can be used in {@link android.media.ExifInterface#TAG_IMAGE_DESCRIPTION TAG_IMAGE_DESCRIPTION}
3628 * in jpeg EXIF. This key may be absent if no version information is available on the
3629 * device.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003630 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08003631 */
3632 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003633 @NonNull
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08003634 public static final Key<String> INFO_VERSION =
3635 new Key<String>("android.info.version", String.class);
3636
3637 /**
Igor Murashkin3865a842014-01-17 18:18:39 -08003638 * <p>The maximum number of frames that can occur after a request
3639 * (different than the previous) has been submitted, and before the
Chien-Yu Chen161a76c2015-06-26 11:23:55 -07003640 * result's state becomes synchronized.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003641 * <p>This defines the maximum distance (in number of metadata results),
Chien-Yu Chen161a76c2015-06-26 11:23:55 -07003642 * between the frame number of the request that has new controls to apply
3643 * and the frame number of the result that has all the controls applied.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003644 * <p>In other words this acts as an upper boundary for how many frames
3645 * must occur before the camera device knows for a fact that the new
3646 * submitted camera settings have been applied in outgoing frames.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003647 * <p><b>Units</b>: Frame counts</p>
3648 * <p><b>Possible values:</b>
3649 * <ul>
3650 * <li>{@link #SYNC_MAX_LATENCY_PER_FRAME_CONTROL PER_FRAME_CONTROL}</li>
3651 * <li>{@link #SYNC_MAX_LATENCY_UNKNOWN UNKNOWN}</li>
3652 * </ul></p>
3653 * <p><b>Available values for this device:</b><br>
3654 * A positive value, PER_FRAME_CONTROL, or UNKNOWN.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003655 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003656 * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL
3657 * @see #SYNC_MAX_LATENCY_UNKNOWN
3658 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003659 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003660 @NonNull
Igor Murashkin3865a842014-01-17 18:18:39 -08003661 public static final Key<Integer> SYNC_MAX_LATENCY =
3662 new Key<Integer>("android.sync.maxLatency", int.class);
3663
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003664 /**
Zhijun He513f7c32015-04-24 18:23:54 -07003665 * <p>The maximal camera capture pipeline stall (in unit of frame count) introduced by a
3666 * reprocess capture request.</p>
3667 * <p>The key describes the maximal interference that one reprocess (input) request
3668 * can introduce to the camera simultaneous streaming of regular (output) capture
3669 * requests, including repeating requests.</p>
3670 * <p>When a reprocessing capture request is submitted while a camera output repeating request
3671 * (e.g. preview) is being served by the camera device, it may preempt the camera capture
3672 * pipeline for at least one frame duration so that the camera device is unable to process
3673 * the following capture request in time for the next sensor start of exposure boundary.
3674 * When this happens, the application may observe a capture time gap (longer than one frame
3675 * duration) between adjacent capture output frames, which usually exhibits as preview
3676 * glitch if the repeating request output targets include a preview surface. This key gives
3677 * the worst-case number of frame stall introduced by one reprocess request with any kind of
3678 * formats/sizes combination.</p>
3679 * <p>If this key reports 0, it means a reprocess request doesn't introduce any glitch to the
3680 * ongoing camera repeating request outputs, as if this reprocess request is never issued.</p>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07003681 * <p>This key is supported if the camera device supports PRIVATE or YUV reprocessing (
3682 * i.e. {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains PRIVATE_REPROCESSING or
Zhijun He513f7c32015-04-24 18:23:54 -07003683 * YUV_REPROCESSING).</p>
3684 * <p><b>Units</b>: Number of frames.</p>
3685 * <p><b>Range of valid values:</b><br>
3686 * &lt;= 4</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003687 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07003688 * <p><b>Limited capability</b> -
3689 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3690 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3691 *
3692 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3693 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3694 */
3695 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003696 @NonNull
Zhijun He513f7c32015-04-24 18:23:54 -07003697 public static final Key<Integer> REPROCESS_MAX_CAPTURE_STALL =
3698 new Key<Integer>("android.reprocess.maxCaptureStall", int.class);
3699
3700 /**
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003701 * <p>The available depth dataspace stream
3702 * configurations that this camera device supports
3703 * (i.e. format, width, height, output/input stream).</p>
3704 * <p>These are output stream configurations for use with
3705 * dataSpace HAL_DATASPACE_DEPTH. The configurations are
3706 * listed as <code>(format, width, height, input?)</code> tuples.</p>
3707 * <p>Only devices that support depth output for at least
3708 * the HAL_PIXEL_FORMAT_Y16 dense depth map may include
3709 * this entry.</p>
3710 * <p>A device that also supports the HAL_PIXEL_FORMAT_BLOB
3711 * sparse depth point cloud must report a single entry for
3712 * the format in this list as <code>(HAL_PIXEL_FORMAT_BLOB,
3713 * android.depth.maxDepthSamples, 1, OUTPUT)</code> in addition to
3714 * the entries for HAL_PIXEL_FORMAT_Y16.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003715 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003716 * <p><b>Limited capability</b> -
3717 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3718 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3719 *
3720 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3721 * @hide
3722 */
3723 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS =
3724 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
3725
3726 /**
3727 * <p>This lists the minimum frame duration for each
3728 * format/size combination for depth output formats.</p>
3729 * <p>This should correspond to the frame duration when only that
3730 * stream is active, with all processing (typically in android.*.mode)
3731 * set to either OFF or FAST.</p>
3732 * <p>When multiple streams are used in a request, the minimum frame
3733 * duration will be max(individual stream min durations).</p>
3734 * <p>The minimum frame duration of a stream (of a particular format, size)
3735 * is the same regardless of whether the stream is input or output.</p>
3736 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
3737 * android.scaler.availableStallDurations for more details about
3738 * calculating the max frame rate.</p>
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003739 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003740 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003741 * <p><b>Limited capability</b> -
3742 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3743 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3744 *
3745 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3746 * @see CaptureRequest#SENSOR_FRAME_DURATION
3747 * @hide
3748 */
3749 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS =
3750 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3751
3752 /**
3753 * <p>This lists the maximum stall duration for each
Zhijun He513f7c32015-04-24 18:23:54 -07003754 * output format/size combination for depth streams.</p>
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003755 * <p>A stall duration is how much extra time would get added
3756 * to the normal minimum frame duration for a repeating request
3757 * that has streams with non-zero stall.</p>
3758 * <p>This functions similarly to
3759 * android.scaler.availableStallDurations for depth
3760 * streams.</p>
3761 * <p>All depth output stream formats may have a nonzero stall
3762 * duration.</p>
3763 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003764 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003765 * <p><b>Limited capability</b> -
3766 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3767 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3768 *
3769 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3770 * @hide
3771 */
3772 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS =
3773 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3774
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07003775 /**
3776 * <p>Indicates whether a capture request may target both a
3777 * DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as
3778 * YUV_420_888, JPEG, or RAW) simultaneously.</p>
3779 * <p>If TRUE, including both depth and color outputs in a single
3780 * capture request is not supported. An application must interleave color
3781 * and depth requests. If FALSE, a single request can target both types
3782 * of output.</p>
3783 * <p>Typically, this restriction exists on camera devices that
3784 * need to emit a specific pattern or wavelength of light to
3785 * measure depth values, which causes the color image to be
3786 * corrupted during depth measurement.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003787 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07003788 * <p><b>Limited capability</b> -
3789 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3790 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3791 *
3792 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3793 */
3794 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003795 @NonNull
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07003796 public static final Key<Boolean> DEPTH_DEPTH_IS_EXCLUSIVE =
3797 new Key<Boolean>("android.depth.depthIsExclusive", boolean.class);
3798
Shuzhen Wang23d29382017-11-26 17:24:56 -08003799 /**
Emilian Peev2776ca32018-09-18 14:00:39 +01003800 * <p>Recommended depth stream configurations for common client use cases.</p>
3801 * <p>Optional subset of the android.depth.availableDepthStreamConfigurations that
3802 * contains similar tuples listed as
3803 * (i.e. width, height, format, output/input stream, usecase bit field).
3804 * Camera devices will be able to suggest particular depth stream configurations which are
3805 * power and performance efficient for specific use cases. For more information about
3806 * retrieving the suggestions see
3807 * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003808 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev2776ca32018-09-18 14:00:39 +01003809 * @hide
3810 */
3811 public static final Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]> DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS =
3812 new Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]>("android.depth.availableRecommendedDepthStreamConfigurations", android.hardware.camera2.params.RecommendedStreamConfiguration[].class);
3813
3814 /**
Emilian Peev934ffa62019-01-04 17:48:31 +00003815 * <p>The available dynamic depth dataspace stream
3816 * configurations that this camera device supports
3817 * (i.e. format, width, height, output/input stream).</p>
3818 * <p>These are output stream configurations for use with
3819 * dataSpace DYNAMIC_DEPTH. The configurations are
3820 * listed as <code>(format, width, height, input?)</code> tuples.</p>
3821 * <p>Only devices that support depth output for at least
3822 * the HAL_PIXEL_FORMAT_Y16 dense depth map along with
3823 * HAL_PIXEL_FORMAT_BLOB with the same size or size with
3824 * the same aspect ratio can have dynamic depth dataspace
3825 * stream configuration. {@link CameraCharacteristics#DEPTH_DEPTH_IS_EXCLUSIVE android.depth.depthIsExclusive} also
3826 * needs to be set to FALSE.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003827 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev934ffa62019-01-04 17:48:31 +00003828 *
3829 * @see CameraCharacteristics#DEPTH_DEPTH_IS_EXCLUSIVE
3830 * @hide
3831 */
3832 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS =
3833 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDynamicDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
3834
3835 /**
3836 * <p>This lists the minimum frame duration for each
3837 * format/size combination for dynamic depth output streams.</p>
3838 * <p>This should correspond to the frame duration when only that
3839 * stream is active, with all processing (typically in android.*.mode)
3840 * set to either OFF or FAST.</p>
3841 * <p>When multiple streams are used in a request, the minimum frame
3842 * duration will be max(individual stream min durations).</p>
3843 * <p>The minimum frame duration of a stream (of a particular format, size)
3844 * is the same regardless of whether the stream is input or output.</p>
3845 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003846 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev934ffa62019-01-04 17:48:31 +00003847 * @hide
3848 */
3849 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS =
3850 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDynamicDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3851
3852 /**
3853 * <p>This lists the maximum stall duration for each
3854 * output format/size combination for dynamic depth streams.</p>
3855 * <p>A stall duration is how much extra time would get added
3856 * to the normal minimum frame duration for a repeating request
3857 * that has streams with non-zero stall.</p>
3858 * <p>All dynamic depth output streams may have a nonzero stall
3859 * duration.</p>
3860 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003861 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev934ffa62019-01-04 17:48:31 +00003862 * @hide
3863 */
3864 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS =
3865 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDynamicDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3866
3867 /**
Shuzhen Wang23d29382017-11-26 17:24:56 -08003868 * <p>String containing the ids of the underlying physical cameras.</p>
Shuzhen Wang61aaa322018-11-19 16:04:57 -08003869 * <p>For a logical camera, this is concatenation of all underlying physical camera IDs.
3870 * The null terminator for physical camera ID must be preserved so that the whole string
3871 * can be tokenized using '\0' to generate list of physical camera IDs.</p>
3872 * <p>For example, if the physical camera IDs of the logical camera are "2" and "3", the
Shuzhen Wang23d29382017-11-26 17:24:56 -08003873 * value of this tag will be ['2', '\0', '3', '\0'].</p>
Shuzhen Wang61aaa322018-11-19 16:04:57 -08003874 * <p>The number of physical camera IDs must be no less than 2.</p>
Shuzhen Wang23d29382017-11-26 17:24:56 -08003875 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003876 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Shuzhen Wang23d29382017-11-26 17:24:56 -08003877 * <p><b>Limited capability</b> -
3878 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3879 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3880 *
3881 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3882 * @hide
3883 */
3884 public static final Key<byte[]> LOGICAL_MULTI_CAMERA_PHYSICAL_IDS =
3885 new Key<byte[]>("android.logicalMultiCamera.physicalIds", byte[].class);
3886
3887 /**
3888 * <p>The accuracy of frame timestamp synchronization between physical cameras</p>
3889 * <p>The accuracy of the frame timestamp synchronization determines the physical cameras'
3890 * ability to start exposure at the same time. If the sensorSyncType is CALIBRATED,
3891 * the physical camera sensors usually run in master-slave mode so that their shutter
3892 * time is synchronized. For APPROXIMATE sensorSyncType, the camera sensors usually run in
3893 * master-master mode, and there could be offset between their start of exposure.</p>
3894 * <p>In both cases, all images generated for a particular capture request still carry the same
3895 * timestamps, so that they can be used to look up the matching frame number and
3896 * onCaptureStarted callback.</p>
3897 * <p><b>Possible values:</b>
3898 * <ul>
3899 * <li>{@link #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE APPROXIMATE}</li>
3900 * <li>{@link #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED CALIBRATED}</li>
3901 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003902 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Shuzhen Wang23d29382017-11-26 17:24:56 -08003903 * <p><b>Limited capability</b> -
3904 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3905 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3906 *
3907 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3908 * @see #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE
3909 * @see #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED
3910 */
3911 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003912 @NonNull
Shuzhen Wang23d29382017-11-26 17:24:56 -08003913 public static final Key<Integer> LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE =
3914 new Key<Integer>("android.logicalMultiCamera.sensorSyncType", int.class);
3915
Eino-Ville Talvala41670722018-03-13 19:43:07 -07003916 /**
3917 * <p>List of distortion correction modes for {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} that are
3918 * supported by this camera device.</p>
3919 * <p>No device is required to support this API; such devices will always list only 'OFF'.
3920 * All devices that support this API will list both FAST and HIGH_QUALITY.</p>
3921 * <p><b>Range of valid values:</b><br>
3922 * Any value listed in {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003923 * <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 -07003924 *
3925 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
3926 */
3927 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003928 @NonNull
Eino-Ville Talvala41670722018-03-13 19:43:07 -07003929 public static final Key<int[]> DISTORTION_CORRECTION_AVAILABLE_MODES =
3930 new Key<int[]>("android.distortionCorrection.availableModes", int[].class);
3931
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08003932 /**
3933 * <p>The available HEIC (ISO/IEC 23008-12) stream
3934 * configurations that this camera device supports
3935 * (i.e. format, width, height, output/input stream).</p>
3936 * <p>The configurations are listed as <code>(format, width, height, input?)</code> tuples.</p>
3937 * <p>If the camera device supports HEIC image format, it will support identical set of stream
3938 * combinations involving HEIC image format, compared to the combinations involving JPEG
3939 * image format as required by the device's hardware level and capabilities.</p>
3940 * <p>All the static, control, and dynamic metadata tags related to JPEG apply to HEIC formats.
3941 * Configuring JPEG and HEIC streams at the same time is not supported.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003942 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08003943 * <p><b>Limited capability</b> -
3944 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3945 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3946 *
3947 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3948 * @hide
3949 */
3950 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS =
3951 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.heic.availableHeicStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
3952
3953 /**
3954 * <p>This lists the minimum frame duration for each
3955 * format/size combination for HEIC output formats.</p>
3956 * <p>This should correspond to the frame duration when only that
3957 * stream is active, with all processing (typically in android.*.mode)
3958 * set to either OFF or FAST.</p>
3959 * <p>When multiple streams are used in a request, the minimum frame
3960 * duration will be max(individual stream min durations).</p>
3961 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
3962 * android.scaler.availableStallDurations for more details about
3963 * calculating the max frame rate.</p>
3964 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003965 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08003966 * <p><b>Limited capability</b> -
3967 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3968 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3969 *
3970 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3971 * @see CaptureRequest#SENSOR_FRAME_DURATION
3972 * @hide
3973 */
3974 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS =
3975 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3976
3977 /**
3978 * <p>This lists the maximum stall duration for each
3979 * output format/size combination for HEIC streams.</p>
3980 * <p>A stall duration is how much extra time would get added
3981 * to the normal minimum frame duration for a repeating request
3982 * that has streams with non-zero stall.</p>
3983 * <p>This functions similarly to
3984 * android.scaler.availableStallDurations for HEIC
3985 * streams.</p>
3986 * <p>All HEIC output stream formats may have a nonzero stall
3987 * duration.</p>
3988 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003989 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08003990 * <p><b>Limited capability</b> -
3991 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3992 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3993 *
3994 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3995 * @hide
3996 */
3997 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_STALL_DURATIONS =
3998 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3999
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004000 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
4001 * End generated code
4002 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07004003
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004004
4005
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004006
4007
4008
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08004009}