blob: b149d7798aab2cf7130ff872ebf3896428759c5e [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;
Artur Satayev26958002019-12-10 17:47:52 +000021import android.compat.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 *
Eino-Ville Talvalab79cde62020-05-11 14:24:27 -070046 * <p>When obtained by a client that does not hold the CAMERA permission, some metadata values are
47 * not included. The list of keys that require the permission is given by
48 * {@link #getKeysNeedingPermission}.</p>
49 *
Ruben Brunkf967a542014-04-28 16:31:11 -070050 * <p>{@link CameraCharacteristics} objects are immutable.</p>
51 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080052 * @see CameraDevice
53 * @see CameraManager
54 */
Igor Murashkind6d65152014-05-19 16:31:02 -070055public final class CameraCharacteristics extends CameraMetadata<CameraCharacteristics.Key<?>> {
56
57 /**
58 * A {@code Key} is used to do camera characteristics field lookups with
59 * {@link CameraCharacteristics#get}.
60 *
61 * <p>For example, to get the stream configuration map:
62 * <code><pre>
63 * StreamConfigurationMap map = cameraCharacteristics.get(
64 * CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
65 * </pre></code>
66 * </p>
67 *
68 * <p>To enumerate over all possible keys for {@link CameraCharacteristics}, see
69 * {@link CameraCharacteristics#getKeys()}.</p>
70 *
71 * @see CameraCharacteristics#get
72 * @see CameraCharacteristics#getKeys()
73 */
74 public static final class Key<T> {
75 private final CameraMetadataNative.Key<T> mKey;
76
77 /**
78 * Visible for testing and vendor extensions only.
79 *
80 * @hide
81 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +010082 @UnsupportedAppUsage
Emilian Peevde62d842017-03-23 19:20:40 +000083 public Key(String name, Class<T> type, long vendorId) {
84 mKey = new CameraMetadataNative.Key<T>(name, type, vendorId);
85 }
86
87 /**
88 * Visible for testing and vendor extensions only.
89 *
90 * @hide
91 */
David Brazdil67e37d62019-03-08 11:26:46 +000092 public Key(String name, String fallbackName, Class<T> type) {
Justin Yunf01e40c2018-05-18 20:39:45 +090093 mKey = new CameraMetadataNative.Key<T>(name, fallbackName, type);
94 }
95
96 /**
Eino-Ville Talvala1cf59fd2019-01-25 17:33:05 -080097 * Construct a new Key with a given name and type.
Justin Yunf01e40c2018-05-18 20:39:45 +090098 *
Eino-Ville Talvala1cf59fd2019-01-25 17:33:05 -080099 * <p>Normally, applications should use the existing Key definitions in
100 * {@link CameraCharacteristics}, and not need to construct their own Key objects. However,
101 * they may be useful for testing purposes and for defining custom camera
102 * characteristics.</p>
Justin Yunf01e40c2018-05-18 20:39:45 +0900103 */
Eino-Ville Talvala79d4aac2019-03-06 14:26:10 -0800104 public Key(@NonNull String name, @NonNull Class<T> type) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700105 mKey = new CameraMetadataNative.Key<T>(name, type);
106 }
107
108 /**
109 * Visible for testing and vendor extensions only.
110 *
111 * @hide
112 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100113 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700114 public Key(String name, TypeReference<T> typeReference) {
115 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
116 }
117
118 /**
119 * Return a camelCase, period separated name formatted like:
120 * {@code "root.section[.subsections].name"}.
121 *
122 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
123 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
124 *
125 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
126 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
127 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
128 *
129 * @return String representation of the key name
130 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700131 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700132 public String getName() {
133 return mKey.getName();
134 }
135
136 /**
Emilian Peevde62d842017-03-23 19:20:40 +0000137 * Return vendor tag id.
138 *
139 * @hide
140 */
141 public long getVendorId() {
142 return mKey.getVendorId();
143 }
144
145 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700146 * {@inheritDoc}
147 */
148 @Override
149 public final int hashCode() {
150 return mKey.hashCode();
151 }
152
153 /**
154 * {@inheritDoc}
155 */
156 @SuppressWarnings("unchecked")
157 @Override
158 public final boolean equals(Object o) {
159 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
160 }
161
162 /**
Chien-Yu Chen12a83852015-07-07 12:17:22 -0700163 * Return this {@link Key} as a string representation.
164 *
165 * <p>{@code "CameraCharacteristics.Key(%s)"}, where {@code %s} represents
166 * the name of this key as returned by {@link #getName}.</p>
167 *
168 * @return string representation of {@link Key}
169 */
170 @NonNull
171 @Override
172 public String toString() {
173 return String.format("CameraCharacteristics.Key(%s)", mKey.getName());
174 }
175
176 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700177 * Visible for CameraMetadataNative implementation only; do not use.
178 *
179 * TODO: Make this private or remove it altogether.
180 *
181 * @hide
182 */
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100183 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700184 public CameraMetadataNative.Key<T> getNativeKey() {
185 return mKey;
186 }
187
188 @SuppressWarnings({
189 "unused", "unchecked"
190 })
191 private Key(CameraMetadataNative.Key<?> nativeKey) {
192 mKey = (CameraMetadataNative.Key<T>) nativeKey;
193 }
194 }
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700195
Mathew Inwoodbcbe4402018-08-08 15:42:59 +0100196 @UnsupportedAppUsage
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700197 private final CameraMetadataNative mProperties;
Igor Murashkincc542a42014-06-25 11:52:23 -0700198 private List<CameraCharacteristics.Key<?>> mKeys;
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100199 private List<CameraCharacteristics.Key<?>> mKeysNeedingPermission;
Igor Murashkind6d65152014-05-19 16:31:02 -0700200 private List<CaptureRequest.Key<?>> mAvailableRequestKeys;
Emilian Peev75a55702017-11-07 16:09:59 +0000201 private List<CaptureRequest.Key<?>> mAvailableSessionKeys;
Emilian Peev2100ae72018-01-12 16:56:25 +0000202 private List<CaptureRequest.Key<?>> mAvailablePhysicalRequestKeys;
Igor Murashkind6d65152014-05-19 16:31:02 -0700203 private List<CaptureResult.Key<?>> mAvailableResultKeys;
Emilian Peev2776ca32018-09-18 14:00:39 +0100204 private ArrayList<RecommendedStreamConfigurationMap> mRecommendedConfigurations;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700205
206 /**
207 * Takes ownership of the passed-in properties object
208 * @hide
209 */
Igor Murashkin68f40062013-09-10 12:15:54 -0700210 public CameraCharacteristics(CameraMetadataNative properties) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700211 mProperties = CameraMetadataNative.move(properties);
Emilian Peevde62d842017-03-23 19:20:40 +0000212 setNativeInstance(mProperties);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700213 }
214
Ruben Brunkf967a542014-04-28 16:31:11 -0700215 /**
216 * Returns a copy of the underlying {@link CameraMetadataNative}.
217 * @hide
218 */
219 public CameraMetadataNative getNativeCopy() {
220 return new CameraMetadataNative(mProperties);
221 }
222
Igor Murashkind6d65152014-05-19 16:31:02 -0700223 /**
224 * Get a camera characteristics field value.
225 *
226 * <p>The field definitions can be
227 * found in {@link CameraCharacteristics}.</p>
228 *
229 * <p>Querying the value for the same key more than once will return a value
230 * which is equal to the previous queried value.</p>
231 *
232 * @throws IllegalArgumentException if the key was not valid
233 *
234 * @param key The characteristics field to read.
235 * @return The value of that key, or {@code null} if the field is not set.
236 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700237 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700238 public <T> T get(Key<T> key) {
239 return mProperties.get(key);
240 }
241
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700242 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700243 * {@inheritDoc}
244 * @hide
245 */
246 @SuppressWarnings("unchecked")
247 @Override
248 protected <T> T getProtected(Key<?> key) {
249 return (T) mProperties.get(key);
250 }
251
252 /**
253 * {@inheritDoc}
254 * @hide
255 */
256 @SuppressWarnings("unchecked")
257 @Override
258 protected Class<Key<?>> getKeyClass() {
259 Object thisClass = Key.class;
260 return (Class<Key<?>>)thisClass;
261 }
262
263 /**
264 * {@inheritDoc}
265 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700266 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700267 @Override
268 public List<Key<?>> getKeys() {
Igor Murashkincc542a42014-06-25 11:52:23 -0700269 // List of keys is immutable; cache the results after we calculate them
270 if (mKeys != null) {
271 return mKeys;
272 }
273
274 int[] filterTags = get(REQUEST_AVAILABLE_CHARACTERISTICS_KEYS);
275 if (filterTags == null) {
276 throw new AssertionError("android.request.availableCharacteristicsKeys must be non-null"
277 + " in the characteristics");
278 }
279
280 mKeys = Collections.unmodifiableList(
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100281 getKeys(getClass(), getKeyClass(), this, filterTags, true));
Igor Murashkincc542a42014-06-25 11:52:23 -0700282 return mKeys;
Igor Murashkind6d65152014-05-19 16:31:02 -0700283 }
284
285 /**
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100286 * <p>Returns a subset of the list returned by {@link #getKeys} with all keys that
287 * require camera clients to obtain the {@link android.Manifest.permission#CAMERA} permission.
288 * </p>
289 *
290 * <p>If an application calls {@link CameraManager#getCameraCharacteristics} without holding the
291 * {@link android.Manifest.permission#CAMERA} permission,
292 * all keys in this list will not be available, and calling {@link #get} will
293 * return null for those keys. If the application obtains the
294 * {@link android.Manifest.permission#CAMERA} permission, then the
295 * CameraCharacteristics from a call to a subsequent
296 * {@link CameraManager#getCameraCharacteristics} will have the keys available.</p>
297 *
298 * <p>The list returned is not modifiable, so any attempts to modify it will throw
299 * a {@code UnsupportedOperationException}.</p>
300 *
301 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
302 *
303 * @return List of camera characteristic keys that require the
Emilian Peev5389f1a2019-02-28 10:13:39 -0800304 * {@link android.Manifest.permission#CAMERA} permission. The list can be empty in case
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100305 * there are no currently present keys that need additional permission.
306 */
Emilian Peev5389f1a2019-02-28 10:13:39 -0800307 public @NonNull List<Key<?>> getKeysNeedingPermission() {
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100308 if (mKeysNeedingPermission == null) {
309 Object crKey = CameraCharacteristics.Key.class;
310 Class<CameraCharacteristics.Key<?>> crKeyTyped =
311 (Class<CameraCharacteristics.Key<?>>)crKey;
312
313 int[] filterTags = get(REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION);
314 if (filterTags == null) {
Emilian Peev5389f1a2019-02-28 10:13:39 -0800315 mKeysNeedingPermission = Collections.unmodifiableList(
316 new ArrayList<CameraCharacteristics.Key<?>> ());
317 return mKeysNeedingPermission;
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100318 }
319 mKeysNeedingPermission =
320 getAvailableKeyList(CameraCharacteristics.class, crKeyTyped, filterTags,
321 /*includeSynthetic*/ false);
322 }
323 return mKeysNeedingPermission;
324 }
325
326 /**
Emilian Peev2776ca32018-09-18 14:00:39 +0100327 * <p>Retrieve camera device recommended stream configuration map
328 * {@link RecommendedStreamConfigurationMap} for a given use case.</p>
329 *
330 * <p>The stream configurations advertised here are efficient in terms of power and performance
331 * for common use cases like preview, video, snapshot, etc. The recommended maps are usually
332 * only small subsets of the exhaustive list provided in
333 * {@link #SCALER_STREAM_CONFIGURATION_MAP} and suggested for a particular use case by the
334 * camera device implementation. For further information about the expected configurations in
335 * various scenarios please refer to:
336 * <ul>
337 * <li>{@link RecommendedStreamConfigurationMap#USECASE_PREVIEW}</li>
338 * <li>{@link RecommendedStreamConfigurationMap#USECASE_RECORD}</li>
339 * <li>{@link RecommendedStreamConfigurationMap#USECASE_VIDEO_SNAPSHOT}</li>
340 * <li>{@link RecommendedStreamConfigurationMap#USECASE_SNAPSHOT}</li>
341 * <li>{@link RecommendedStreamConfigurationMap#USECASE_RAW}</li>
342 * <li>{@link RecommendedStreamConfigurationMap#USECASE_ZSL}</li>
Emilian Peev506acca2019-03-12 18:00:42 -0700343 * <li>{@link RecommendedStreamConfigurationMap#USECASE_LOW_LATENCY_SNAPSHOT}</li>
Emilian Peev2776ca32018-09-18 14:00:39 +0100344 * </ul>
345 * </p>
346 *
347 * <p>For example on how this can be used by camera clients to find out the maximum recommended
348 * preview and snapshot resolution, consider the following pseudo-code:
349 * </p>
350 * <pre><code>
351 * public static Size getMaxSize(Size... sizes) {
352 * if (sizes == null || sizes.length == 0) {
353 * throw new IllegalArgumentException("sizes was empty");
354 * }
355 *
356 * Size sz = sizes[0];
357 * for (Size size : sizes) {
358 * if (size.getWidth() * size.getHeight() &gt; sz.getWidth() * sz.getHeight()) {
359 * sz = size;
360 * }
361 * }
362 *
363 * return sz;
364 * }
365 *
366 * CameraCharacteristics characteristics =
367 * cameraManager.getCameraCharacteristics(cameraId);
368 * RecommendedStreamConfigurationMap previewConfig =
369 * characteristics.getRecommendedStreamConfigurationMap(
370 * RecommendedStreamConfigurationMap.USECASE_PREVIEW);
371 * RecommendedStreamConfigurationMap snapshotConfig =
372 * characteristics.getRecommendedStreamConfigurationMap(
373 * RecommendedStreamConfigurationMap.USECASE_SNAPSHOT);
374 *
375 * if ((previewConfig != null) &amp;&amp; (snapshotConfig != null)) {
376 *
377 * Set<Size> snapshotSizeSet = snapshotConfig.getOutputSizes(
378 * ImageFormat.JPEG);
379 * Size[] snapshotSizes = new Size[snapshotSizeSet.size()];
380 * snapshotSizes = snapshotSizeSet.toArray(snapshotSizes);
381 * Size suggestedMaxJpegSize = getMaxSize(snapshotSizes);
382 *
383 * Set<Size> previewSizeSet = snapshotConfig.getOutputSizes(
384 * ImageFormat.PRIVATE);
385 * Size[] previewSizes = new Size[previewSizeSet.size()];
386 * previewSizes = previewSizeSet.toArray(previewSizes);
387 * Size suggestedMaxPreviewSize = getMaxSize(previewSizes);
388 * }
389 *
390 * </code></pre>
391 *
392 * <p>Similar logic can be used for other use cases as well.</p>
393 *
394 * <p>Support for recommended stream configurations is optional. In case there a no
395 * suggested configurations for the particular use case, please refer to
396 * {@link #SCALER_STREAM_CONFIGURATION_MAP} for the exhaustive available list.</p>
397 *
398 * @param usecase Use case id.
399 *
400 * @throws IllegalArgumentException In case the use case argument is invalid.
401 * @return Valid {@link RecommendedStreamConfigurationMap} or null in case the camera device
402 * doesn't have any recommendation for this use case or the recommended configurations
403 * are invalid.
404 */
Emilian Peevae4a3412018-11-27 16:47:19 +0000405 public @Nullable RecommendedStreamConfigurationMap getRecommendedStreamConfigurationMap(
Emilian Peev2776ca32018-09-18 14:00:39 +0100406 @RecommendedStreamConfigurationMap.RecommendedUsecase int usecase) {
407 if (((usecase >= RecommendedStreamConfigurationMap.USECASE_PREVIEW) &&
Emilian Peev506acca2019-03-12 18:00:42 -0700408 (usecase <= RecommendedStreamConfigurationMap.USECASE_LOW_LATENCY_SNAPSHOT)) ||
Emilian Peev2776ca32018-09-18 14:00:39 +0100409 ((usecase >= RecommendedStreamConfigurationMap.USECASE_VENDOR_START) &&
410 (usecase < RecommendedStreamConfigurationMap.MAX_USECASE_COUNT))) {
411 if (mRecommendedConfigurations == null) {
412 mRecommendedConfigurations = mProperties.getRecommendedStreamConfigurations();
413 if (mRecommendedConfigurations == null) {
414 return null;
415 }
416 }
417
418 return mRecommendedConfigurations.get(usecase);
419 }
420
421 throw new IllegalArgumentException(String.format("Invalid use case: %d", usecase));
422 }
423
424 /**
Emilian Peev75a55702017-11-07 16:09:59 +0000425 * <p>Returns a subset of {@link #getAvailableCaptureRequestKeys} keys that the
426 * camera device can pass as part of the capture session initialization.</p>
427 *
428 * <p>This list includes keys that are difficult to apply per-frame and
429 * can result in unexpected delays when modified during the capture session
430 * lifetime. Typical examples include parameters that require a
431 * time-consuming hardware re-configuration or internal camera pipeline
432 * change. For performance reasons we suggest clients to pass their initial
433 * values as part of {@link SessionConfiguration#setSessionParameters}. Once
434 * the camera capture session is enabled it is also recommended to avoid
435 * changing them from their initial values set in
436 * {@link SessionConfiguration#setSessionParameters }.
437 * Control over session parameters can still be exerted in capture requests
438 * but clients should be aware and expect delays during their application.
439 * An example usage scenario could look like this:</p>
440 * <ul>
Emilian Peev2776ca32018-09-18 14:00:39 +0100441 * <li>The camera client starts by querying the session parameter key list via
Emilian Peev75a55702017-11-07 16:09:59 +0000442 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
443 * <li>Before triggering the capture session create sequence, a capture request
444 * must be built via {@link CameraDevice#createCaptureRequest } using an
445 * appropriate template matching the particular use case.</li>
446 * <li>The client should go over the list of session parameters and check
447 * whether some of the keys listed matches with the parameters that
448 * they intend to modify as part of the first capture request.</li>
449 * <li>If there is no such match, the capture request can be passed
450 * unmodified to {@link SessionConfiguration#setSessionParameters }.</li>
451 * <li>If matches do exist, the client should update the respective values
452 * and pass the request to {@link SessionConfiguration#setSessionParameters }.</li>
453 * <li>After the capture session initialization completes the session parameter
454 * key list can continue to serve as reference when posting or updating
455 * further requests. As mentioned above further changes to session
456 * parameters should ideally be avoided, if updates are necessary
457 * however clients could expect a delay/glitch during the
458 * parameter switch.</li>
459 * </ul>
460 *
461 * <p>The list returned is not modifiable, so any attempts to modify it will throw
462 * a {@code UnsupportedOperationException}.</p>
463 *
464 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
465 *
466 * @return List of keys that can be passed during capture session initialization. In case the
467 * camera device doesn't support such keys the list can be null.
468 */
469 @SuppressWarnings({"unchecked"})
470 public List<CaptureRequest.Key<?>> getAvailableSessionKeys() {
471 if (mAvailableSessionKeys == null) {
472 Object crKey = CaptureRequest.Key.class;
473 Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
474
475 int[] filterTags = get(REQUEST_AVAILABLE_SESSION_KEYS);
476 if (filterTags == null) {
477 return null;
478 }
479 mAvailableSessionKeys =
Emilian Peeva7fea4c2018-09-03 16:37:06 +0100480 getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags,
481 /*includeSynthetic*/ false);
Emilian Peev75a55702017-11-07 16:09:59 +0000482 }
483 return mAvailableSessionKeys;
484 }
485
486 /**
Emilian Peev2100ae72018-01-12 16:56:25 +0000487 * <p>Returns a subset of {@link #getAvailableCaptureRequestKeys} keys that can
koprivadebd4ee2018-09-13 10:59:46 -0700488 * be overridden for physical devices backing a logical multi-camera.</p>
Emilian Peev2100ae72018-01-12 16:56:25 +0000489 *
490 * <p>This is a subset of android.request.availableRequestKeys which contains a list
koprivadebd4ee2018-09-13 10:59:46 -0700491 * of keys that can be overridden using {@link CaptureRequest.Builder#setPhysicalCameraKey }.
Emilian Peev2100ae72018-01-12 16:56:25 +0000492 * The respective value of such request key can be obtained by calling
493 * {@link CaptureRequest.Builder#getPhysicalCameraKey }. Capture requests that contain
494 * individual physical device requests must be built via
Emilian Peevb30f4ef2020-04-22 09:11:01 -0700495 * {@link android.hardware.camera2.CameraDevice#createCaptureRequest(int, Set)}.</p>
Emilian Peev2100ae72018-01-12 16:56:25 +0000496 *
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>
Yin-Chia Yehae092f22019-06-12 14:46:58 -0700763 * <li>For devices that advertise NIR color filter arrangement in
764 * {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}, this list will always include
765 * (<code>max</code>, <code>max</code>) where <code>max</code> = the maximum output frame rate of the maximum YUV_420_888
766 * output size.</li>
767 * <li>For devices advertising any color filter arrangement other than NIR, or devices not
768 * advertising color filter arrangement, this list will always include (<code>min</code>, <code>max</code>) and
769 * (<code>max</code>, <code>max</code>) where <code>min</code> &lt;= 15 and <code>max</code> = the maximum output frame rate of the
Yin-Chia Yeh58551622015-05-21 11:27:06 -0700770 * maximum YUV_420_888 output size.</li>
771 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700772 * <p><b>Units</b>: Frames per second (FPS)</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700773 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700774 *
775 * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
Yin-Chia Yehae092f22019-06-12 14:46:58 -0700776 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800777 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700778 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800779 @NonNull
Igor Murashkin78712a82014-05-27 18:32:18 -0700780 public static final Key<android.util.Range<Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES =
781 new Key<android.util.Range<Integer>[]>("android.control.aeAvailableTargetFpsRanges", new TypeReference<android.util.Range<Integer>[]>() {{ }});
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800782
783 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700784 * <p>Maximum and minimum exposure compensation values for
785 * {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}, in counts of {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep},
786 * that are supported by this camera device.</p>
787 * <p><b>Range of valid values:</b><br></p>
Zhijun Hef1745ce2015-02-04 13:55:14 -0800788 * <p>Range [0,0] indicates that exposure compensation is not supported.</p>
789 * <p>For LIMITED and FULL devices, range must follow below requirements if exposure
790 * compensation is supported (<code>range != [0, 0]</code>):</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700791 * <p><code>Min.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &lt;= -2 EV</code></p>
792 * <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 -0800793 * <p>LEGACY devices may support a smaller range than this.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700794 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800795 *
796 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700797 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800798 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700799 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800800 @NonNull
Igor Murashkin78712a82014-05-27 18:32:18 -0700801 public static final Key<android.util.Range<Integer>> CONTROL_AE_COMPENSATION_RANGE =
802 new Key<android.util.Range<Integer>>("android.control.aeCompensationRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800803
804 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700805 * <p>Smallest step by which the exposure compensation
806 * can be changed.</p>
807 * <p>This is the unit for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}. For example, if this key has
808 * 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
809 * that the target EV offset for the auto-exposure routine is -1 EV.</p>
810 * <p>One unit of EV compensation changes the brightness of the captured image by a factor
811 * of two. +1 EV doubles the image brightness, while -1 EV halves the image brightness.</p>
812 * <p><b>Units</b>: Exposure Value (EV)</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700813 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700814 *
815 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800816 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700817 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800818 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700819 public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP =
820 new Key<Rational>("android.control.aeCompensationStep", Rational.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800821
822 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700823 * <p>List of auto-focus (AF) modes for {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} that are
824 * supported by this camera device.</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800825 * <p>Not all the auto-focus modes may be supported by a
826 * given camera device. This entry lists the valid modes for
827 * {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} for this camera device.</p>
Ruben Brunk6f387092014-09-22 16:13:54 -0700828 * <p>All LIMITED and FULL mode camera devices will support OFF mode, and all
829 * camera devices with adjustable focuser units
830 * (<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 -0700831 * <p>LEGACY devices will support OFF mode only if they support
832 * focusing to infinity (by also setting {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} to
833 * <code>0.0f</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700834 * <p><b>Range of valid values:</b><br>
835 * Any value listed in {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700836 * <p>This key is available on all devices.</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800837 *
838 * @see CaptureRequest#CONTROL_AF_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700839 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Zhijun He78146ec2014-01-14 18:12:13 -0800840 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800841 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700842 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800843 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700844 public static final Key<int[]> CONTROL_AF_AVAILABLE_MODES =
845 new Key<int[]>("android.control.afAvailableModes", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800846
847 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700848 * <p>List of color effects for {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode} that are supported by this camera
849 * device.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800850 * <p>This list contains the color effect modes that can be applied to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700851 * images produced by the camera device.
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800852 * Implementations are not expected to be consistent across all devices.
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700853 * If no color effect modes are available for a device, this will only list
854 * OFF.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800855 * <p>A color effect will only be applied if
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700856 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF. OFF is always included in this list.</p>
857 * <p>This control has no effect on the operation of other control routines such
858 * as auto-exposure, white balance, or focus.</p>
859 * <p><b>Range of valid values:</b><br>
860 * Any value listed in {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700861 * <p>This key is available on all devices.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800862 *
863 * @see CaptureRequest#CONTROL_EFFECT_MODE
864 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700865 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700866 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800867 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700868 public static final Key<int[]> CONTROL_AVAILABLE_EFFECTS =
869 new Key<int[]>("android.control.availableEffects", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700870
871 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700872 * <p>List of scene modes for {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} that are supported by this camera
873 * device.</p>
Ruben Brunk8237d342014-01-17 15:33:02 -0800874 * <p>This list contains scene modes that can be set for the camera device.
875 * Only scene modes that have been fully implemented for the
876 * camera device may be included here. Implementations are not expected
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700877 * to be consistent across all devices.</p>
878 * <p>If no scene modes are supported by the camera device, this
879 * will be set to DISABLED. Otherwise DISABLED will not be listed.</p>
880 * <p>FACE_PRIORITY is always listed if face detection is
881 * supported (i.e.<code>{@link CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT android.statistics.info.maxFaceCount} &gt;
882 * 0</code>).</p>
883 * <p><b>Range of valid values:</b><br>
884 * Any value listed in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700885 * <p>This key is available on all devices.</p>
Ruben Brunk8237d342014-01-17 15:33:02 -0800886 *
887 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700888 * @see CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700889 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700890 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800891 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700892 public static final Key<int[]> CONTROL_AVAILABLE_SCENE_MODES =
893 new Key<int[]>("android.control.availableSceneModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700894
895 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700896 * <p>List of video stabilization modes for {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}
897 * that are supported by this camera device.</p>
898 * <p>OFF will always be listed.</p>
899 * <p><b>Range of valid values:</b><br>
900 * Any value listed in {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700901 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700902 *
903 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700904 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700905 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800906 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700907 public static final Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES =
908 new Key<int[]>("android.control.availableVideoStabilizationModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700909
910 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700911 * <p>List of auto-white-balance modes for {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} that are supported by this
912 * camera device.</p>
Zhijun He399f05d2014-01-15 11:31:30 -0800913 * <p>Not all the auto-white-balance modes may be supported by a
914 * given camera device. This entry lists the valid modes for
915 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} for this camera device.</p>
916 * <p>All camera devices will support ON mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700917 * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always support OFF
918 * mode, which enables application control of white balance, by using
919 * {@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
920 * mode camera devices.</p>
921 * <p><b>Range of valid values:</b><br>
922 * Any value listed in {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700923 * <p>This key is available on all devices.</p>
Zhijun He399f05d2014-01-15 11:31:30 -0800924 *
Zhijun He399f05d2014-01-15 11:31:30 -0800925 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800926 * @see CaptureRequest#COLOR_CORRECTION_MODE
927 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
928 * @see CaptureRequest#CONTROL_AWB_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700929 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700930 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800931 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700932 public static final Key<int[]> CONTROL_AWB_AVAILABLE_MODES =
933 new Key<int[]>("android.control.awbAvailableModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700934
935 /**
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800936 * <p>List of the maximum number of regions that can be used for metering in
937 * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
Yin-Chia Yeh440ee262019-10-07 15:14:51 -0700938 * this corresponds to the maximum number of elements in
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800939 * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}, {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions},
940 * and {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700941 * <p><b>Range of valid values:</b><br></p>
942 * <p>Value must be &gt;= 0 for each element. For full-capability devices
943 * this value must be &gt;= 1 for AE and AF. The order of the elements is:
944 * <code>(AE, AWB, AF)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700945 * <p>This key is available on all devices.</p>
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800946 *
947 * @see CaptureRequest#CONTROL_AE_REGIONS
948 * @see CaptureRequest#CONTROL_AF_REGIONS
949 * @see CaptureRequest#CONTROL_AWB_REGIONS
Igor Murashkin78712a82014-05-27 18:32:18 -0700950 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700951 */
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800952 public static final Key<int[]> CONTROL_MAX_REGIONS =
953 new Key<int[]>("android.control.maxRegions", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700954
955 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700956 * <p>The maximum number of metering regions that can be used by the auto-exposure (AE)
957 * routine.</p>
Yin-Chia Yeh440ee262019-10-07 15:14:51 -0700958 * <p>This corresponds to the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700959 * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700960 * <p><b>Range of valid values:</b><br>
961 * Value will be &gt;= 0. For FULL-capability devices, this
962 * value will be &gt;= 1.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700963 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700964 *
965 * @see CaptureRequest#CONTROL_AE_REGIONS
966 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700967 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800968 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -0700969 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700970 public static final Key<Integer> CONTROL_MAX_REGIONS_AE =
971 new Key<Integer>("android.control.maxRegionsAe", int.class);
972
973 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700974 * <p>The maximum number of metering regions that can be used by the auto-white balance (AWB)
975 * routine.</p>
Yin-Chia Yeh440ee262019-10-07 15:14:51 -0700976 * <p>This corresponds to the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700977 * {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700978 * <p><b>Range of valid values:</b><br>
979 * Value will be &gt;= 0.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700980 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700981 *
982 * @see CaptureRequest#CONTROL_AWB_REGIONS
983 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700984 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -0800985 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -0700986 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700987 public static final Key<Integer> CONTROL_MAX_REGIONS_AWB =
988 new Key<Integer>("android.control.maxRegionsAwb", int.class);
989
990 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700991 * <p>The maximum number of metering regions that can be used by the auto-focus (AF) routine.</p>
Yin-Chia Yeh440ee262019-10-07 15:14:51 -0700992 * <p>This corresponds to the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700993 * {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700994 * <p><b>Range of valid values:</b><br>
995 * Value will be &gt;= 0. For FULL-capability devices, this
996 * value will be &gt;= 1.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700997 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700998 *
999 * @see CaptureRequest#CONTROL_AF_REGIONS
1000 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001001 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001002 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07001003 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001004 public static final Key<Integer> CONTROL_MAX_REGIONS_AF =
1005 new Key<Integer>("android.control.maxRegionsAf", int.class);
1006
1007 /**
Zhijun Hefab663e2015-05-26 19:46:31 -07001008 * <p>List of available high speed video size, fps range and max batch size configurations
1009 * 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 -07001010 * <p>When CONSTRAINED_HIGH_SPEED_VIDEO is supported in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities},
Zhijun Hefab663e2015-05-26 19:46:31 -07001011 * this metadata will list the supported high speed video size, fps range and max batch size
1012 * configurations. All the sizes listed in this configuration will be a subset of the sizes
1013 * reported by {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes }
1014 * for processed non-stalling formats.</p>
1015 * <p>For the high speed video use case, the application must
Zhijun Hee0404182014-06-26 13:17:09 -07001016 * select the video size and fps range from this metadata to configure the recording and
1017 * preview streams and setup the recording requests. For example, if the application intends
1018 * to do high speed recording, it can select the maximum size reported by this metadata to
1019 * configure output streams. Once the size is selected, application can filter this metadata
1020 * 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 -07001021 * recording requests. Note that for the use case of multiple output streams, application
Zhijun Hefab663e2015-05-26 19:46:31 -07001022 * must select one unique size from this metadata to use (e.g., preview and recording streams
1023 * must have the same size). Otherwise, the high speed capture session creation will fail.</p>
1024 * <p>The min and max fps will be multiple times of 30fps.</p>
1025 * <p>High speed video streaming extends significant performance pressue to camera hardware,
1026 * to achieve efficient high speed streaming, the camera device may have to aggregate
1027 * multiple frames together and send to camera device for processing where the request
1028 * controls are same for all the frames in this batch. Max batch size indicates
1029 * the max possible number of frames the camera device will group together for this high
1030 * speed stream configuration. This max batch size will be used to generate a high speed
1031 * recording request list by
Eino-Ville Talvala639fffe2015-06-30 10:34:48 -07001032 * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList }.
Zhijun Hefab663e2015-05-26 19:46:31 -07001033 * The max batch size for each configuration will satisfy below conditions:</p>
1034 * <ul>
1035 * <li>Each max batch size will be a divisor of its corresponding fps_max / 30. For example,
1036 * if max_fps is 300, max batch size will only be 1, 2, 5, or 10.</li>
1037 * <li>The camera device may choose smaller internal batch size for each configuration, but
1038 * the actual batch size will be a divisor of max batch size. For example, if the max batch
1039 * size is 8, the actual batch size used by camera device will only be 1, 2, 4, or 8.</li>
1040 * <li>The max batch size in each configuration entry must be no larger than 32.</li>
1041 * </ul>
1042 * <p>The camera device doesn't have to support batch mode to achieve high speed video recording,
1043 * in such case, batch_size_max will be reported as 1 in each configuration entry.</p>
1044 * <p>This fps ranges in this configuration list can only be used to create requests
1045 * that are submitted to a high speed camera capture session created by
1046 * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }.
1047 * The fps ranges reported in this metadata must not be used to setup capture requests for
1048 * normal capture session, or it will cause request error.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001049 * <p><b>Range of valid values:</b><br></p>
Zhijun Hefab663e2015-05-26 19:46:31 -07001050 * <p>For each configuration, the fps_max &gt;= 120fps.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001051 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001052 * <p><b>Limited capability</b> -
1053 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1054 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hee0404182014-06-26 13:17:09 -07001055 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001056 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He3c1ff682015-06-23 09:21:43 -07001057 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Zhijun Hee0404182014-06-26 13:17:09 -07001058 * @hide
1059 */
Yin-Chia Yeh12da1402014-07-15 10:37:31 -07001060 public static final Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]> CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS =
1061 new Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]>("android.control.availableHighSpeedVideoConfigurations", android.hardware.camera2.params.HighSpeedVideoConfiguration[].class);
Zhijun Hee0404182014-06-26 13:17:09 -07001062
1063 /**
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001064 * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</p>
Yin-Chia Yeh7e3e4312015-04-02 14:34:30 -07001065 * <p>Devices with MANUAL_SENSOR capability or BURST_CAPTURE capability will always
1066 * list <code>true</code>. This includes FULL devices.</p>
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001067 * <p>This key is available on all devices.</p>
1068 *
1069 * @see CaptureRequest#CONTROL_AE_LOCK
1070 */
1071 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001072 @NonNull
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001073 public static final Key<Boolean> CONTROL_AE_LOCK_AVAILABLE =
1074 new Key<Boolean>("android.control.aeLockAvailable", boolean.class);
1075
1076 /**
1077 * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</p>
Yin-Chia Yeh7e3e4312015-04-02 14:34:30 -07001078 * <p>Devices with MANUAL_POST_PROCESSING capability or BURST_CAPTURE capability will
1079 * always list <code>true</code>. This includes FULL devices.</p>
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001080 * <p>This key is available on all devices.</p>
1081 *
1082 * @see CaptureRequest#CONTROL_AWB_LOCK
1083 */
1084 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001085 @NonNull
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001086 public static final Key<Boolean> CONTROL_AWB_LOCK_AVAILABLE =
1087 new Key<Boolean>("android.control.awbLockAvailable", boolean.class);
1088
1089 /**
1090 * <p>List of control modes for {@link CaptureRequest#CONTROL_MODE android.control.mode} that are supported by this camera
1091 * device.</p>
1092 * <p>This list contains control modes that can be set for the camera device.
1093 * LEGACY mode devices will always support AUTO mode. LIMITED and FULL
1094 * devices will always support OFF, AUTO modes.</p>
1095 * <p><b>Range of valid values:</b><br>
1096 * Any value listed in {@link CaptureRequest#CONTROL_MODE android.control.mode}</p>
1097 * <p>This key is available on all devices.</p>
1098 *
1099 * @see CaptureRequest#CONTROL_MODE
1100 */
1101 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001102 @NonNull
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -08001103 public static final Key<int[]> CONTROL_AVAILABLE_MODES =
1104 new Key<int[]>("android.control.availableModes", int[].class);
1105
1106 /**
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08001107 * <p>Range of boosts for {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} supported
1108 * by this camera device.</p>
1109 * <p>Devices support post RAW sensitivity boost will advertise
1110 * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} key for controling
1111 * post RAW sensitivity boost.</p>
1112 * <p>This key will be <code>null</code> for devices that do not support any RAW format
1113 * outputs. For devices that do support RAW format outputs, this key will always
1114 * present, and if a device does not support post RAW sensitivity boost, it will
1115 * list <code>(100, 100)</code> in this key.</p>
1116 * <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 -08001117 * <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 -08001118 *
1119 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
1120 * @see CaptureRequest#SENSOR_SENSITIVITY
1121 */
1122 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001123 @NonNull
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -08001124 public static final Key<android.util.Range<Integer>> CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE =
1125 new Key<android.util.Range<Integer>>("android.control.postRawSensitivityBoostRange", new TypeReference<android.util.Range<Integer>>() {{ }});
1126
1127 /**
Shuzhen Wang796863a2020-03-16 16:00:18 -07001128 * <p>The list of extended scene modes for {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode} that are supported
1129 * by this camera device, and each extended scene mode's maximum streaming (non-stall) size
1130 * with effect.</p>
1131 * <p>For DISABLED mode, the camera behaves normally with no extended scene mode enabled.</p>
1132 * <p>For BOKEH_STILL_CAPTURE mode, the maximum streaming dimension specifies the limit
1133 * under which bokeh is effective when capture intent is PREVIEW. Note that when capture
1134 * intent is PREVIEW, the bokeh effect may not be as high in quality compared to
1135 * STILL_CAPTURE intent in order to maintain reasonable frame rate. The maximum streaming
1136 * dimension must be one of the YUV_420_888 or PRIVATE resolutions in
1137 * availableStreamConfigurations, or (0, 0) if preview bokeh is not supported. If the
1138 * application configures a stream larger than the maximum streaming dimension, bokeh
1139 * effect may not be applied for this stream for PREVIEW intent.</p>
1140 * <p>For BOKEH_CONTINUOUS mode, the maximum streaming dimension specifies the limit under
1141 * which bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE
1142 * resolutions in availableStreamConfigurations, and if the sensor maximum resolution is
1143 * larger than or equal to 1080p, the maximum streaming dimension must be at least 1080p.
1144 * If the application configures a stream with larger dimension, the stream may not have
1145 * bokeh effect applied.</p>
Shuzhen Wang1ab85142019-07-08 15:14:16 -07001146 * <p><b>Units</b>: (mode, width, height)</p>
1147 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1148 * <p><b>Limited capability</b> -
1149 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1150 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1151 *
Shuzhen Wang796863a2020-03-16 16:00:18 -07001152 * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001153 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1154 * @hide
1155 */
Shuzhen Wang796863a2020-03-16 16:00:18 -07001156 public static final Key<int[]> CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_MAX_SIZES =
1157 new Key<int[]>("android.control.availableExtendedSceneModeMaxSizes", int[].class);
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001158
1159 /**
Shuzhen Wang796863a2020-03-16 16:00:18 -07001160 * <p>The ranges of supported zoom ratio for non-DISABLED {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode}.</p>
1161 * <p>When extended scene mode is set, the camera device may have limited range of zoom ratios
1162 * compared to when extended scene mode is DISABLED. This tag lists the zoom ratio ranges
1163 * for all supported non-DISABLED extended scene modes, in the same order as in
1164 * android.control.availableExtended.</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001165 * <p>Range [1.0, 1.0] means that no zoom (optical or digital) is supported.</p>
1166 * <p><b>Units</b>: (minZoom, maxZoom)</p>
1167 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1168 * <p><b>Limited capability</b> -
1169 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1170 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1171 *
Shuzhen Wang796863a2020-03-16 16:00:18 -07001172 * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001173 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1174 * @hide
1175 */
Shuzhen Wang796863a2020-03-16 16:00:18 -07001176 public static final Key<float[]> CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_ZOOM_RATIO_RANGES =
1177 new Key<float[]>("android.control.availableExtendedSceneModeZoomRatioRanges", float[].class);
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001178
1179 /**
Shuzhen Wang796863a2020-03-16 16:00:18 -07001180 * <p>The list of extended scene modes for {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode} that
1181 * are supported by this camera device, and each extended scene mode's capabilities such
1182 * as maximum streaming size, and supported zoom ratio ranges.</p>
1183 * <p>For DISABLED mode, the camera behaves normally with no extended scene mdoe enabled.</p>
1184 * <p>For BOKEH_STILL_CAPTURE mode, the maximum streaming dimension specifies the limit
1185 * under which bokeh is effective when capture intent is PREVIEW. Note that when capture
1186 * intent is PREVIEW, the bokeh effect may not be as high quality compared to STILL_CAPTURE
1187 * intent in order to maintain reasonable frame rate. The maximum streaming dimension must
1188 * be one of the YUV_420_888 or PRIVATE resolutions in availableStreamConfigurations, or
1189 * (0, 0) if preview bokeh is not supported. If the application configures a stream
1190 * larger than the maximum streaming dimension, bokeh effect may not be applied for this
1191 * stream for PREVIEW intent.</p>
1192 * <p>For BOKEH_CONTINUOUS mode, the maximum streaming dimension specifies the limit under
1193 * which bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE
1194 * resolutions in availableStreamConfigurations, and if the sensor maximum resolution is
1195 * larger than or equal to 1080p, the maximum streaming dimension must be at least 1080p.
1196 * If the application configures a stream with larger dimension, the stream may not have
1197 * bokeh effect applied.</p>
1198 * <p>When extended scene mode is set, the camera device may have limited range of zoom ratios
1199 * compared to when the mode is DISABLED. availableExtendedSceneModeCapabilities lists the
1200 * zoom ranges for all supported extended modes. A range of (1.0, 1.0) means that no zoom
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001201 * (optical or digital) is supported.</p>
1202 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1203 *
Shuzhen Wang796863a2020-03-16 16:00:18 -07001204 * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001205 */
1206 @PublicKey
1207 @NonNull
1208 @SyntheticKey
Shuzhen Wang796863a2020-03-16 16:00:18 -07001209 public static final Key<android.hardware.camera2.params.Capability[]> CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES =
1210 new Key<android.hardware.camera2.params.Capability[]>("android.control.availableExtendedSceneModeCapabilities", android.hardware.camera2.params.Capability[].class);
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001211
1212 /**
1213 * <p>Minimum and maximum zoom ratios supported by this camera device.</p>
1214 * <p>If the camera device supports zoom-out from 1x zoom, minZoom will be less than 1.0, and
Eino-Ville Talvalad2d749a2020-01-06 16:10:29 -08001215 * setting {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} to values less than 1.0 increases the camera's field
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001216 * of view.</p>
Shuzhen Wang69cf0fd2020-03-13 09:40:58 -07001217 * <p><b>Units</b>: A pair of zoom ratio in floating-points: (minZoom, maxZoom)</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001218 * <p><b>Range of valid values:</b><br></p>
1219 * <p>maxZoom &gt;= 1.0 &gt;= minZoom</p>
1220 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1221 * <p><b>Limited capability</b> -
1222 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1223 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1224 *
Eino-Ville Talvalad2d749a2020-01-06 16:10:29 -08001225 * @see CaptureRequest#CONTROL_ZOOM_RATIO
Shuzhen Wang1ab85142019-07-08 15:14:16 -07001226 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1227 */
1228 @PublicKey
1229 @NonNull
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08001230 public static final Key<android.util.Range<Float>> CONTROL_ZOOM_RATIO_RANGE =
1231 new Key<android.util.Range<Float>>("android.control.zoomRatioRange", new TypeReference<android.util.Range<Float>>() {{ }});
Shuzhen Wang1ab85142019-07-08 15:14:16 -07001232
1233 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001234 * <p>List of edge enhancement modes for {@link CaptureRequest#EDGE_MODE android.edge.mode} that are supported by this camera
1235 * device.</p>
Chien-Yu Chen72333912015-07-08 11:55:19 -07001236 * <p>Full-capability camera devices must always support OFF; camera devices that support
1237 * YUV_REPROCESSING or PRIVATE_REPROCESSING will list ZERO_SHUTTER_LAG; all devices will
1238 * list FAST.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001239 * <p><b>Range of valid values:</b><br>
1240 * Any value listed in {@link CaptureRequest#EDGE_MODE android.edge.mode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001241 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001242 * <p><b>Full capability</b> -
1243 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1244 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001245 *
1246 * @see CaptureRequest#EDGE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001247 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001248 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001249 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001250 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001251 public static final Key<int[]> EDGE_AVAILABLE_EDGE_MODES =
1252 new Key<int[]>("android.edge.availableEdgeModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001253
1254 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08001255 * <p>Whether this camera device has a
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001256 * flash unit.</p>
1257 * <p>Will be <code>false</code> if no flash is available.</p>
1258 * <p>If there is no flash unit, none of the flash controls do
1259 * anything.
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001260 * This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001261 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001262 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001263 @NonNull
Zhijun Heca1b73a2014-02-03 12:39:53 -08001264 public static final Key<Boolean> FLASH_INFO_AVAILABLE =
1265 new Key<Boolean>("android.flash.info.available", boolean.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001266
1267 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001268 * <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 -08001269 * camera device.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001270 * <p>FULL mode camera devices will always support FAST.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001271 * <p><b>Range of valid values:</b><br>
1272 * Any value listed in {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001273 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001274 *
1275 * @see CaptureRequest#HOT_PIXEL_MODE
1276 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001277 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001278 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001279 public static final Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES =
1280 new Key<int[]>("android.hotPixel.availableHotPixelModes", int[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001281
1282 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001283 * <p>List of JPEG thumbnail sizes for {@link CaptureRequest#JPEG_THUMBNAIL_SIZE android.jpeg.thumbnailSize} supported by this
1284 * camera device.</p>
1285 * <p>This list will include at least one non-zero resolution, plus <code>(0,0)</code> for indicating no
1286 * thumbnail should be generated.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001287 * <p>Below condiditions will be satisfied for this size list:</p>
Zhijun He5a9ff372013-12-26 11:49:09 -08001288 * <ul>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001289 * <li>The sizes will be sorted by increasing pixel area (width x height).
1290 * If several resolutions have the same area, they will be sorted by increasing width.</li>
1291 * <li>The aspect ratio of the largest thumbnail size will be same as the
Igor Murashkin9c595172014-05-12 13:56:20 -07001292 * aspect ratio of largest JPEG output size in android.scaler.availableStreamConfigurations.
Zhijun He5a9ff372013-12-26 11:49:09 -08001293 * The largest size is defined as the size that has the largest pixel area
1294 * in a given size list.</li>
Igor Murashkin9c595172014-05-12 13:56:20 -07001295 * <li>Each output JPEG size in android.scaler.availableStreamConfigurations will have at least
Zhijun He5a9ff372013-12-26 11:49:09 -08001296 * one corresponding size that has the same aspect ratio in availableThumbnailSizes,
1297 * and vice versa.</li>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08001298 * <li>All non-<code>(0, 0)</code> sizes will have non-zero widths and heights.</li>
Zhijun He5a9ff372013-12-26 11:49:09 -08001299 * </ul>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08001300 * <p>This list is also used as supported thumbnail sizes for HEIC image format capture.</p>
1301 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001302 *
1303 * @see CaptureRequest#JPEG_THUMBNAIL_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001304 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001305 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001306 @NonNull
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001307 public static final Key<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES =
1308 new Key<android.util.Size[]>("android.jpeg.availableThumbnailSizes", android.util.Size[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001309
1310 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001311 * <p>List of aperture size values for {@link CaptureRequest#LENS_APERTURE android.lens.aperture} that are
1312 * supported by this camera device.</p>
1313 * <p>If the camera device doesn't support a variable lens aperture,
1314 * this list will contain only one value, which is the fixed aperture size.</p>
1315 * <p>If the camera device supports a variable aperture, the aperture values
Zhijun Hefb46c642014-01-14 17:57:23 -08001316 * in this list will be sorted in ascending order.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001317 * <p><b>Units</b>: The aperture f-number</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001318 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001319 * <p><b>Full capability</b> -
1320 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1321 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1322 *
1323 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001324 * @see CaptureRequest#LENS_APERTURE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001325 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001326 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001327 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001328 public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES =
1329 new Key<float[]>("android.lens.info.availableApertures", float[].class);
1330
1331 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001332 * <p>List of neutral density filter values for
1333 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} that are supported by this camera device.</p>
1334 * <p>If a neutral density filter is not supported by this camera device,
1335 * this list will contain only 0. Otherwise, this list will include every
1336 * filter density supported by the camera device, in ascending order.</p>
1337 * <p><b>Units</b>: Exposure value (EV)</p>
1338 * <p><b>Range of valid values:</b><br></p>
1339 * <p>Values are &gt;= 0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001340 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001341 * <p><b>Full capability</b> -
1342 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1343 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001344 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001345 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08001346 * @see CaptureRequest#LENS_FILTER_DENSITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001347 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001348 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001349 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001350 public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES =
1351 new Key<float[]>("android.lens.info.availableFilterDensities", float[].class);
1352
1353 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001354 * <p>List of focal lengths for {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength} that are supported by this camera
1355 * device.</p>
1356 * <p>If optical zoom is not supported, this list will only contain
1357 * a single value corresponding to the fixed focal length of the
1358 * device. Otherwise, this list will include every focal length supported
1359 * by the camera device, in ascending order.</p>
1360 * <p><b>Units</b>: Millimeters</p>
1361 * <p><b>Range of valid values:</b><br></p>
1362 * <p>Values are &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001363 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08001364 *
1365 * @see CaptureRequest#LENS_FOCAL_LENGTH
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001366 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001367 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001368 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001369 public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS =
1370 new Key<float[]>("android.lens.info.availableFocalLengths", float[].class);
1371
1372 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001373 * <p>List of optical image stabilization (OIS) modes for
1374 * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} that are supported by this camera device.</p>
1375 * <p>If OIS is not supported by a given camera device, this list will
Ruben Brunk00849b32014-01-17 18:30:23 -08001376 * contain only OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001377 * <p><b>Range of valid values:</b><br>
1378 * Any value listed in {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001379 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001380 * <p><b>Limited capability</b> -
1381 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1382 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk00849b32014-01-17 18:30:23 -08001383 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001384 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk00849b32014-01-17 18:30:23 -08001385 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001386 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001387 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001388 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001389 public static final Key<int[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION =
1390 new Key<int[]>("android.lens.info.availableOpticalStabilization", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001391
1392 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001393 * <p>Hyperfocal distance for this lens.</p>
Zhijun Heff413932014-02-07 15:44:30 -08001394 * <p>If the lens is not fixed focus, the camera device will report this
1395 * 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 -07001396 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1397 * <p><b>Range of valid values:</b><br>
1398 * If lens is fixed focus, &gt;= 0. If lens has focuser unit, the value is
1399 * within <code>(0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001400 * <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 -07001401 * <p><b>Limited capability</b> -
1402 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1403 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001404 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001405 *
1406 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1407 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
1408 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1409 */
1410 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001411 @NonNull
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001412 public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE =
1413 new Key<Float>("android.lens.info.hyperfocalDistance", float.class);
1414
1415 /**
1416 * <p>Shortest distance from frontmost surface
1417 * of the lens that can be brought into sharp focus.</p>
1418 * <p>If the lens is fixed-focus, this will be
1419 * 0.</p>
1420 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1421 * <p><b>Range of valid values:</b><br>
1422 * &gt;= 0</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001423 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001424 * <p><b>Limited capability</b> -
1425 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1426 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001427 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Zhijun Heff413932014-02-07 15:44:30 -08001428 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001429 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heff413932014-02-07 15:44:30 -08001430 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001431 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001432 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001433 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001434 public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE =
1435 new Key<Float>("android.lens.info.minimumFocusDistance", float.class);
1436
1437 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08001438 * <p>Dimensions of lens shading map.</p>
1439 * <p>The map should be on the order of 30-40 rows and columns, and
1440 * must be smaller than 64x64.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001441 * <p><b>Range of valid values:</b><br>
1442 * Both values &gt;= 1</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001443 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001444 * <p><b>Full capability</b> -
1445 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1446 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1447 *
1448 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07001449 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001450 */
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001451 public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
1452 new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001453
1454 /**
Zhijun Heff413932014-02-07 15:44:30 -08001455 * <p>The lens focus distance calibration quality.</p>
1456 * <p>The lens focus distance calibration quality determines the reliability of
1457 * focus related metadata entries, i.e. {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1458 * {@link CaptureResult#LENS_FOCUS_RANGE android.lens.focusRange}, {@link CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE android.lens.info.hyperfocalDistance}, and
1459 * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001460 * <p>APPROXIMATE and CALIBRATED devices report the focus metadata in
1461 * units of diopters (1/meter), so <code>0.0f</code> represents focusing at infinity,
1462 * and increasing positive numbers represent focusing closer and closer
1463 * to the camera device. The focus distance control also uses diopters
1464 * on these devices.</p>
1465 * <p>UNCALIBRATED devices do not use units that are directly comparable
1466 * to any real physical measurement, but <code>0.0f</code> still represents farthest
1467 * focus, and {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} represents the
1468 * nearest focus the device can achieve.</p>
1469 * <p><b>Possible values:</b>
1470 * <ul>
1471 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED UNCALIBRATED}</li>
1472 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE APPROXIMATE}</li>
1473 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED CALIBRATED}</li>
1474 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001475 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001476 * <p><b>Limited capability</b> -
1477 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1478 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heff413932014-02-07 15:44:30 -08001479 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001480 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heff413932014-02-07 15:44:30 -08001481 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1482 * @see CaptureResult#LENS_FOCUS_RANGE
1483 * @see CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE
1484 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1485 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED
1486 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE
1487 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED
1488 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001489 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001490 @NonNull
Zhijun Heff413932014-02-07 15:44:30 -08001491 public static final Key<Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION =
1492 new Key<Integer>("android.lens.info.focusDistanceCalibration", int.class);
1493
1494 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001495 * <p>Direction the camera faces relative to
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001496 * device screen.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001497 * <p><b>Possible values:</b>
1498 * <ul>
1499 * <li>{@link #LENS_FACING_FRONT FRONT}</li>
1500 * <li>{@link #LENS_FACING_BACK BACK}</li>
Zhijun He503e8152015-01-12 15:16:56 -08001501 * <li>{@link #LENS_FACING_EXTERNAL EXTERNAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001502 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001503 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001504 * @see #LENS_FACING_FRONT
1505 * @see #LENS_FACING_BACK
Zhijun He503e8152015-01-12 15:16:56 -08001506 * @see #LENS_FACING_EXTERNAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001507 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001508 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001509 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001510 public static final Key<Integer> LENS_FACING =
1511 new Key<Integer>("android.lens.facing", int.class);
1512
1513 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001514 * <p>The orientation of the camera relative to the sensor
1515 * coordinate system.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001516 * <p>The four coefficients that describe the quaternion
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001517 * rotation from the Android sensor coordinate system to a
1518 * camera-aligned coordinate system where the X-axis is
1519 * aligned with the long side of the image sensor, the Y-axis
1520 * is aligned with the short side of the image sensor, and
1521 * the Z-axis is aligned with the optical axis of the sensor.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001522 * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001523 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
1524 * amount <code>theta</code>, the following formulas can be used:</p>
1525 * <pre><code> theta = 2 * acos(w)
1526 * a_x = x / sin(theta/2)
1527 * a_y = y / sin(theta/2)
1528 * a_z = z / sin(theta/2)
1529 * </code></pre>
1530 * <p>To create a 3x3 rotation matrix that applies the rotation
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001531 * defined by this quaternion, the following matrix can be
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001532 * used:</p>
1533 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
1534 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
1535 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
1536 * </code></pre>
1537 * <p>This matrix can then be used to apply the rotation to a
1538 * column vector point with</p>
1539 * <p><code>p' = Rp</code></p>
1540 * <p>where <code>p</code> is in the device sensor coordinate system, and
1541 * <code>p'</code> is in the camera-oriented coordinate system.</p>
Shuzhen Wang2071f2e2020-01-08 13:07:06 -08001542 * <p>If {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, the quaternion rotation cannot
1543 * be accurately represented by the camera device, and will be represented by
1544 * default values matching its default facing.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001545 * <p><b>Units</b>:
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001546 * Quaternion coefficients</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001547 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001548 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Shuzhen Wang2071f2e2020-01-08 13:07:06 -08001549 *
1550 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001551 */
1552 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001553 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001554 public static final Key<float[]> LENS_POSE_ROTATION =
1555 new Key<float[]>("android.lens.poseRotation", float[].class);
1556
1557 /**
1558 * <p>Position of the camera optical center.</p>
Eino-Ville Talvalad3dbfb32015-05-29 17:17:04 -07001559 * <p>The position of the camera device's lens optical center,
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001560 * as a three-dimensional vector <code>(x,y,z)</code>.</p>
1561 * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
1562 * is relative to the optical center of the largest camera device facing in the same
1563 * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
1564 * coordinate axes}. Note that only the axis definitions are shared with the sensor
1565 * coordinate system, but not the origin.</p>
1566 * <p>If this device is the largest or only camera device with a given facing, then this
1567 * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
1568 * 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 -07001569 * report <code>(0.03, 0, 0)</code>. Note that this means that, for many computer vision
1570 * applications, the position needs to be negated to convert it to a translation from the
1571 * camera to the origin.</p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001572 * <p>To transform a pixel coordinates between two cameras facing the same direction, first
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001573 * 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 -08001574 * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
1575 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
1576 * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
1577 * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
1578 * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
1579 * coordinates.</p>
1580 * <p>To compare this against a real image from the destination camera, the destination camera
1581 * image then needs to be corrected for radial distortion before comparison or sampling.</p>
1582 * <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 -07001583 * the center of the primary gyroscope on the device. The axis definitions are the same as
1584 * with PRIMARY_CAMERA.</p>
Shuzhen Wang2071f2e2020-01-08 13:07:06 -08001585 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, this position cannot be accurately
1586 * represented by the camera device, and will be represented as <code>(0, 0, 0)</code>.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001587 * <p><b>Units</b>: Meters</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001588 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001589 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001590 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001591 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001592 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001593 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001594 * @see CameraCharacteristics#LENS_POSE_ROTATION
1595 */
1596 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001597 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001598 public static final Key<float[]> LENS_POSE_TRANSLATION =
1599 new Key<float[]>("android.lens.poseTranslation", float[].class);
1600
1601 /**
1602 * <p>The parameters for this camera device's intrinsic
1603 * calibration.</p>
1604 * <p>The five calibration parameters that describe the
1605 * transform from camera-centric 3D coordinates to sensor
1606 * pixel coordinates:</p>
1607 * <pre><code>[f_x, f_y, c_x, c_y, s]
1608 * </code></pre>
1609 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
1610 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
1611 * axis, and <code>s</code> is a skew parameter for the sensor plane not
1612 * being aligned with the lens plane.</p>
1613 * <p>These are typically used within a transformation matrix K:</p>
1614 * <pre><code>K = [ f_x, s, c_x,
1615 * 0, f_y, c_y,
1616 * 0 0, 1 ]
1617 * </code></pre>
1618 * <p>which can then be combined with the camera pose rotation
1619 * <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 -07001620 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respectively) to calculate the
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001621 * complete transform from world coordinates to pixel
1622 * coordinates:</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001623 * <pre><code>P = [ K 0 * [ R -Rt
1624 * 0 1 ] 0 1 ]
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001625 * </code></pre>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001626 * <p>(Note the negation of poseTranslation when mapping from camera
1627 * to world coordinates, and multiplication by the rotation).</p>
1628 * <p>With <code>p_w</code> being a point in the world coordinate system
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001629 * and <code>p_s</code> being a point in the camera active pixel array
1630 * coordinate system, and with the mapping including the
1631 * homogeneous division by z:</p>
1632 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
1633 * p_s = p_h / z_h
1634 * </code></pre>
1635 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
1636 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
1637 * (depth) in pixel coordinates.</p>
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001638 * <p>Note that the coordinate system for this transform is the
1639 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
1640 * where <code>(0,0)</code> is the top-left of the
1641 * preCorrectionActiveArraySize rectangle. Once the pose and
1642 * intrinsic calibration transforms have been applied to a
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001643 * world point, then the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001644 * transform needs to be applied, and the result adjusted to
1645 * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
1646 * system (where <code>(0, 0)</code> is the top-left of the
1647 * activeArraySize rectangle), to determine the final pixel
1648 * coordinate of the world point for processed (non-RAW)
1649 * output buffers.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001650 * <p>For camera devices, the center of pixel <code>(x,y)</code> is located at
1651 * coordinate <code>(x + 0.5, y + 0.5)</code>. So on a device with a
1652 * precorrection active array of size <code>(10,10)</code>, the valid pixel
1653 * indices go from <code>(0,0)-(9,9)</code>, and an perfectly-built camera would
1654 * have an optical center at the exact center of the pixel grid, at
1655 * coordinates <code>(5.0, 5.0)</code>, which is the top-left corner of pixel
1656 * <code>(5,5)</code>.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001657 * <p><b>Units</b>:
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001658 * Pixels in the
1659 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1660 * coordinate system.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001661 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001662 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001663 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001664 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001665 * @see CameraCharacteristics#LENS_POSE_ROTATION
1666 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07001667 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001668 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001669 */
1670 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001671 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001672 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
1673 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
1674
1675 /**
1676 * <p>The correction coefficients to correct for this camera device's
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001677 * radial and tangential lens distortion.</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001678 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001679 * kappa_3]</code> and two tangential distortion coefficients
1680 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
1681 * lens's geometric distortion with the mapping equations:</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001682 * <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 -07001683 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001684 * 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 -07001685 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001686 * </code></pre>
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001687 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
1688 * input image that correspond to the pixel values in the
1689 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
1690 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
1691 * </code></pre>
1692 * <p>The pixel coordinates are defined in a normalized
1693 * coordinate system related to the
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001694 * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001695 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
1696 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
1697 * of both x and y coordinates are normalized to be 1 at the
1698 * edge further from the optical center, so the range
1699 * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
1700 * <p>Finally, <code>r</code> represents the radial distance from the
1701 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
1702 * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
1703 * <p>The distortion model used is the Brown-Conrady model.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001704 * <p><b>Units</b>:
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001705 * Unitless coefficients.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001706 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001707 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001708 *
1709 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001710 * @deprecated
1711 * <p>This field was inconsistently defined in terms of its
1712 * normalization. Use {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} instead.</p>
1713 *
1714 * @see CameraCharacteristics#LENS_DISTORTION
1715
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001716 */
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001717 @Deprecated
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001718 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001719 @NonNull
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001720 public static final Key<float[]> LENS_RADIAL_DISTORTION =
1721 new Key<float[]>("android.lens.radialDistortion", float[].class);
1722
1723 /**
Shuzhen Wang2071f2e2020-01-08 13:07:06 -08001724 * <p>The origin for {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, and the accuracy of
1725 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation} and {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}.</p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001726 * <p>Different calibration methods and use cases can produce better or worse results
1727 * depending on the selected coordinate origin.</p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001728 * <p><b>Possible values:</b>
1729 * <ul>
1730 * <li>{@link #LENS_POSE_REFERENCE_PRIMARY_CAMERA PRIMARY_CAMERA}</li>
1731 * <li>{@link #LENS_POSE_REFERENCE_GYROSCOPE GYROSCOPE}</li>
Shuzhen Wang2071f2e2020-01-08 13:07:06 -08001732 * <li>{@link #LENS_POSE_REFERENCE_UNDEFINED UNDEFINED}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001733 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001734 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001735 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001736 *
Shuzhen Wang2071f2e2020-01-08 13:07:06 -08001737 * @see CameraCharacteristics#LENS_POSE_ROTATION
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001738 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
1739 * @see #LENS_POSE_REFERENCE_PRIMARY_CAMERA
1740 * @see #LENS_POSE_REFERENCE_GYROSCOPE
Shuzhen Wang2071f2e2020-01-08 13:07:06 -08001741 * @see #LENS_POSE_REFERENCE_UNDEFINED
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001742 */
1743 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001744 @NonNull
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001745 public static final Key<Integer> LENS_POSE_REFERENCE =
1746 new Key<Integer>("android.lens.poseReference", int.class);
1747
1748 /**
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001749 * <p>The correction coefficients to correct for this camera device's
1750 * radial and tangential lens distortion.</p>
1751 * <p>Replaces the deprecated {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} field, which was
1752 * inconsistently defined.</p>
1753 * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2,
1754 * kappa_3]</code> and two tangential distortion coefficients
1755 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
1756 * lens's geometric distortion with the mapping equations:</p>
1757 * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1758 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
1759 * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1760 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
1761 * </code></pre>
1762 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
1763 * input image that correspond to the pixel values in the
1764 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
1765 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
1766 * </code></pre>
1767 * <p>The pixel coordinates are defined in a coordinate system
1768 * related to the {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
1769 * calibration fields; see that entry for details of the mapping stages.
1770 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code>
1771 * have <code>(0,0)</code> at the lens optical center <code>[c_x, c_y]</code>, and
1772 * the range of the coordinates depends on the focal length
1773 * terms of the intrinsic calibration.</p>
1774 * <p>Finally, <code>r</code> represents the radial distance from the
1775 * optical center, <code>r^2 = x_i^2 + y_i^2</code>.</p>
1776 * <p>The distortion model used is the Brown-Conrady model.</p>
1777 * <p><b>Units</b>:
1778 * Unitless coefficients.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001779 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01001780 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001781 *
1782 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
1783 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
1784 */
1785 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001786 @NonNull
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001787 public static final Key<float[]> LENS_DISTORTION =
1788 new Key<float[]>("android.lens.distortion", float[].class);
1789
1790 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001791 * <p>List of noise reduction modes for {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} that are supported
1792 * by this camera device.</p>
1793 * <p>Full-capability camera devices will always support OFF and FAST.</p>
Chien-Yu Chen72333912015-07-08 11:55:19 -07001794 * <p>Camera devices that support YUV_REPROCESSING or PRIVATE_REPROCESSING will support
1795 * ZERO_SHUTTER_LAG.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001796 * <p>Legacy-capability camera devices will only support FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001797 * <p><b>Range of valid values:</b><br>
1798 * Any value listed in {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001799 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001800 * <p><b>Limited capability</b> -
1801 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1802 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001803 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001804 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001805 * @see CaptureRequest#NOISE_REDUCTION_MODE
1806 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001807 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001808 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001809 public static final Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES =
1810 new Key<int[]>("android.noiseReduction.availableNoiseReductionModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001811
1812 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001813 * <p>If set to 1, the HAL will always split result
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001814 * metadata for a single capture into multiple buffers,
Igor Murashkinace5bf02013-12-10 17:36:40 -08001815 * returned using multiple process_capture_result calls.</p>
1816 * <p>Does not need to be listed in static
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001817 * metadata. Support for partial results will be reworked in
1818 * future versions of camera service. This quirk will stop
1819 * working at that point; DO NOT USE without careful
Igor Murashkinace5bf02013-12-10 17:36:40 -08001820 * consideration of future support.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001821 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001822 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001823 * <p>Not used in HALv3 or newer; replaced by better partials mechanism</p>
1824
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001825 * @hide
1826 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001827 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001828 public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
1829 new Key<Byte>("android.quirks.usePartialResult", byte.class);
1830
1831 /**
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001832 * <p>The maximum numbers of different types of output streams
1833 * that can be configured and used simultaneously by a camera device.</p>
1834 * <p>This is a 3 element tuple that contains the max number of output simultaneous
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001835 * streams for raw sensor, processed (but not stalling), and processed (and stalling)
1836 * formats respectively. For example, assuming that JPEG is typically a processed and
1837 * stalling stream, if max raw sensor format output stream number is 1, max YUV streams
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001838 * number is 3, and max JPEG stream number is 2, then this tuple should be <code>(1, 3, 2)</code>.</p>
1839 * <p>This lists the upper bound of the number of output streams supported by
1840 * the camera device. Using more streams simultaneously may require more hardware and
Igor Murashkin78712a82014-05-27 18:32:18 -07001841 * CPU resources that will consume more power. The image format for an output stream can
Igor Murashkin9c595172014-05-12 13:56:20 -07001842 * be any supported format provided by android.scaler.availableStreamConfigurations.
1843 * The formats defined in android.scaler.availableStreamConfigurations can be catergorized
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001844 * into the 3 stream types as below:</p>
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001845 * <ul>
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001846 * <li>Processed (but stalling): any non-RAW format with a stallDurations &gt; 0.
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001847 * Typically {@link android.graphics.ImageFormat#JPEG JPEG format}.</li>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001848 * <li>Raw formats: {@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}, {@link android.graphics.ImageFormat#RAW10 RAW10}, or
1849 * {@link android.graphics.ImageFormat#RAW12 RAW12}.</li>
1850 * <li>Processed (but not-stalling): any non-RAW format without a stall duration. Typically
1851 * {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888},
Shuzhen Wangec5e8d22018-09-28 09:28:48 -07001852 * {@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 -08001853 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001854 * <p><b>Range of valid values:</b><br></p>
1855 * <p>For processed (and stalling) format streams, &gt;= 1.</p>
1856 * <p>For Raw format (either stalling or non-stalling) streams, &gt;= 0.</p>
1857 * <p>For processed (but not stalling) format streams, &gt;= 3
1858 * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1859 * &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 -07001860 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001861 *
1862 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001863 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001864 */
1865 public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
1866 new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
1867
1868 /**
Igor Murashkin78712a82014-05-27 18:32:18 -07001869 * <p>The maximum numbers of different types of output streams
1870 * that can be configured and used simultaneously by a camera device
1871 * for any <code>RAW</code> formats.</p>
1872 * <p>This value contains the max number of output simultaneous
1873 * streams from the raw sensor.</p>
1874 * <p>This lists the upper bound of the number of output streams supported by
1875 * the camera device. Using more streams simultaneously may require more hardware and
1876 * CPU resources that will consume more power. The image format for this kind of an output stream can
1877 * be any <code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1878 * <p>In particular, a <code>RAW</code> format is typically one of:</p>
1879 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001880 * <li>{@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}</li>
1881 * <li>{@link android.graphics.ImageFormat#RAW10 RAW10}</li>
1882 * <li>{@link android.graphics.ImageFormat#RAW12 RAW12}</li>
Igor Murashkin78712a82014-05-27 18:32:18 -07001883 * </ul>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001884 * <p>LEGACY mode devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> LEGACY)
1885 * never support raw streams.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001886 * <p><b>Range of valid values:</b><br></p>
1887 * <p>&gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001888 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001889 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001890 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001891 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1892 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001893 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001894 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07001895 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001896 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_RAW =
1897 new Key<Integer>("android.request.maxNumOutputRaw", int.class);
1898
1899 /**
1900 * <p>The maximum numbers of different types of output streams
1901 * that can be configured and used simultaneously by a camera device
1902 * for any processed (but not-stalling) formats.</p>
1903 * <p>This value contains the max number of output simultaneous
1904 * streams for any processed (but not-stalling) formats.</p>
1905 * <p>This lists the upper bound of the number of output streams supported by
1906 * the camera device. Using more streams simultaneously may require more hardware and
1907 * CPU resources that will consume more power. The image format for this kind of an output stream can
1908 * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1909 * <p>Processed (but not-stalling) is defined as any non-RAW format without a stall duration.
1910 * Typically:</p>
1911 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001912 * <li>{@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888}</li>
1913 * <li>{@link android.graphics.ImageFormat#NV21 NV21}</li>
1914 * <li>{@link android.graphics.ImageFormat#YV12 YV12}</li>
1915 * <li>Implementation-defined formats, i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class) }</li>
Shuzhen Wangec5e8d22018-09-28 09:28:48 -07001916 * <li>{@link android.graphics.ImageFormat#Y8 Y8}</li>
Igor Murashkin78712a82014-05-27 18:32:18 -07001917 * </ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001918 * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1919 * processed format -- it will return 0 for a non-stalling stream.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001920 * <p>LEGACY devices will support at least 2 processing/non-stalling streams.</p>
1921 * <p><b>Range of valid values:</b><br></p>
1922 * <p>&gt;= 3
1923 * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1924 * &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 -07001925 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001926 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001927 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001928 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1929 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001930 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001931 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07001932 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001933 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC =
1934 new Key<Integer>("android.request.maxNumOutputProc", int.class);
1935
1936 /**
1937 * <p>The maximum numbers of different types of output streams
1938 * that can be configured and used simultaneously by a camera device
1939 * for any processed (and stalling) formats.</p>
1940 * <p>This value contains the max number of output simultaneous
1941 * streams for any processed (but not-stalling) formats.</p>
1942 * <p>This lists the upper bound of the number of output streams supported by
1943 * the camera device. Using more streams simultaneously may require more hardware and
1944 * CPU resources that will consume more power. The image format for this kind of an output stream can
1945 * 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 -07001946 * <p>A processed and stalling format is defined as any non-RAW format with a stallDurations
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001947 * &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 -07001948 * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1949 * processed format -- it will return a non-0 value for a stalling stream.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001950 * <p>LEGACY devices will support up to 1 processing/stalling stream.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001951 * <p><b>Range of valid values:</b><br></p>
1952 * <p>&gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001953 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001954 *
1955 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1956 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001957 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001958 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07001959 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001960 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING =
1961 new Key<Integer>("android.request.maxNumOutputProcStalling", int.class);
1962
1963 /**
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001964 * <p>The maximum numbers of any type of input streams
1965 * that can be configured and used simultaneously by a camera device.</p>
1966 * <p>When set to 0, it means no input stream is supported.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001967 * <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
1968 * input stream, there must be at least one output stream configured to to receive the
1969 * reprocessed images.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08001970 * <p>When an input stream and some output streams are used in a reprocessing request,
1971 * only the input buffer will be used to produce these output stream buffers, and a
1972 * new sensor image will not be captured.</p>
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001973 * <p>For example, for Zero Shutter Lag (ZSL) still capture use case, the input
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001974 * stream image format will be PRIVATE, the associated output stream image format
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001975 * should be JPEG.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001976 * <p><b>Range of valid values:</b><br></p>
1977 * <p>0 or 1.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001978 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001979 * <p><b>Full capability</b> -
1980 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1981 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1982 *
1983 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001984 */
Zhijun He0e99c222015-01-29 15:26:05 -08001985 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08001986 @NonNull
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001987 public static final Key<Integer> REQUEST_MAX_NUM_INPUT_STREAMS =
1988 new Key<Integer>("android.request.maxNumInputStreams", int.class);
1989
1990 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08001991 * <p>Specifies the number of maximum pipeline stages a frame
1992 * has to go through from when it's exposed to when it's available
1993 * to the framework.</p>
1994 * <p>A typical minimum value for this is 2 (one stage to expose,
1995 * one stage to readout) from the sensor. The ISP then usually adds
1996 * its own stages to do custom HW processing. Further stages may be
1997 * added by SW processing.</p>
1998 * <p>Depending on what settings are used (e.g. YUV, JPEG) and what
1999 * processing is enabled (e.g. face detection), the actual pipeline
2000 * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than
2001 * the max pipeline depth.</p>
2002 * <p>A pipeline depth of X stages is equivalent to a pipeline latency of
2003 * X frame intervals.</p>
Zhijun Hefab663e2015-05-26 19:46:31 -07002004 * <p>This value will normally be 8 or less, however, for high speed capture session,
2005 * 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 -07002006 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002007 *
2008 * @see CaptureResult#REQUEST_PIPELINE_DEPTH
2009 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002010 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002011 @NonNull
Igor Murashkinc127f052014-01-17 18:06:02 -08002012 public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH =
2013 new Key<Byte>("android.request.pipelineMaxDepth", byte.class);
2014
2015 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002016 * <p>Defines how many sub-components
Igor Murashkin2086b582014-01-17 18:30:59 -08002017 * a result will be composed of.</p>
2018 * <p>In order to combat the pipeline latency, partial results
2019 * may be delivered to the application layer from the camera device as
2020 * soon as they are available.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002021 * <p>Optional; defaults to 1. A value of 1 means that partial
2022 * results are not supported, and only the final TotalCaptureResult will
2023 * be produced by the camera device.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002024 * <p>A typical use case for this might be: after requesting an
2025 * auto-focus (AF) lock the new AF state might be available 50%
2026 * of the way through the pipeline. The camera device could
2027 * then immediately dispatch this state via a partial result to
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002028 * the application, and the rest of the metadata via later
2029 * partial results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002030 * <p><b>Range of valid values:</b><br>
2031 * &gt;= 1</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002032 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin2086b582014-01-17 18:30:59 -08002033 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002034 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002035 @NonNull
Igor Murashkin2086b582014-01-17 18:30:59 -08002036 public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
2037 new Key<Integer>("android.request.partialResultCount", int.class);
2038
2039 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002040 * <p>List of capabilities that this camera device
Igor Murashkine46c0da2014-02-07 18:34:37 -08002041 * advertises as fully supporting.</p>
2042 * <p>A capability is a contract that the camera device makes in order
2043 * to be able to satisfy one or more use cases.</p>
2044 * <p>Listing a capability guarantees that the whole set of features
2045 * required to support a common use will all be available.</p>
2046 * <p>Using a subset of the functionality provided by an unsupported
2047 * capability may be possible on a specific camera device implementation;
2048 * to do this query each of android.request.availableRequestKeys,
2049 * android.request.availableResultKeys,
2050 * android.request.availableCharacteristicsKeys.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002051 * <p>The following capabilities are guaranteed to be available on
2052 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL devices:</p>
2053 * <ul>
2054 * <li>MANUAL_SENSOR</li>
Zhijun Hedf9b7472014-06-04 13:42:41 -07002055 * <li>MANUAL_POST_PROCESSING</li>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002056 * </ul>
2057 * <p>Other capabilities may be available on either FULL or LIMITED
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002058 * devices, but the application should query this key to be sure.</p>
2059 * <p><b>Possible values:</b>
2060 * <ul>
2061 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE BACKWARD_COMPATIBLE}</li>
2062 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR MANUAL_SENSOR}</li>
2063 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING MANUAL_POST_PROCESSING}</li>
2064 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}</li>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07002065 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING PRIVATE_REPROCESSING}</li>
Ruben Brunk0c22e692014-11-11 12:00:34 -08002066 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}</li>
Eino-Ville Talvala126a7462014-11-04 16:31:01 -08002067 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08002068 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING YUV_REPROCESSING}</li>
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07002069 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT DEPTH_OUTPUT}</li>
Zhijun Hefab663e2015-05-26 19:46:31 -07002070 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO CONSTRAINED_HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002071 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING MOTION_TRACKING}</li>
Shuzhen Wang23d29382017-11-26 17:24:56 -08002072 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA LOGICAL_MULTI_CAMERA}</li>
Shuzhen Wang51248bf2018-03-22 00:04:45 -07002073 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME MONOCHROME}</li>
Jayant Chowdharyd88b4832019-01-24 18:11:09 -08002074 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA SECURE_IMAGE_DATA}</li>
Jayant Chowdhary393ad6e2019-07-17 09:28:50 -07002075 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA SYSTEM_CAMERA}</li>
Yin-Chia Yeh440ee262019-10-07 15:14:51 -07002076 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_OFFLINE_PROCESSING OFFLINE_PROCESSING}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002077 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002078 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002079 *
2080 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala08bc3b02014-07-09 10:07:36 -07002081 * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
Igor Murashkine46c0da2014-02-07 18:34:37 -08002082 * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
Zhijun He50f72432014-05-28 13:52:04 -07002083 * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING
Eino-Ville Talvala611fece2014-07-10 17:29:38 -07002084 * @see #REQUEST_AVAILABLE_CAPABILITIES_RAW
Chien-Yu Chen8062d312015-05-12 14:24:10 -07002085 * @see #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING
Ruben Brunk0c22e692014-11-11 12:00:34 -08002086 * @see #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS
Eino-Ville Talvala126a7462014-11-04 16:31:01 -08002087 * @see #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE
Zhijun He0e99c222015-01-29 15:26:05 -08002088 * @see #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07002089 * @see #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT
Zhijun Hefab663e2015-05-26 19:46:31 -07002090 * @see #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002091 * @see #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING
Shuzhen Wang23d29382017-11-26 17:24:56 -08002092 * @see #REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA
Shuzhen Wang51248bf2018-03-22 00:04:45 -07002093 * @see #REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME
Jayant Chowdharyd88b4832019-01-24 18:11:09 -08002094 * @see #REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA
Jayant Chowdhary393ad6e2019-07-17 09:28:50 -07002095 * @see #REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA
Yin-Chia Yeh440ee262019-10-07 15:14:51 -07002096 * @see #REQUEST_AVAILABLE_CAPABILITIES_OFFLINE_PROCESSING
Igor Murashkine46c0da2014-02-07 18:34:37 -08002097 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002098 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002099 @NonNull
Zhijun He421ddbe2014-05-29 13:41:49 -07002100 public static final Key<int[]> REQUEST_AVAILABLE_CAPABILITIES =
2101 new Key<int[]>("android.request.availableCapabilities", int[].class);
Igor Murashkine46c0da2014-02-07 18:34:37 -08002102
2103 /**
2104 * <p>A list of all keys that the camera device has available
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002105 * to use with {@link android.hardware.camera2.CaptureRequest }.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002106 * <p>Attempting to set a key into a CaptureRequest that is not
2107 * listed here will result in an invalid request and will be rejected
2108 * by the camera device.</p>
2109 * <p>This field can be used to query the feature set of a camera device
2110 * at a more granular level than capabilities. This is especially
2111 * important for optional keys that are not listed under any capability
2112 * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002113 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002114 *
2115 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2116 * @hide
2117 */
2118 public static final Key<int[]> REQUEST_AVAILABLE_REQUEST_KEYS =
2119 new Key<int[]>("android.request.availableRequestKeys", int[].class);
2120
2121 /**
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002122 * <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 -08002123 * <p>Attempting to get a key from a CaptureResult that is not
2124 * listed here will always return a <code>null</code> value. Getting a key from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002125 * a CaptureResult that is listed here will generally never return a <code>null</code>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002126 * value.</p>
2127 * <p>The following keys may return <code>null</code> unless they are enabled:</p>
2128 * <ul>
Ruben Brunk57493682014-05-27 18:58:08 -07002129 * <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 -08002130 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002131 * <p>(Those sometimes-null keys will nevertheless be listed here
Igor Murashkine46c0da2014-02-07 18:34:37 -08002132 * if they are available.)</p>
2133 * <p>This field can be used to query the feature set of a camera device
2134 * at a more granular level than capabilities. This is especially
2135 * important for optional keys that are not listed under any capability
2136 * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002137 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002138 *
2139 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkine46c0da2014-02-07 18:34:37 -08002140 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2141 * @hide
2142 */
2143 public static final Key<int[]> REQUEST_AVAILABLE_RESULT_KEYS =
2144 new Key<int[]>("android.request.availableResultKeys", int[].class);
2145
2146 /**
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002147 * <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 -08002148 * <p>This entry follows the same rules as
2149 * android.request.availableResultKeys (except that it applies for
2150 * CameraCharacteristics instead of CaptureResult). See above for more
2151 * details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002152 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002153 * @hide
2154 */
2155 public static final Key<int[]> REQUEST_AVAILABLE_CHARACTERISTICS_KEYS =
2156 new Key<int[]>("android.request.availableCharacteristicsKeys", int[].class);
2157
2158 /**
Emilian Peev75a55702017-11-07 16:09:59 +00002159 * <p>A subset of the available request keys that the camera device
2160 * can pass as part of the capture session initialization.</p>
2161 * <p>This is a subset of android.request.availableRequestKeys which
2162 * contains a list of keys that are difficult to apply per-frame and
2163 * can result in unexpected delays when modified during the capture session
2164 * lifetime. Typical examples include parameters that require a
2165 * time-consuming hardware re-configuration or internal camera pipeline
2166 * change. For performance reasons we advise clients to pass their initial
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08002167 * values as part of
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08002168 * {@link SessionConfiguration#setSessionParameters }.
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08002169 * Once the camera capture session is enabled it is also recommended to avoid
Emilian Peev75a55702017-11-07 16:09:59 +00002170 * changing them from their initial values set in
2171 * {@link SessionConfiguration#setSessionParameters }.
2172 * Control over session parameters can still be exerted in capture requests
2173 * but clients should be aware and expect delays during their application.
2174 * An example usage scenario could look like this:</p>
2175 * <ul>
2176 * <li>The camera client starts by quering the session parameter key list via
2177 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
2178 * <li>Before triggering the capture session create sequence, a capture request
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08002179 * must be built via
2180 * {@link CameraDevice#createCaptureRequest }
2181 * using an appropriate template matching the particular use case.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00002182 * <li>The client should go over the list of session parameters and check
2183 * whether some of the keys listed matches with the parameters that
2184 * they intend to modify as part of the first capture request.</li>
2185 * <li>If there is no such match, the capture request can be passed
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08002186 * unmodified to
2187 * {@link SessionConfiguration#setSessionParameters }.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00002188 * <li>If matches do exist, the client should update the respective values
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08002189 * and pass the request to
2190 * {@link SessionConfiguration#setSessionParameters }.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00002191 * <li>After the capture session initialization completes the session parameter
2192 * key list can continue to serve as reference when posting or updating
2193 * further requests. As mentioned above further changes to session
2194 * parameters should ideally be avoided, if updates are necessary
2195 * however clients could expect a delay/glitch during the
2196 * parameter switch.</li>
2197 * </ul>
2198 * <p>This key is available on all devices.</p>
2199 * @hide
2200 */
2201 public static final Key<int[]> REQUEST_AVAILABLE_SESSION_KEYS =
2202 new Key<int[]>("android.request.availableSessionKeys", int[].class);
2203
2204 /**
koprivadebd4ee2018-09-13 10:59:46 -07002205 * <p>A subset of the available request keys that can be overridden for
Emilian Peev2100ae72018-01-12 16:56:25 +00002206 * physical devices backing a logical multi-camera.</p>
2207 * <p>This is a subset of android.request.availableRequestKeys which contains a list
koprivadebd4ee2018-09-13 10:59:46 -07002208 * of keys that can be overridden using {@link CaptureRequest.Builder#setPhysicalCameraKey }.
Emilian Peev2100ae72018-01-12 16:56:25 +00002209 * The respective value of such request key can be obtained by calling
2210 * {@link CaptureRequest.Builder#getPhysicalCameraKey }. Capture requests that contain
2211 * individual physical device requests must be built via
Emilian Peevf60f4fb2018-02-08 17:40:48 +00002212 * {@link android.hardware.camera2.CameraDevice#createCaptureRequest(int, Set)}.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002213 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev2100ae72018-01-12 16:56:25 +00002214 * <p><b>Limited capability</b> -
2215 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2216 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2217 *
2218 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2219 * @hide
2220 */
2221 public static final Key<int[]> REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS =
2222 new Key<int[]>("android.request.availablePhysicalCameraRequestKeys", int[].class);
2223
2224 /**
Emilian Peeva7fea4c2018-09-03 16:37:06 +01002225 * <p>A list of camera characteristics keys that are only available
2226 * in case the camera client has camera permission.</p>
2227 * <p>The entry contains a subset of
2228 * {@link android.hardware.camera2.CameraCharacteristics#getKeys } that require camera clients
2229 * to acquire the {@link android.Manifest.permission#CAMERA } permission before calling
2230 * {@link android.hardware.camera2.CameraManager#getCameraCharacteristics }. If the
2231 * permission is not held by the camera client, then the values of the repsective properties
2232 * will not be present in {@link android.hardware.camera2.CameraCharacteristics }.</p>
2233 * <p>This key is available on all devices.</p>
2234 * @hide
2235 */
2236 public static final Key<int[]> REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION =
2237 new Key<int[]>("android.request.characteristicKeysNeedingPermission", int[].class);
2238
2239 /**
Zhijun Hef3b16df2014-01-17 13:37:59 -08002240 * <p>The list of image formats that are supported by this
Igor Murashkin418f6df2014-02-07 18:20:48 -08002241 * camera device for output streams.</p>
Zhijun Hef3b16df2014-01-17 13:37:59 -08002242 * <p>All camera devices will support JPEG and YUV_420_888 formats.</p>
2243 * <p>When set to YUV_420_888, application can access the YUV420 data directly.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002244 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002245 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002246 * <p>Not used in HALv3 or newer</p>
2247
Igor Murashkin9c595172014-05-12 13:56:20 -07002248 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002249 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002250 @Deprecated
Igor Murashkinb519cc52013-07-02 11:23:44 -07002251 public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
2252 new Key<int[]>("android.scaler.availableFormats", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002253
2254 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002255 * <p>The minimum frame duration that is supported
Igor Murashkin9c595172014-05-12 13:56:20 -07002256 * for each resolution in android.scaler.availableJpegSizes.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002257 * <p>This corresponds to the minimum steady-state frame duration when only
2258 * that JPEG stream is active and captured in a burst, with all
2259 * processing (typically in android.*.mode) set to FAST.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002260 * <p>When multiple streams are configured, the minimum
2261 * frame duration will be &gt;= max(individual stream min
2262 * durations)</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002263 * <p><b>Units</b>: Nanoseconds</p>
2264 * <p><b>Range of valid values:</b><br>
2265 * TODO: Remove property.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002266 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002267 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002268 * <p>Not used in HALv3 or newer</p>
2269
Igor Murashkin9c595172014-05-12 13:56:20 -07002270 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002271 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002272 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002273 public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
2274 new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002275
2276 /**
Zhijun Hef3b16df2014-01-17 13:37:59 -08002277 * <p>The JPEG resolutions that are supported by this camera device.</p>
2278 * <p>The resolutions are listed as <code>(width, height)</code> pairs. All camera devices will support
2279 * 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 -07002280 * <p><b>Range of valid values:</b><br>
2281 * TODO: Remove property.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002282 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Zhijun Hef3b16df2014-01-17 13:37:59 -08002283 *
2284 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Igor Murashkin9c595172014-05-12 13:56:20 -07002285 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002286 * <p>Not used in HALv3 or newer</p>
2287
Igor Murashkin9c595172014-05-12 13:56:20 -07002288 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002289 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002290 @Deprecated
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002291 public static final Key<android.util.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
2292 new Key<android.util.Size[]>("android.scaler.availableJpegSizes", android.util.Size[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002293
2294 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002295 * <p>The maximum ratio between both active area width
2296 * and crop region width, and active area height and
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002297 * crop region height, for {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002298 * <p>This represents the maximum amount of zooming possible by
2299 * the camera device, or equivalently, the minimum cropping
2300 * window size.</p>
2301 * <p>Crop regions that have a width or height that is smaller
2302 * than this ratio allows will be rounded up to the minimum
2303 * allowed size by the camera device.</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08002304 * <p>Starting from API level 30, when using {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} to zoom in or out,
2305 * the application must use {@link CameraCharacteristics#CONTROL_ZOOM_RATIO_RANGE android.control.zoomRatioRange} to query both the minimum and
2306 * maximum zoom ratio.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002307 * <p><b>Units</b>: Zoom scale factor</p>
2308 * <p><b>Range of valid values:</b><br>
2309 * &gt;=1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002310 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002311 *
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08002312 * @see CaptureRequest#CONTROL_ZOOM_RATIO
2313 * @see CameraCharacteristics#CONTROL_ZOOM_RATIO_RANGE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002314 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002315 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002316 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002317 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002318 public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM =
2319 new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002320
2321 /**
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002322 * <p>For each available processed output size (defined in
Igor Murashkin9c595172014-05-12 13:56:20 -07002323 * android.scaler.availableProcessedSizes), this property lists the
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002324 * minimum supportable frame duration for that size.</p>
2325 * <p>This should correspond to the frame duration when only that processed
2326 * stream is active, with all processing (typically in android.*.mode)
2327 * set to FAST.</p>
2328 * <p>When multiple streams are configured, the minimum frame duration will
2329 * be &gt;= max(individual stream min durations).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002330 * <p><b>Units</b>: Nanoseconds</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002331 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002332 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002333 * <p>Not used in HALv3 or newer</p>
2334
Igor Murashkin9c595172014-05-12 13:56:20 -07002335 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002336 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002337 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002338 public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
2339 new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002340
2341 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002342 * <p>The resolutions available for use with
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002343 * processed output streams, such as YV12, NV12, and
2344 * platform opaque YUV/RGB streams to the GPU or video
Zhijun Hef3b16df2014-01-17 13:37:59 -08002345 * encoders.</p>
2346 * <p>The resolutions are listed as <code>(width, height)</code> pairs.</p>
2347 * <p>For a given use case, the actual maximum supported resolution
2348 * may be lower than what is listed here, depending on the destination
2349 * Surface for the image data. For example, for recording video,
2350 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2351 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2352 * can provide.</p>
2353 * <p>Please reference the documentation for the image data destination to
2354 * check if it limits the maximum size for image data.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002355 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002356 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002357 * <p>Not used in HALv3 or newer</p>
2358
Igor Murashkin9c595172014-05-12 13:56:20 -07002359 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002360 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002361 @Deprecated
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002362 public static final Key<android.util.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
2363 new Key<android.util.Size[]>("android.scaler.availableProcessedSizes", android.util.Size[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002364
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002365 /**
Igor Murashkin418f6df2014-02-07 18:20:48 -08002366 * <p>The mapping of image formats that are supported by this
2367 * camera device for input streams, to their corresponding output formats.</p>
2368 * <p>All camera devices with at least 1
Zhijun He0e99c222015-01-29 15:26:05 -08002369 * {@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} will have at least one
Igor Murashkin418f6df2014-02-07 18:20:48 -08002370 * available input format.</p>
2371 * <p>The camera device will support the following map of formats,
Zhijun He0e99c222015-01-29 15:26:05 -08002372 * if its dependent capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002373 * <table>
2374 * <thead>
2375 * <tr>
2376 * <th align="left">Input Format</th>
2377 * <th align="left">Output Format</th>
2378 * <th align="left">Capability</th>
2379 * </tr>
2380 * </thead>
2381 * <tbody>
2382 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002383 * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
2384 * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07002385 * <td align="left">PRIVATE_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002386 * </tr>
2387 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002388 * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
2389 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07002390 * <td align="left">PRIVATE_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002391 * </tr>
2392 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002393 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2394 * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
Zhijun He0e99c222015-01-29 15:26:05 -08002395 * <td align="left">YUV_REPROCESSING</td>
2396 * </tr>
2397 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002398 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2399 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Zhijun He0e99c222015-01-29 15:26:05 -08002400 * <td align="left">YUV_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002401 * </tr>
2402 * </tbody>
2403 * </table>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002404 * <p>PRIVATE refers to a device-internal format that is not directly application-visible. A
Chien-Yu Chen8062d312015-05-12 14:24:10 -07002405 * PRIVATE input surface can be acquired by {@link android.media.ImageReader#newInstance }
2406 * with {@link android.graphics.ImageFormat#PRIVATE } as the format.</p>
2407 * <p>For a PRIVATE_REPROCESSING-capable camera device, using the PRIVATE format as either input
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002408 * 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 -08002409 * <p>Attempting to configure an input stream with output streams not
2410 * listed as available in this map is not valid.</p>
Shuzhen Wangec5e8d22018-09-28 09:28:48 -07002411 * <p>Additionally, if the camera device is MONOCHROME with Y8 support, it will also support
2412 * the following map of formats if its dependent capability
2413 * ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
2414 * <table>
2415 * <thead>
2416 * <tr>
2417 * <th align="left">Input Format</th>
2418 * <th align="left">Output Format</th>
2419 * <th align="left">Capability</th>
2420 * </tr>
2421 * </thead>
2422 * <tbody>
2423 * <tr>
2424 * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
2425 * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2426 * <td align="left">PRIVATE_REPROCESSING</td>
2427 * </tr>
2428 * <tr>
2429 * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2430 * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
2431 * <td align="left">YUV_REPROCESSING</td>
2432 * </tr>
2433 * <tr>
2434 * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2435 * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2436 * <td align="left">YUV_REPROCESSING</td>
2437 * </tr>
2438 * </tbody>
2439 * </table>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002440 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002441 *
Zhijun He0e99c222015-01-29 15:26:05 -08002442 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2443 * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
Igor Murashkin9c595172014-05-12 13:56:20 -07002444 * @hide
Igor Murashkin418f6df2014-02-07 18:20:48 -08002445 */
Chien-Yu Chen0a551f12015-04-03 17:57:35 -07002446 public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP =
2447 new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
Igor Murashkin418f6df2014-02-07 18:20:48 -08002448
2449 /**
Igor Murashkina23ffb52014-02-07 18:52:34 -08002450 * <p>The available stream configurations that this
2451 * camera device supports
2452 * (i.e. format, width, height, output/input stream).</p>
2453 * <p>The configurations are listed as <code>(format, width, height, input?)</code>
2454 * tuples.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002455 * <p>For a given use case, the actual maximum supported resolution
2456 * may be lower than what is listed here, depending on the destination
2457 * Surface for the image data. For example, for recording video,
2458 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2459 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2460 * can provide.</p>
2461 * <p>Please reference the documentation for the image data destination to
2462 * check if it limits the maximum size for image data.</p>
2463 * <p>Not all output formats may be supported in a configuration with
2464 * an input stream of a particular format. For more details, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002465 * android.scaler.availableInputOutputFormatsMap.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002466 * <p>The following table describes the minimum required output stream
2467 * configurations based on the hardware level
2468 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
2469 * <table>
2470 * <thead>
2471 * <tr>
2472 * <th align="center">Format</th>
2473 * <th align="center">Size</th>
2474 * <th align="center">Hardware Level</th>
2475 * <th align="center">Notes</th>
2476 * </tr>
2477 * </thead>
2478 * <tbody>
2479 * <tr>
2480 * <td align="center">JPEG</td>
2481 * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
2482 * <td align="center">Any</td>
2483 * <td align="center"></td>
2484 * </tr>
2485 * <tr>
2486 * <td align="center">JPEG</td>
2487 * <td align="center">1920x1080 (1080p)</td>
2488 * <td align="center">Any</td>
2489 * <td align="center">if 1080p &lt;= activeArraySize</td>
2490 * </tr>
2491 * <tr>
2492 * <td align="center">JPEG</td>
2493 * <td align="center">1280x720 (720)</td>
2494 * <td align="center">Any</td>
2495 * <td align="center">if 720p &lt;= activeArraySize</td>
2496 * </tr>
2497 * <tr>
2498 * <td align="center">JPEG</td>
2499 * <td align="center">640x480 (480p)</td>
2500 * <td align="center">Any</td>
2501 * <td align="center">if 480p &lt;= activeArraySize</td>
2502 * </tr>
2503 * <tr>
2504 * <td align="center">JPEG</td>
2505 * <td align="center">320x240 (240p)</td>
2506 * <td align="center">Any</td>
2507 * <td align="center">if 240p &lt;= activeArraySize</td>
2508 * </tr>
2509 * <tr>
2510 * <td align="center">YUV_420_888</td>
2511 * <td align="center">all output sizes available for JPEG</td>
2512 * <td align="center">FULL</td>
2513 * <td align="center"></td>
2514 * </tr>
2515 * <tr>
2516 * <td align="center">YUV_420_888</td>
2517 * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
2518 * <td align="center">LIMITED</td>
2519 * <td align="center"></td>
2520 * </tr>
2521 * <tr>
2522 * <td align="center">IMPLEMENTATION_DEFINED</td>
2523 * <td align="center">same as YUV_420_888</td>
2524 * <td align="center">Any</td>
2525 * <td align="center"></td>
2526 * </tr>
2527 * </tbody>
2528 * </table>
2529 * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional
2530 * mandatory stream configurations on a per-capability basis.</p>
Yin-Chia Yeh428256d2019-01-23 15:27:47 -08002531 * <p>Exception on 176x144 (QCIF) resolution: camera devices usually have a fixed capability for
2532 * downscaling from larger resolution to smaller, and the QCIF resolution sometimes is not
2533 * fully supported due to this limitation on devices with high-resolution image sensors.
2534 * Therefore, trying to configure a QCIF resolution stream together with any other
2535 * stream larger than 1920x1080 resolution (either width or height) might not be supported,
2536 * and capture session creation will fail if it is not.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002537 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002538 *
2539 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2540 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkina23ffb52014-02-07 18:52:34 -08002541 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Igor Murashkin9c595172014-05-12 13:56:20 -07002542 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08002543 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002544 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS =
2545 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08002546
2547 /**
2548 * <p>This lists the minimum frame duration for each
2549 * format/size combination.</p>
2550 * <p>This should correspond to the frame duration when only that
2551 * stream is active, with all processing (typically in android.*.mode)
2552 * set to either OFF or FAST.</p>
2553 * <p>When multiple streams are used in a request, the minimum frame
2554 * duration will be max(individual stream min durations).</p>
2555 * <p>The minimum frame duration of a stream (of a particular format, size)
2556 * is the same regardless of whether the stream is input or output.</p>
2557 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
Igor Murashkin9c595172014-05-12 13:56:20 -07002558 * android.scaler.availableStallDurations for more details about
Igor Murashkina23ffb52014-02-07 18:52:34 -08002559 * calculating the max frame rate.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002560 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002561 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002562 *
Igor Murashkina23ffb52014-02-07 18:52:34 -08002563 * @see CaptureRequest#SENSOR_FRAME_DURATION
Igor Murashkin9c595172014-05-12 13:56:20 -07002564 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08002565 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002566 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS =
2567 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08002568
2569 /**
2570 * <p>This lists the maximum stall duration for each
Zhijun He513f7c32015-04-24 18:23:54 -07002571 * output format/size combination.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002572 * <p>A stall duration is how much extra time would get added
2573 * to the normal minimum frame duration for a repeating request
2574 * that has streams with non-zero stall.</p>
2575 * <p>For example, consider JPEG captures which have the following
2576 * characteristics:</p>
2577 * <ul>
2578 * <li>JPEG streams act like processed YUV streams in requests for which
2579 * they are not included; in requests in which they are directly
2580 * referenced, they act as JPEG streams. This is because supporting a
2581 * JPEG stream requires the underlying YUV data to always be ready for
2582 * use by a JPEG encoder, but the encoder will only be used (and impact
2583 * frame duration) on requests that actually reference a JPEG stream.</li>
2584 * <li>The JPEG processor can run concurrently to the rest of the camera
2585 * pipeline, but cannot process more than 1 capture at a time.</li>
2586 * </ul>
2587 * <p>In other words, using a repeating YUV request would result
2588 * in a steady frame rate (let's say it's 30 FPS). If a single
2589 * JPEG request is submitted periodically, the frame rate will stay
2590 * at 30 FPS (as long as we wait for the previous JPEG to return each
2591 * time). If we try to submit a repeating YUV + JPEG request, then
2592 * the frame rate will drop from 30 FPS.</p>
2593 * <p>In general, submitting a new request with a non-0 stall time
2594 * stream will <em>not</em> cause a frame rate drop unless there are still
2595 * outstanding buffers for that stream from previous requests.</p>
2596 * <p>Submitting a repeating request with streams (call this <code>S</code>)
2597 * is the same as setting the minimum frame duration from
2598 * the normal minimum frame duration corresponding to <code>S</code>, added with
2599 * the maximum stall duration for <code>S</code>.</p>
2600 * <p>If interleaving requests with and without a stall duration,
2601 * a request will stall by the maximum of the remaining times
2602 * for each can-stall stream with outstanding buffers.</p>
2603 * <p>This means that a stalling request will not have an exposure start
2604 * until the stall has completed.</p>
2605 * <p>This should correspond to the stall duration when only that stream is
2606 * active, with all processing (typically in android.*.mode) set to FAST
2607 * or OFF. Setting any of the processing modes to HIGH_QUALITY
2608 * effectively results in an indeterminate stall duration for all
2609 * streams in a request (the regular stall calculation rules are
2610 * ignored).</p>
2611 * <p>The following formats may always have a stall duration:</p>
2612 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002613 * <li>{@link android.graphics.ImageFormat#JPEG }</li>
2614 * <li>{@link android.graphics.ImageFormat#RAW_SENSOR }</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002615 * </ul>
2616 * <p>The following formats will never have a stall duration:</p>
2617 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002618 * <li>{@link android.graphics.ImageFormat#YUV_420_888 }</li>
2619 * <li>{@link android.graphics.ImageFormat#RAW10 }</li>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002620 * <li>{@link android.graphics.ImageFormat#RAW12 }</li>
Shuzhen Wangec5e8d22018-09-28 09:28:48 -07002621 * <li>{@link android.graphics.ImageFormat#Y8 }</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002622 * </ul>
2623 * <p>All other formats may or may not have an allowed stall duration on
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002624 * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Igor Murashkina23ffb52014-02-07 18:52:34 -08002625 * for more details.</p>
2626 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} for more information about
2627 * calculating the max frame rate (absent stalls).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002628 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002629 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002630 *
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002631 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkina23ffb52014-02-07 18:52:34 -08002632 * @see CaptureRequest#SENSOR_FRAME_DURATION
Igor Murashkin9c595172014-05-12 13:56:20 -07002633 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08002634 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002635 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS =
2636 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
2637
2638 /**
2639 * <p>The available stream configurations that this
2640 * camera device supports; also includes the minimum frame durations
2641 * and the stall durations for each format/size combination.</p>
2642 * <p>All camera devices will support sensor maximum resolution (defined by
2643 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.</p>
2644 * <p>For a given use case, the actual maximum supported resolution
2645 * may be lower than what is listed here, depending on the destination
2646 * Surface for the image data. For example, for recording video,
2647 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2648 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2649 * can provide.</p>
2650 * <p>Please reference the documentation for the image data destination to
2651 * check if it limits the maximum size for image data.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002652 * <p>The following table describes the minimum required output stream
2653 * configurations based on the hardware level
2654 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
2655 * <table>
2656 * <thead>
2657 * <tr>
2658 * <th align="center">Format</th>
2659 * <th align="center">Size</th>
2660 * <th align="center">Hardware Level</th>
2661 * <th align="center">Notes</th>
2662 * </tr>
2663 * </thead>
2664 * <tbody>
2665 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002666 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002667 * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} (*1)</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002668 * <td align="center">Any</td>
2669 * <td align="center"></td>
2670 * </tr>
2671 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002672 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002673 * <td align="center">1920x1080 (1080p)</td>
2674 * <td align="center">Any</td>
2675 * <td align="center">if 1080p &lt;= activeArraySize</td>
2676 * </tr>
2677 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002678 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002679 * <td align="center">1280x720 (720p)</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002680 * <td align="center">Any</td>
2681 * <td align="center">if 720p &lt;= activeArraySize</td>
2682 * </tr>
2683 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002684 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002685 * <td align="center">640x480 (480p)</td>
2686 * <td align="center">Any</td>
2687 * <td align="center">if 480p &lt;= activeArraySize</td>
2688 * </tr>
2689 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002690 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002691 * <td align="center">320x240 (240p)</td>
2692 * <td align="center">Any</td>
2693 * <td align="center">if 240p &lt;= activeArraySize</td>
2694 * </tr>
2695 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002696 * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002697 * <td align="center">all output sizes available for JPEG</td>
2698 * <td align="center">FULL</td>
2699 * <td align="center"></td>
2700 * </tr>
2701 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002702 * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002703 * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
2704 * <td align="center">LIMITED</td>
2705 * <td align="center"></td>
2706 * </tr>
2707 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002708 * <td align="center">{@link android.graphics.ImageFormat#PRIVATE }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002709 * <td align="center">same as YUV_420_888</td>
2710 * <td align="center">Any</td>
2711 * <td align="center"></td>
2712 * </tr>
2713 * </tbody>
2714 * </table>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002715 * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} and {@link android.hardware.camera2.CameraDevice#createCaptureSession } for additional mandatory
2716 * stream configurations on a per-capability basis.</p>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002717 * <p>*1: For JPEG format, the sizes may be restricted by below conditions:</p>
2718 * <ul>
2719 * <li>The HAL may choose the aspect ratio of each Jpeg size to be one of well known ones
2720 * (e.g. 4:3, 16:9, 3:2 etc.). If the sensor maximum resolution
2721 * (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) has an aspect ratio other than these,
2722 * it does not have to be included in the supported JPEG sizes.</li>
2723 * <li>Some hardware JPEG encoders may have pixel boundary alignment requirements, such as
2724 * the dimensions being a multiple of 16.
2725 * Therefore, the maximum JPEG size may be smaller than sensor maximum resolution.
2726 * However, the largest JPEG size will be as close as possible to the sensor maximum
2727 * resolution given above constraints. It is required that after aspect ratio adjustments,
2728 * additional size reduction due to other issues must be less than 3% in area. For example,
2729 * if the sensor maximum resolution is 3280x2464, if the maximum JPEG size has aspect
2730 * ratio 4:3, and the JPEG encoder alignment requirement is 16, the maximum JPEG size will be
2731 * 3264x2448.</li>
2732 * </ul>
Yin-Chia Yeh428256d2019-01-23 15:27:47 -08002733 * <p>Exception on 176x144 (QCIF) resolution: camera devices usually have a fixed capability on
2734 * downscaling from larger resolution to smaller ones, and the QCIF resolution can sometimes
2735 * not be fully supported due to this limitation on devices with high-resolution image
2736 * sensors. Therefore, trying to configure a QCIF resolution stream together with any other
2737 * stream larger than 1920x1080 resolution (either width or height) might not be supported,
2738 * and capture session creation will fail if it is not.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002739 * <p>This key is available on all devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002740 *
2741 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2742 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2743 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2744 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002745 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002746 @NonNull
Igor Murashkin6c76f582014-07-15 17:19:49 -07002747 @SyntheticKey
Igor Murashkin9c595172014-05-12 13:56:20 -07002748 public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP =
2749 new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08002750
2751 /**
Zhijun He14986152014-05-22 21:17:37 -07002752 * <p>The crop type that this camera device supports.</p>
2753 * <p>When passing a non-centered crop region ({@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}) to a camera
2754 * device that only supports CENTER_ONLY cropping, the camera device will move the
2755 * crop region to the center of the sensor active array ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize})
2756 * and keep the crop region width and height unchanged. The camera device will return the
2757 * final used crop region in metadata result {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
2758 * <p>Camera devices that support FREEFORM cropping will support any crop region that
2759 * is inside of the active array. The camera device will apply the same crop region and
2760 * return the final used crop region in capture result metadata {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08002761 * <p>Starting from API level 30,</p>
2762 * <ul>
2763 * <li>If the camera device supports FREEFORM cropping, in order to do FREEFORM cropping, the
2764 * application must set {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} to 1.0, and use {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}
2765 * for zoom.</li>
2766 * <li>To do CENTER_ONLY zoom, the application has below 2 options:<ol>
2767 * <li>Set {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} to 1.0; adjust zoom by {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</li>
2768 * <li>Adjust zoom by {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}; use {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to crop
2769 * the field of view vertically (letterboxing) or horizontally (pillarboxing), but not
2770 * windowboxing.</li>
2771 * </ol>
2772 * </li>
2773 * <li>Setting {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} to values different than 1.0 and
2774 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to be windowboxing at the same time is undefined behavior.</li>
2775 * </ul>
Eino-Ville Talvala81e89282015-06-30 16:34:24 -07002776 * <p>LEGACY capability devices will only support CENTER_ONLY cropping.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002777 * <p><b>Possible values:</b>
2778 * <ul>
2779 * <li>{@link #SCALER_CROPPING_TYPE_CENTER_ONLY CENTER_ONLY}</li>
2780 * <li>{@link #SCALER_CROPPING_TYPE_FREEFORM FREEFORM}</li>
2781 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002782 * <p>This key is available on all devices.</p>
Zhijun He14986152014-05-22 21:17:37 -07002783 *
Shuzhen Wang55c1c3f2019-11-13 11:25:20 -08002784 * @see CaptureRequest#CONTROL_ZOOM_RATIO
Zhijun He14986152014-05-22 21:17:37 -07002785 * @see CaptureRequest#SCALER_CROP_REGION
2786 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2787 * @see #SCALER_CROPPING_TYPE_CENTER_ONLY
2788 * @see #SCALER_CROPPING_TYPE_FREEFORM
2789 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002790 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002791 @NonNull
Zhijun He14986152014-05-22 21:17:37 -07002792 public static final Key<Integer> SCALER_CROPPING_TYPE =
2793 new Key<Integer>("android.scaler.croppingType", int.class);
2794
2795 /**
Emilian Peev2776ca32018-09-18 14:00:39 +01002796 * <p>Recommended stream configurations for common client use cases.</p>
2797 * <p>Optional subset of the android.scaler.availableStreamConfigurations that contains
2798 * similar tuples listed as
2799 * (i.e. width, height, format, output/input stream, usecase bit field).
2800 * Camera devices will be able to suggest particular stream configurations which are
2801 * power and performance efficient for specific use cases. For more information about
2802 * retrieving the suggestions see
2803 * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002804 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev2776ca32018-09-18 14:00:39 +01002805 * @hide
2806 */
2807 public static final Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]> SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS =
2808 new Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]>("android.scaler.availableRecommendedStreamConfigurations", android.hardware.camera2.params.RecommendedStreamConfiguration[].class);
2809
2810 /**
2811 * <p>Recommended mappings of image formats that are supported by this
2812 * camera device for input streams, to their corresponding output formats.</p>
2813 * <p>This is a recommended subset of the complete list of mappings found in
2814 * android.scaler.availableInputOutputFormatsMap. The same requirements apply here as well.
2815 * The list however doesn't need to contain all available and supported mappings. Instead of
2816 * this developers must list only recommended and efficient entries.
2817 * If set, the information will be available in the ZERO_SHUTTER_LAG recommended stream
2818 * configuration see
2819 * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002820 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev2776ca32018-09-18 14:00:39 +01002821 * @hide
2822 */
2823 public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP =
2824 new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableRecommendedInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
2825
2826 /**
Emilian Peev423cbd72018-11-10 18:37:45 +00002827 * <p>An array of mandatory stream combinations generated according to the camera device
2828 * {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL }
2829 * and {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES }.
2830 * This is an app-readable conversion of the mandatory stream combination
2831 * {@link android.hardware.camera2.CameraDevice#createCaptureSession tables}.</p>
2832 * <p>The array of
2833 * {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
2834 * generated according to the documented
2835 * {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} based on
2836 * specific device level and capabilities.
2837 * Clients can use the array as a quick reference to find an appropriate camera stream
2838 * combination.
2839 * As per documentation, the stream combinations with given PREVIEW, RECORD and
2840 * MAXIMUM resolutions and anything smaller from the list given by
2841 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes } are
2842 * guaranteed to work.
Shuzhen Wang2da73f42019-03-12 15:16:06 -07002843 * For a physical camera not independently exposed in
2844 * {@link android.hardware.camera2.CameraManager#getCameraIdList }, the mandatory stream
2845 * combinations for that physical camera Id are also generated, so that the application can
2846 * configure them as physical streams via the logical camera.
2847 * The mandatory stream combination array will be {@code null} in case the device is not
2848 * backward compatible.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002849 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev423cbd72018-11-10 18:37:45 +00002850 * <p><b>Limited capability</b> -
2851 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2852 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2853 *
2854 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2855 */
2856 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002857 @NonNull
Emilian Peev423cbd72018-11-10 18:37:45 +00002858 @SyntheticKey
2859 public static final Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_STREAM_COMBINATIONS =
2860 new Key<android.hardware.camera2.params.MandatoryStreamCombination[]>("android.scaler.mandatoryStreamCombinations", android.hardware.camera2.params.MandatoryStreamCombination[].class);
2861
2862 /**
Jayant Chowdhary48dec2e2020-03-13 13:44:03 -07002863 * <p>An array of mandatory concurrent stream combinations.
2864 * This is an app-readable conversion of the concurrent mandatory stream combination
2865 * {@link android.hardware.camera2.CameraDevice#createCaptureSession tables}.</p>
2866 * <p>The array of
2867 * {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
2868 * generated according to the documented
2869 * {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} for each
2870 * device which has its Id present in the set returned by
2871 * {@link android.hardware.camera2.CameraManager#getConcurrentCameraIds }.
2872 * Clients can use the array as a quick reference to find an appropriate camera stream
2873 * combination.
2874 * The mandatory stream combination array will be {@code null} in case the device is not a
2875 * part of at least one set of combinations returned by
2876 * {@link android.hardware.camera2.CameraManager#getConcurrentCameraIds }.</p>
2877 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2878 */
2879 @PublicKey
2880 @NonNull
2881 @SyntheticKey
2882 public static final Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_CONCURRENT_STREAM_COMBINATIONS =
2883 new Key<android.hardware.camera2.params.MandatoryStreamCombination[]>("android.scaler.mandatoryConcurrentStreamCombinations", android.hardware.camera2.params.MandatoryStreamCombination[].class);
2884
2885 /**
Eino-Ville Talvala9f9bb3b2020-03-18 13:31:03 -07002886 * <p>List of rotate-and-crop modes for android.scaler.rotateAndCrop that are supported by this camera device.</p>
2887 * <p>This entry lists the valid modes for android.scaler.rotateAndCrop for this camera device.</p>
2888 * <p>Starting at some future API level, all devices will list at least <code>ROTATE_AND_CROP_NONE</code>.
Eino-Ville Talvalaa9b1d602020-01-06 13:10:22 -08002889 * Devices with support for rotate-and-crop will additionally list at least
2890 * <code>ROTATE_AND_CROP_AUTO</code> and <code>ROTATE_AND_CROP_90</code>.</p>
2891 * <p><b>Range of valid values:</b><br>
Eino-Ville Talvala9f9bb3b2020-03-18 13:31:03 -07002892 * Any value listed in android.scaler.rotateAndCrop</p>
Eino-Ville Talvalaa9b1d602020-01-06 13:10:22 -08002893 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Eino-Ville Talvala9f9bb3b2020-03-18 13:31:03 -07002894 * @hide
Eino-Ville Talvalaa9b1d602020-01-06 13:10:22 -08002895 */
Eino-Ville Talvalaa9b1d602020-01-06 13:10:22 -08002896 public static final Key<int[]> SCALER_AVAILABLE_ROTATE_AND_CROP_MODES =
2897 new Key<int[]>("android.scaler.availableRotateAndCropModes", int[].class);
Jayant Chowdhary48dec2e2020-03-13 13:44:03 -07002898
Eino-Ville Talvalaa9b1d602020-01-06 13:10:22 -08002899 /**
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002900 * <p>The area of the image sensor which corresponds to active pixels after any geometric
2901 * distortion correction has been applied.</p>
2902 * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2903 * the region that actually receives light from the scene) after any geometric correction
2904 * has been applied, and should be treated as the maximum size in pixels of any of the
2905 * image output formats aside from the raw formats.</p>
2906 * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
2907 * the full pixel array, and the size of the full pixel array is given by
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002908 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002909 * <p>The coordinate system for most other keys that list pixel coordinates, including
2910 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, is defined relative to the active array rectangle given in
2911 * this field, with <code>(0, 0)</code> being the top-left of this rectangle.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002912 * <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 -07002913 * include black calibration pixels or other inactive regions.</p>
2914 * <p>For devices that do not support {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the active
2915 * array must be the same as {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.</p>
2916 * <p>For devices that support {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the active array must
2917 * be enclosed by {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}. The difference between
2918 * pre-correction active array and active array accounts for scaling or cropping caused
2919 * by lens geometric distortion correction.</p>
2920 * <p>In general, application should always refer to active array size for controls like
2921 * metering regions or crop region. Two exceptions are when the application is dealing with
2922 * RAW image buffers (RAW_SENSOR, RAW10, RAW12 etc), or when application explicitly set
2923 * {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} to OFF. In these cases, application should refer
2924 * to {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002925 * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002926 * <p>This key is available on all devices.</p>
2927 *
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002928 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002929 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002930 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002931 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002932 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002933 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002934 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002935 public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE =
2936 new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002937
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002938 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002939 * <p>Range of sensitivities for {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} supported by this
2940 * camera device.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002941 * <p>The values are the standard ISO sensitivity values,
2942 * as defined in ISO 12232:2006.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002943 * <p><b>Range of valid values:</b><br>
2944 * Min &lt;= 100, Max &gt;= 800</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002945 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002946 * <p><b>Full capability</b> -
2947 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2948 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002949 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002950 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002951 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002952 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002953 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002954 @NonNull
Ruben Brunk57493682014-05-27 18:58:08 -07002955 public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE =
2956 new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002957
2958 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002959 * <p>The arrangement of color filters on sensor;
Zhijun Hed1784962014-04-08 17:41:46 -07002960 * represents the colors in the top-left 2x2 section of
Shuzhen Wanga8d36032018-10-15 12:01:53 -07002961 * the sensor, in reading order, for a Bayer camera, or the
2962 * light spectrum it captures for MONOCHROME camera.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002963 * <p><b>Possible values:</b>
2964 * <ul>
2965 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB RGGB}</li>
2966 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG GRBG}</li>
2967 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG GBRG}</li>
2968 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR BGGR}</li>
2969 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB RGB}</li>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07002970 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO MONO}</li>
2971 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR NIR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002972 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002973 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002974 * <p><b>Full capability</b> -
2975 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2976 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2977 *
2978 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Hed1784962014-04-08 17:41:46 -07002979 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB
2980 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG
2981 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG
2982 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR
2983 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB
Shuzhen Wanga8d36032018-10-15 12:01:53 -07002984 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO
2985 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR
Zhijun Hed1784962014-04-08 17:41:46 -07002986 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002987 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08002988 @NonNull
Zhijun Hed1784962014-04-08 17:41:46 -07002989 public static final Key<Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT =
2990 new Key<Integer>("android.sensor.info.colorFilterArrangement", int.class);
2991
2992 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002993 * <p>The range of image exposure times for {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} supported
2994 * by this camera device.</p>
2995 * <p><b>Units</b>: Nanoseconds</p>
2996 * <p><b>Range of valid values:</b><br>
2997 * The minimum exposure time will be less than 100 us. For FULL
Zhijun He28288ca2014-06-25 15:49:13 -07002998 * capability devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL),
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002999 * the maximum exposure time will be greater than 100ms.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003000 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003001 * <p><b>Full capability</b> -
3002 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3003 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08003004 *
Zhijun He28288ca2014-06-25 15:49:13 -07003005 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08003006 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003007 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003008 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003009 @NonNull
Ruben Brunk57493682014-05-27 18:58:08 -07003010 public static final Key<android.util.Range<Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE =
3011 new Key<android.util.Range<Long>>("android.sensor.info.exposureTimeRange", new TypeReference<android.util.Range<Long>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003012
3013 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003014 * <p>The maximum possible frame duration (minimum frame rate) for
3015 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} that is supported this camera device.</p>
3016 * <p>Attempting to use frame durations beyond the maximum will result in the frame
3017 * duration being clipped to the maximum. See that control for a full definition of frame
3018 * durations.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003019 * <p>Refer to {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
3020 * for the minimum frame duration values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003021 * <p><b>Units</b>: Nanoseconds</p>
3022 * <p><b>Range of valid values:</b><br>
3023 * For FULL capability devices
3024 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL), at least 100ms.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003025 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003026 * <p><b>Full capability</b> -
3027 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3028 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08003029 *
Zhijun He28288ca2014-06-25 15:49:13 -07003030 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08003031 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003032 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003033 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003034 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003035 public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION =
3036 new Key<Long>("android.sensor.info.maxFrameDuration", long.class);
3037
3038 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003039 * <p>The physical dimensions of the full pixel
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003040 * array.</p>
3041 * <p>This is the physical size of the sensor pixel
3042 * array defined by {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003043 * <p><b>Units</b>: Millimeters</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003044 * <p>This key is available on all devices.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003045 *
3046 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003047 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003048 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003049 @NonNull
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003050 public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE =
3051 new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003052
3053 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003054 * <p>Dimensions of the full pixel array, possibly
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08003055 * including black calibration pixels.</p>
Ruben Brunk224eb3a2015-06-15 17:32:06 -07003056 * <p>The pixel count of the full pixel array of the image sensor, which covers
3057 * {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area. This represents the full pixel dimensions of
3058 * the raw buffers produced by this sensor.</p>
3059 * <p>If a camera device supports raw sensor formats, either this or
3060 * {@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 -08003061 * output formats listed in {@link android.hardware.camera2.params.StreamConfigurationMap }
3062 * (this depends on whether or not the image sensor returns buffers containing pixels that
3063 * are not part of the active array region for blacklevel calibration or other purposes).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003064 * <p>Some parts of the full pixel array may not receive light from the scene,
Ruben Brunk224eb3a2015-06-15 17:32:06 -07003065 * or be otherwise inactive. The {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} key
3066 * defines the rectangle of active pixels that will be included in processed image
3067 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003068 * <p><b>Units</b>: Pixels</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003069 * <p>This key is available on all devices.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003070 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003071 * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE
Ruben Brunk224eb3a2015-06-15 17:32:06 -07003072 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08003073 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003074 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003075 @NonNull
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003076 public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE =
3077 new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class);
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08003078
3079 /**
Ruben Brunke60e29552014-02-18 10:44:17 -08003080 * <p>Maximum raw value output by sensor.</p>
3081 * <p>This specifies the fully-saturated encoding level for the raw
3082 * sample values from the sensor. This is typically caused by the
3083 * sensor becoming highly non-linear or clipping. The minimum for
3084 * each channel is specified by the offset in the
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003085 * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} key.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08003086 * <p>The white level is typically determined either by sensor bit depth
Ruben Brunke89b1202014-03-24 17:10:35 -07003087 * (8-14 bits is expected), or by the point where the sensor response
Ruben Brunke60e29552014-02-18 10:44:17 -08003088 * becomes too non-linear to be useful. The default value for this is
3089 * maximum representable value for a 16-bit raw sample (2^16 - 1).</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08003090 * <p>The white level values of captured images may vary for different
3091 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
3092 * represents a coarse approximation for such case. It is recommended
3093 * to use {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} for captures when supported
3094 * by the camera device, which provides more accurate white level values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003095 * <p><b>Range of valid values:</b><br>
3096 * &gt; 255 (8-bit output)</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003097 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08003098 *
3099 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
Zhijun Hecd950b62015-11-12 17:47:52 -08003100 * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
3101 * @see CaptureRequest#SENSOR_SENSITIVITY
Ruben Brunke60e29552014-02-18 10:44:17 -08003102 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003103 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003104 @NonNull
Ruben Brunke60e29552014-02-18 10:44:17 -08003105 public static final Key<Integer> SENSOR_INFO_WHITE_LEVEL =
3106 new Key<Integer>("android.sensor.info.whiteLevel", int.class);
3107
3108 /**
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003109 * <p>The time base source for sensor capture start timestamps.</p>
3110 * <p>The timestamps provided for captures are always in nanoseconds and monotonic, but
3111 * may not based on a time source that can be compared to other system time sources.</p>
3112 * <p>This characteristic defines the source for the timestamps, and therefore whether they
3113 * can be compared against other system time sources/timestamps.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003114 * <p><b>Possible values:</b>
3115 * <ul>
3116 * <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN UNKNOWN}</li>
3117 * <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME REALTIME}</li>
3118 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003119 * <p>This key is available on all devices.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003120 * @see #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN
3121 * @see #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME
Zhijun He45fa43a12014-06-13 18:29:37 -07003122 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003123 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003124 @NonNull
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003125 public static final Key<Integer> SENSOR_INFO_TIMESTAMP_SOURCE =
3126 new Key<Integer>("android.sensor.info.timestampSource", int.class);
Zhijun He45fa43a12014-06-13 18:29:37 -07003127
3128 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003129 * <p>Whether the RAW images output from this camera device are subject to
3130 * lens shading correction.</p>
3131 * <p>If TRUE, all images produced by the camera device in the RAW image formats will
3132 * have lens shading correction already applied to it. If FALSE, the images will
3133 * not be adjusted for lens shading correction.
3134 * See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image formats.</p>
3135 * <p>This key will be <code>null</code> for all devices do not report this information.
3136 * Devices with RAW capability will always report this information in this key.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003137 * <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 -08003138 *
3139 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
3140 */
3141 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003142 @NonNull
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003143 public static final Key<Boolean> SENSOR_INFO_LENS_SHADING_APPLIED =
3144 new Key<Boolean>("android.sensor.info.lensShadingApplied", boolean.class);
3145
3146 /**
Ruben Brunk1b02df42015-07-01 12:53:45 -07003147 * <p>The area of the image sensor which corresponds to active pixels prior to the
3148 * application of any geometric distortion correction.</p>
3149 * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
3150 * the region that actually receives light from the scene) before any geometric correction
3151 * has been applied, and should be treated as the active region rectangle for any of the
3152 * raw formats. All metadata associated with raw processing (e.g. the lens shading
3153 * correction map, and radial distortion fields) treats the top, left of this rectangle as
3154 * the origin, (0,0).</p>
3155 * <p>The size of this region determines the maximum field of view and the maximum number of
3156 * pixels that an image from this sensor can contain, prior to the application of
3157 * geometric distortion correction. The effective maximum pixel dimensions of a
3158 * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}
3159 * field, and the effective maximum field of view for a post-distortion-corrected image
3160 * can be calculated by applying the geometric distortion correction fields to this
3161 * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
3162 * <p>E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the
3163 * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel,
3164 * (x', y'), in the raw pixel array with dimensions give in
3165 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:</p>
3166 * <ol>
3167 * <li>Choose a pixel (x', y') within the active array region of the raw buffer given in
3168 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, otherwise this pixel is considered
3169 * to be outside of the FOV, and will not be shown in the processed output image.</li>
3170 * <li>Apply geometric distortion correction to get the post-distortion pixel coordinate,
3171 * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw
3172 * buffers is defined relative to the top, left of the
3173 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} rectangle.</li>
3174 * <li>If the resulting corrected pixel coordinate is within the region given in
3175 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the
3176 * processed output image buffer is <code>(x_i - activeArray.left, y_i - activeArray.top)</code>,
3177 * when the top, left coordinate of that buffer is treated as (0, 0).</li>
3178 * </ol>
3179 * <p>Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}
3180 * is (100,100), {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is (10, 10, 100, 100),
3181 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion
3182 * correction doesn't change the pixel coordinate, the resulting pixel selected in
3183 * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer
3184 * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5)
3185 * relative to the top,left of post-processed YUV output buffer with dimensions given in
3186 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
3187 * <p>The currently supported fields that correct for geometric distortion are:</p>
3188 * <ol>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003189 * <li>{@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}.</li>
Ruben Brunk1b02df42015-07-01 12:53:45 -07003190 * </ol>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07003191 * <p>If the camera device doesn't support geometric distortion correction, or all of the
3192 * geometric distortion fields are no-ops, this rectangle will be the same as the
3193 * 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 -07003194 * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
3195 * the full pixel array, and the size of the full pixel array is given by
3196 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
3197 * <p>The pre-correction active array may be smaller than the full pixel array, since the
3198 * full array may include black calibration pixels or other inactive regions.</p>
3199 * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
3200 * <p>This key is available on all devices.</p>
3201 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07003202 * @see CameraCharacteristics#LENS_DISTORTION
Ruben Brunk1b02df42015-07-01 12:53:45 -07003203 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3204 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3205 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
3206 */
3207 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003208 @NonNull
Ruben Brunk1b02df42015-07-01 12:53:45 -07003209 public static final Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE =
3210 new Key<android.graphics.Rect>("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class);
3211
3212 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07003213 * <p>The standard reference illuminant used as the scene light source when
3214 * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
3215 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
3216 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} matrices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003217 * <p>The values in this key correspond to the values defined for the
Ruben Brunk7c062362014-04-15 23:53:53 -07003218 * EXIF LightSource tag. These illuminants are standard light sources
3219 * that are often used calibrating camera devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003220 * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
Ruben Brunk7c062362014-04-15 23:53:53 -07003221 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
3222 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} will also be present.</p>
3223 * <p>Some devices may choose to provide a second set of calibration
3224 * information for improved quality, including
3225 * {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2} and its corresponding matrices.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003226 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3227 * the camera device has RAW capability.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003228 * <p><b>Possible values:</b>
3229 * <ul>
3230 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT DAYLIGHT}</li>
3231 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT FLUORESCENT}</li>
3232 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN TUNGSTEN}</li>
3233 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLASH FLASH}</li>
3234 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER FINE_WEATHER}</li>
3235 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER CLOUDY_WEATHER}</li>
3236 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_SHADE SHADE}</li>
3237 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT DAYLIGHT_FLUORESCENT}</li>
3238 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT DAY_WHITE_FLUORESCENT}</li>
3239 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT COOL_WHITE_FLUORESCENT}</li>
3240 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT WHITE_FLUORESCENT}</li>
3241 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A STANDARD_A}</li>
3242 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B STANDARD_B}</li>
3243 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C STANDARD_C}</li>
3244 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D55 D55}</li>
3245 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D65 D65}</li>
3246 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D75 D75}</li>
3247 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D50 D50}</li>
3248 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN ISO_STUDIO_TUNGSTEN}</li>
3249 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003250 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003251 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003252 *
3253 * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1
3254 * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM1
3255 * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX1
3256 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3257 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT
3258 * @see #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT
3259 * @see #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN
3260 * @see #SENSOR_REFERENCE_ILLUMINANT1_FLASH
3261 * @see #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER
3262 * @see #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER
3263 * @see #SENSOR_REFERENCE_ILLUMINANT1_SHADE
3264 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT
3265 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT
3266 * @see #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT
3267 * @see #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT
3268 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A
3269 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B
3270 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C
3271 * @see #SENSOR_REFERENCE_ILLUMINANT1_D55
3272 * @see #SENSOR_REFERENCE_ILLUMINANT1_D65
3273 * @see #SENSOR_REFERENCE_ILLUMINANT1_D75
3274 * @see #SENSOR_REFERENCE_ILLUMINANT1_D50
3275 * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN
3276 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003277 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003278 @NonNull
Ruben Brunk7c062362014-04-15 23:53:53 -07003279 public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 =
3280 new Key<Integer>("android.sensor.referenceIlluminant1", int.class);
3281
3282 /**
3283 * <p>The standard reference illuminant used as the scene light source when
3284 * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
3285 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
3286 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} matrices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003287 * <p>See {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1} for more details.</p>
3288 * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
Ruben Brunk7c062362014-04-15 23:53:53 -07003289 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
3290 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} will also be present.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003291 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3292 * the camera device has RAW capability.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003293 * <p><b>Range of valid values:</b><br>
3294 * Any value listed in {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003295 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003296 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003297 *
3298 * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2
3299 * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM2
3300 * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2
3301 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3302 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003303 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003304 @NonNull
Ruben Brunk7c062362014-04-15 23:53:53 -07003305 public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 =
3306 new Key<Byte>("android.sensor.referenceIlluminant2", byte.class);
3307
3308 /**
3309 * <p>A per-device calibration transform matrix that maps from the
3310 * reference sensor colorspace to the actual device sensor colorspace.</p>
3311 * <p>This matrix is used to correct for per-device variations in the
3312 * sensor colorspace, and is used for processing raw buffer data.</p>
3313 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3314 * contains a per-device calibration transform that maps colors
3315 * from reference sensor color space (i.e. the "golden module"
3316 * colorspace) into this camera device's native sensor color
3317 * space under the first reference illuminant
3318 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003319 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3320 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003321 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003322 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003323 *
3324 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3325 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003326 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003327 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003328 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1 =
3329 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003330
3331 /**
3332 * <p>A per-device calibration transform matrix that maps from the
3333 * reference sensor colorspace to the actual device sensor colorspace
3334 * (this is the colorspace of the raw buffer data).</p>
3335 * <p>This matrix is used to correct for per-device variations in the
3336 * sensor colorspace, and is used for processing raw buffer data.</p>
3337 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3338 * contains a per-device calibration transform that maps colors
3339 * from reference sensor color space (i.e. the "golden module"
3340 * colorspace) into this camera device's native sensor color
3341 * space under the second reference illuminant
3342 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
3343 * <p>This matrix will only be present if the second reference
3344 * illuminant is present.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003345 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3346 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003347 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003348 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003349 *
3350 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3351 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003352 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003353 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003354 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2 =
3355 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003356
3357 /**
3358 * <p>A matrix that transforms color values from CIE XYZ color space to
3359 * reference sensor color space.</p>
3360 * <p>This matrix is used to convert from the standard CIE XYZ color
3361 * space to the reference sensor colorspace, and is used when processing
3362 * raw buffer data.</p>
3363 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3364 * contains a color transform matrix that maps colors from the CIE
3365 * XYZ color space to the reference sensor color space (i.e. the
3366 * "golden module" colorspace) under the first reference illuminant
3367 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
3368 * <p>The white points chosen in both the reference sensor color space
3369 * and the CIE XYZ colorspace when calculating this transform will
3370 * match the standard white point for the first reference illuminant
3371 * (i.e. no chromatic adaptation will be applied by this transform).</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003372 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3373 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003374 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003375 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003376 *
3377 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3378 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003379 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003380 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003381 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1 =
3382 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003383
3384 /**
3385 * <p>A matrix that transforms color values from CIE XYZ color space to
3386 * reference sensor color space.</p>
3387 * <p>This matrix is used to convert from the standard CIE XYZ color
3388 * space to the reference sensor colorspace, and is used when processing
3389 * raw buffer data.</p>
3390 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3391 * contains a color transform matrix that maps colors from the CIE
3392 * XYZ color space to the reference sensor color space (i.e. the
3393 * "golden module" colorspace) under the second reference illuminant
3394 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
3395 * <p>The white points chosen in both the reference sensor color space
3396 * and the CIE XYZ colorspace when calculating this transform will
3397 * match the standard white point for the second reference illuminant
3398 * (i.e. no chromatic adaptation will be applied by this transform).</p>
3399 * <p>This matrix will only be present if the second reference
3400 * illuminant is present.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003401 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3402 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003403 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003404 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003405 *
3406 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3407 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003408 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003409 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003410 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2 =
3411 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003412
3413 /**
3414 * <p>A matrix that transforms white balanced camera colors from the reference
3415 * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
3416 * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
3417 * is used when processing raw buffer data.</p>
3418 * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
3419 * a color transform matrix that maps white balanced colors from the
3420 * reference sensor color space to the CIE XYZ color space with a D50 white
3421 * point.</p>
3422 * <p>Under the first reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1})
3423 * this matrix is chosen so that the standard white point for this reference
3424 * illuminant in the reference sensor colorspace is mapped to D50 in the
3425 * CIE XYZ colorspace.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003426 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3427 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003428 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003429 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003430 *
3431 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3432 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003433 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003434 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003435 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1 =
3436 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003437
3438 /**
3439 * <p>A matrix that transforms white balanced camera colors from the reference
3440 * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
3441 * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
3442 * is used when processing raw buffer data.</p>
3443 * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
3444 * a color transform matrix that maps white balanced colors from the
3445 * reference sensor color space to the CIE XYZ color space with a D50 white
3446 * point.</p>
3447 * <p>Under the second reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2})
3448 * this matrix is chosen so that the standard white point for this reference
3449 * illuminant in the reference sensor colorspace is mapped to D50 in the
3450 * CIE XYZ colorspace.</p>
3451 * <p>This matrix will only be present if the second reference
3452 * illuminant is present.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003453 * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3454 * the camera device has RAW capability.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003455 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peeva7fea4c2018-09-03 16:37:06 +01003456 * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
Ruben Brunk7c062362014-04-15 23:53:53 -07003457 *
3458 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3459 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003460 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003461 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003462 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2 =
3463 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07003464
3465 /**
Ruben Brunk67b47022014-02-07 15:26:29 -08003466 * <p>A fixed black level offset for each of the color filter arrangement
3467 * (CFA) mosaic channels.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003468 * <p>This key specifies the zero light value for each of the CFA mosaic
Ruben Brunke60e29552014-02-18 10:44:17 -08003469 * channels in the camera sensor. The maximal value output by the
3470 * 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 -07003471 * <p>The values are given in the same order as channels listed for the CFA
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003472 * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
Ruben Brunk52842e72014-06-05 13:16:45 -07003473 * nth value given corresponds to the black level offset for the nth
3474 * color channel listed in the CFA.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08003475 * <p>The black level values of captured images may vary for different
3476 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
3477 * represents a coarse approximation for such case. It is recommended to
3478 * use {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} or use pixels from
3479 * {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} directly for captures when
3480 * supported by the camera device, which provides more accurate black
3481 * level values. For raw capture in particular, it is recommended to use
3482 * pixels from {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} to calculate black
3483 * level values for each frame.</p>
Shuzhen Wanga8d36032018-10-15 12:01:53 -07003484 * <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 -07003485 * <p><b>Range of valid values:</b><br>
3486 * &gt;= 0 for each.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003487 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08003488 *
Zhijun Hecd950b62015-11-12 17:47:52 -08003489 * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
Ruben Brunk52842e72014-06-05 13:16:45 -07003490 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
Ruben Brunke60e29552014-02-18 10:44:17 -08003491 * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
Zhijun Hecd950b62015-11-12 17:47:52 -08003492 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3493 * @see CaptureRequest#SENSOR_SENSITIVITY
Ruben Brunk67b47022014-02-07 15:26:29 -08003494 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003495 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003496 @NonNull
Ruben Brunk52842e72014-06-05 13:16:45 -07003497 public static final Key<android.hardware.camera2.params.BlackLevelPattern> SENSOR_BLACK_LEVEL_PATTERN =
3498 new Key<android.hardware.camera2.params.BlackLevelPattern>("android.sensor.blackLevelPattern", android.hardware.camera2.params.BlackLevelPattern.class);
Ruben Brunk67b47022014-02-07 15:26:29 -08003499
3500 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003501 * <p>Maximum sensitivity that is implemented
Zhijun He153ac102014-02-03 12:25:12 -08003502 * purely through analog gain.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003503 * <p>For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003504 * equal to this, all applied gain must be analog. For
Zhijun He153ac102014-02-03 12:25:12 -08003505 * values above this, the gain applied can be a mix of analog and
3506 * digital.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003507 * <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 -08003508 * <p><b>Full capability</b> -
3509 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3510 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Alex Raye83c4eb2013-10-02 17:14:36 -07003511 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003512 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08003513 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003514 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003515 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003516 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003517 public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY =
3518 new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class);
3519
3520 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003521 * <p>Clockwise angle through which the output image needs to be rotated to be
3522 * upright on the device screen in its native orientation.</p>
3523 * <p>Also defines the direction of rolling shutter readout, which is from top to bottom in
3524 * the sensor's coordinate system.</p>
3525 * <p><b>Units</b>: Degrees of clockwise rotation; always a multiple of
3526 * 90</p>
3527 * <p><b>Range of valid values:</b><br>
3528 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003529 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003530 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003531 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003532 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003533 public static final Key<Integer> SENSOR_ORIENTATION =
3534 new Key<Integer>("android.sensor.orientation", int.class);
3535
3536 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003537 * <p>List of sensor test pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}
3538 * supported by this camera device.</p>
3539 * <p>Defaults to OFF, and always includes OFF if defined.</p>
3540 * <p><b>Range of valid values:</b><br>
3541 * Any value listed in {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003542 * <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 -08003543 *
3544 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
Igor Murashkinc127f052014-01-17 18:06:02 -08003545 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003546 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003547 @NonNull
Zhijun Hea4866242014-03-27 23:51:34 -07003548 public static final Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES =
3549 new Key<int[]>("android.sensor.availableTestPatternModes", int[].class);
Igor Murashkinc127f052014-01-17 18:06:02 -08003550
3551 /**
Zhijun Hecd950b62015-11-12 17:47:52 -08003552 * <p>List of disjoint rectangles indicating the sensor
3553 * optically shielded black pixel regions.</p>
3554 * <p>In most camera sensors, the active array is surrounded by some
3555 * optically shielded pixel areas. By blocking light, these pixels
3556 * provides a reliable black reference for black level compensation
3557 * in active array region.</p>
3558 * <p>This key provides a list of disjoint rectangles specifying the
3559 * regions of optically shielded (with metal shield) black pixel
3560 * regions if the camera device is capable of reading out these black
3561 * pixels in the output raw images. In comparison to the fixed black
3562 * level values reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern}, this key
3563 * may provide a more accurate way for the application to calculate
3564 * black level of each captured raw images.</p>
3565 * <p>When this key is reported, the {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} and
3566 * {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} will also be reported.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003567 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08003568 *
3569 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
3570 * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
3571 * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
3572 */
3573 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003574 @NonNull
Zhijun Hecd950b62015-11-12 17:47:52 -08003575 public static final Key<android.graphics.Rect[]> SENSOR_OPTICAL_BLACK_REGIONS =
3576 new Key<android.graphics.Rect[]>("android.sensor.opticalBlackRegions", android.graphics.Rect[].class);
3577
3578 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003579 * <p>List of lens shading modes for {@link CaptureRequest#SHADING_MODE android.shading.mode} that are supported by this camera device.</p>
3580 * <p>This list contains lens shading modes that can be set for the camera device.
3581 * Camera devices that support the MANUAL_POST_PROCESSING capability will always
3582 * list OFF and FAST mode. This includes all FULL level devices.
3583 * LEGACY devices will always only support FAST mode.</p>
3584 * <p><b>Range of valid values:</b><br>
3585 * Any value listed in {@link CaptureRequest#SHADING_MODE android.shading.mode}</p>
3586 * <p>This key is available on all devices.</p>
3587 *
3588 * @see CaptureRequest#SHADING_MODE
3589 */
3590 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003591 @NonNull
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003592 public static final Key<int[]> SHADING_AVAILABLE_MODES =
3593 new Key<int[]>("android.shading.availableModes", int[].class);
3594
3595 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003596 * <p>List of face detection modes for {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} that are
3597 * supported by this camera device.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003598 * <p>OFF is always supported.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003599 * <p><b>Range of valid values:</b><br>
3600 * Any value listed in {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003601 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003602 *
3603 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003604 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003605 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003606 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003607 public static final Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES =
3608 new Key<int[]>("android.statistics.info.availableFaceDetectModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003609
3610 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003611 * <p>The maximum number of simultaneously detectable
3612 * faces.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003613 * <p><b>Range of valid values:</b><br>
3614 * 0 for cameras without available face detection; otherwise:
3615 * <code>&gt;=4</code> for LIMITED or FULL hwlevel devices or
3616 * <code>&gt;0</code> for LEGACY devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003617 * <p>This key is available on all devices.</p>
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> STATISTICS_INFO_MAX_FACE_COUNT =
3622 new Key<Integer>("android.statistics.info.maxFaceCount", int.class);
3623
3624 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003625 * <p>List of hot pixel map output modes for {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode} that are
3626 * supported by this camera device.</p>
3627 * <p>If no hotpixel map output is available for this camera device, this will contain only
3628 * <code>false</code>.</p>
3629 * <p>ON is always supported on devices with the RAW capability.</p>
3630 * <p><b>Range of valid values:</b><br>
3631 * Any value listed in {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003632 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003633 *
3634 * @see CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE
3635 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003636 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003637 @NonNull
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003638 public static final Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES =
3639 new Key<boolean[]>("android.statistics.info.availableHotPixelMapModes", boolean[].class);
3640
3641 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003642 * <p>List of lens shading map output modes for {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} that
3643 * are supported by this camera device.</p>
3644 * <p>If no lens shading map output is available for this camera device, this key will
3645 * contain only OFF.</p>
3646 * <p>ON is always supported on devices with the RAW capability.
3647 * LEGACY mode devices will always only support OFF.</p>
3648 * <p><b>Range of valid values:</b><br>
3649 * Any value listed in {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003650 * <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 -08003651 *
3652 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3653 */
3654 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003655 @NonNull
Yin-Chia Yeh656931d2015-05-22 16:37:27 -07003656 public static final Key<int[]> STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES =
3657 new Key<int[]>("android.statistics.info.availableLensShadingMapModes", int[].class);
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003658
3659 /**
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003660 * <p>List of OIS data output modes for {@link CaptureRequest#STATISTICS_OIS_DATA_MODE android.statistics.oisDataMode} that
3661 * are supported by this camera device.</p>
3662 * <p>If no OIS data output is available for this camera device, this key will
3663 * contain only OFF.</p>
3664 * <p><b>Range of valid values:</b><br>
3665 * Any value listed in {@link CaptureRequest#STATISTICS_OIS_DATA_MODE android.statistics.oisDataMode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003666 * <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 -08003667 *
3668 * @see CaptureRequest#STATISTICS_OIS_DATA_MODE
3669 */
3670 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003671 @NonNull
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003672 public static final Key<int[]> STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES =
3673 new Key<int[]>("android.statistics.info.availableOisDataModes", int[].class);
3674
3675 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003676 * <p>Maximum number of supported points in the
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003677 * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003678 * <p>If the actual number of points provided by the application (in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}*) is
3679 * less than this maximum, the camera device will resample the curve to its internal
3680 * representation, using linear interpolation.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08003681 * <p>The output curves in the result metadata may have a different number
3682 * of points than the input curves, and will represent the actual
3683 * hardware curves used as closely as possible when linearly interpolated.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003684 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003685 * <p><b>Full capability</b> -
3686 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3687 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkine0060932014-01-17 17:24:11 -08003688 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003689 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003690 * @see CaptureRequest#TONEMAP_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003691 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003692 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003693 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003694 public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS =
3695 new Key<Integer>("android.tonemap.maxCurvePoints", int.class);
3696
3697 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003698 * <p>List of tonemapping modes for {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} that are supported by this camera
3699 * device.</p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003700 * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always contain
3701 * at least one of below mode combinations:</p>
3702 * <ul>
Yin-Chia Yehfba08dd2015-04-02 14:05:14 -07003703 * <li>CONTRAST_CURVE, FAST and HIGH_QUALITY</li>
3704 * <li>GAMMA_VALUE, PRESET_CURVE, FAST and HIGH_QUALITY</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003705 * </ul>
3706 * <p>This includes all FULL level devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003707 * <p><b>Range of valid values:</b><br>
3708 * Any value listed in {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003709 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003710 * <p><b>Full capability</b> -
3711 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3712 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003713 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003714 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003715 * @see CaptureRequest#TONEMAP_MODE
3716 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003717 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003718 @NonNull
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003719 public static final Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES =
3720 new Key<int[]>("android.tonemap.availableToneMapModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003721
3722 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003723 * <p>A list of camera LEDs that are available on this system.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003724 * <p><b>Possible values:</b>
3725 * <ul>
3726 * <li>{@link #LED_AVAILABLE_LEDS_TRANSMIT TRANSMIT}</li>
3727 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003728 * <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 -07003729 * @see #LED_AVAILABLE_LEDS_TRANSMIT
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003730 * @hide
3731 */
3732 public static final Key<int[]> LED_AVAILABLE_LEDS =
3733 new Key<int[]>("android.led.availableLeds", int[].class);
3734
3735 /**
Igor Murashkine46c0da2014-02-07 18:34:37 -08003736 * <p>Generally classifies the overall set of the camera device functionality.</p>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003737 * <p>The supported hardware level is a high-level description of the camera device's
3738 * capabilities, summarizing several capabilities into one field. Each level adds additional
3739 * features to the previous one, and is always a strict superset of the previous level.
3740 * The ordering is <code>LEGACY &lt; LIMITED &lt; FULL &lt; LEVEL_3</code>.</p>
3741 * <p>Starting from <code>LEVEL_3</code>, the level enumerations are guaranteed to be in increasing
3742 * numerical value as well. To check if a given device is at least at a given hardware level,
3743 * the following code snippet can be used:</p>
3744 * <pre><code>// Returns true if the device supports the required hardware level, or better.
3745 * boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) {
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003746 * final int[] sortedHwLevels = {
3747 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY,
3748 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL,
3749 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
3750 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL,
3751 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_3
3752 * };
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003753 * int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003754 * if (requiredLevel == deviceLevel) {
3755 * return true;
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003756 * }
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003757 *
3758 * for (int sortedlevel : sortedHwLevels) {
3759 * if (sortedlevel == requiredLevel) {
3760 * return true;
3761 * } else if (sortedlevel == deviceLevel) {
3762 * return false;
3763 * }
3764 * }
3765 * return false; // Should never reach here
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003766 * }
3767 * </code></pre>
3768 * <p>At a high level, the levels are:</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08003769 * <ul>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003770 * <li><code>LEGACY</code> devices operate in a backwards-compatibility mode for older
3771 * Android devices, and have very limited capabilities.</li>
3772 * <li><code>LIMITED</code> devices represent the
3773 * baseline feature set, and may also include additional capabilities that are
3774 * subsets of <code>FULL</code>.</li>
3775 * <li><code>FULL</code> devices additionally support per-frame manual control of sensor, flash, lens and
3776 * post-processing settings, and image capture at a high rate.</li>
3777 * <li><code>LEVEL_3</code> devices additionally support YUV reprocessing and RAW image capture, along
3778 * with additional output stream configurations.</li>
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003779 * <li><code>EXTERNAL</code> devices are similar to <code>LIMITED</code> devices with exceptions like some sensor or
Yin-Chia Yeh428256d2019-01-23 15:27:47 -08003780 * lens information not reported or less stable framerates.</li>
Igor Murashkine46c0da2014-02-07 18:34:37 -08003781 * </ul>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003782 * <p>See the individual level enums for full descriptions of the supported capabilities. The
3783 * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} entry describes the device's capabilities at a
3784 * finer-grain level, if needed. In addition, many controls have their available settings or
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003785 * ranges defined in individual entries from {@link android.hardware.camera2.CameraCharacteristics }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003786 * <p>Some features are not part of any particular hardware level or capability and must be
3787 * queried separately. These include:</p>
3788 * <ul>
3789 * <li>Calibrated timestamps ({@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME)</li>
3790 * <li>Precision lens control ({@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} <code>==</code> CALIBRATED)</li>
3791 * <li>Face detection ({@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes})</li>
3792 * <li>Optical or electrical image stabilization
3793 * ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization},
3794 * {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes})</li>
3795 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003796 * <p><b>Possible values:</b>
3797 * <ul>
3798 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED}</li>
3799 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}</li>
3800 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}</li>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003801 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_3 3}</li>
Yin-Chia Yeh43cea5a2018-01-19 11:38:12 -08003802 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL EXTERNAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003803 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003804 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08003805 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003806 * @see CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES
3807 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
3808 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Igor Murashkine46c0da2014-02-07 18:34:37 -08003809 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003810 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
3811 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003812 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
3813 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
Ruben Brunk4a61a862014-07-01 16:00:26 -07003814 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003815 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_3
Yin-Chia Yeh43cea5a2018-01-19 11:38:12 -08003816 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003817 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003818 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003819 @NonNull
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003820 public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
3821 new Key<Integer>("android.info.supportedHardwareLevel", int.class);
3822
Igor Murashkin3865a842014-01-17 18:18:39 -08003823 /**
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08003824 * <p>A short string for manufacturer version information about the camera device, such as
3825 * ISP hardware, sensors, etc.</p>
3826 * <p>This can be used in {@link android.media.ExifInterface#TAG_IMAGE_DESCRIPTION TAG_IMAGE_DESCRIPTION}
3827 * in jpeg EXIF. This key may be absent if no version information is available on the
3828 * device.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003829 * <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 -08003830 */
3831 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003832 @NonNull
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08003833 public static final Key<String> INFO_VERSION =
3834 new Key<String>("android.info.version", String.class);
3835
3836 /**
Igor Murashkin3865a842014-01-17 18:18:39 -08003837 * <p>The maximum number of frames that can occur after a request
3838 * (different than the previous) has been submitted, and before the
Chien-Yu Chen161a76c2015-06-26 11:23:55 -07003839 * result's state becomes synchronized.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003840 * <p>This defines the maximum distance (in number of metadata results),
Chien-Yu Chen161a76c2015-06-26 11:23:55 -07003841 * between the frame number of the request that has new controls to apply
3842 * and the frame number of the result that has all the controls applied.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003843 * <p>In other words this acts as an upper boundary for how many frames
3844 * must occur before the camera device knows for a fact that the new
3845 * submitted camera settings have been applied in outgoing frames.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003846 * <p><b>Units</b>: Frame counts</p>
3847 * <p><b>Possible values:</b>
3848 * <ul>
3849 * <li>{@link #SYNC_MAX_LATENCY_PER_FRAME_CONTROL PER_FRAME_CONTROL}</li>
3850 * <li>{@link #SYNC_MAX_LATENCY_UNKNOWN UNKNOWN}</li>
3851 * </ul></p>
3852 * <p><b>Available values for this device:</b><br>
3853 * A positive value, PER_FRAME_CONTROL, or UNKNOWN.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003854 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003855 * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL
3856 * @see #SYNC_MAX_LATENCY_UNKNOWN
3857 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003858 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003859 @NonNull
Igor Murashkin3865a842014-01-17 18:18:39 -08003860 public static final Key<Integer> SYNC_MAX_LATENCY =
3861 new Key<Integer>("android.sync.maxLatency", int.class);
3862
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003863 /**
Zhijun He513f7c32015-04-24 18:23:54 -07003864 * <p>The maximal camera capture pipeline stall (in unit of frame count) introduced by a
3865 * reprocess capture request.</p>
3866 * <p>The key describes the maximal interference that one reprocess (input) request
3867 * can introduce to the camera simultaneous streaming of regular (output) capture
3868 * requests, including repeating requests.</p>
3869 * <p>When a reprocessing capture request is submitted while a camera output repeating request
3870 * (e.g. preview) is being served by the camera device, it may preempt the camera capture
3871 * pipeline for at least one frame duration so that the camera device is unable to process
3872 * the following capture request in time for the next sensor start of exposure boundary.
3873 * When this happens, the application may observe a capture time gap (longer than one frame
3874 * duration) between adjacent capture output frames, which usually exhibits as preview
3875 * glitch if the repeating request output targets include a preview surface. This key gives
3876 * the worst-case number of frame stall introduced by one reprocess request with any kind of
3877 * formats/sizes combination.</p>
3878 * <p>If this key reports 0, it means a reprocess request doesn't introduce any glitch to the
3879 * ongoing camera repeating request outputs, as if this reprocess request is never issued.</p>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07003880 * <p>This key is supported if the camera device supports PRIVATE or YUV reprocessing (
3881 * i.e. {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains PRIVATE_REPROCESSING or
Zhijun He513f7c32015-04-24 18:23:54 -07003882 * YUV_REPROCESSING).</p>
3883 * <p><b>Units</b>: Number of frames.</p>
3884 * <p><b>Range of valid values:</b><br>
3885 * &lt;= 4</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003886 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07003887 * <p><b>Limited capability</b> -
3888 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3889 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3890 *
3891 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3892 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3893 */
3894 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003895 @NonNull
Zhijun He513f7c32015-04-24 18:23:54 -07003896 public static final Key<Integer> REPROCESS_MAX_CAPTURE_STALL =
3897 new Key<Integer>("android.reprocess.maxCaptureStall", int.class);
3898
3899 /**
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003900 * <p>The available depth dataspace stream
3901 * configurations that this camera device supports
3902 * (i.e. format, width, height, output/input stream).</p>
3903 * <p>These are output stream configurations for use with
3904 * dataSpace HAL_DATASPACE_DEPTH. The configurations are
3905 * listed as <code>(format, width, height, input?)</code> tuples.</p>
3906 * <p>Only devices that support depth output for at least
3907 * the HAL_PIXEL_FORMAT_Y16 dense depth map may include
3908 * this entry.</p>
3909 * <p>A device that also supports the HAL_PIXEL_FORMAT_BLOB
3910 * sparse depth point cloud must report a single entry for
3911 * the format in this list as <code>(HAL_PIXEL_FORMAT_BLOB,
3912 * android.depth.maxDepthSamples, 1, OUTPUT)</code> in addition to
3913 * the entries for HAL_PIXEL_FORMAT_Y16.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003914 * <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 -08003915 * <p><b>Limited capability</b> -
3916 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3917 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3918 *
3919 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3920 * @hide
3921 */
3922 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS =
3923 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
3924
3925 /**
3926 * <p>This lists the minimum frame duration for each
3927 * format/size combination for depth output formats.</p>
3928 * <p>This should correspond to the frame duration when only that
3929 * stream is active, with all processing (typically in android.*.mode)
3930 * set to either OFF or FAST.</p>
3931 * <p>When multiple streams are used in a request, the minimum frame
3932 * duration will be max(individual stream min durations).</p>
3933 * <p>The minimum frame duration of a stream (of a particular format, size)
3934 * is the same regardless of whether the stream is input or output.</p>
3935 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
3936 * android.scaler.availableStallDurations for more details about
3937 * calculating the max frame rate.</p>
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003938 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003939 * <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 -08003940 * <p><b>Limited capability</b> -
3941 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3942 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3943 *
3944 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3945 * @see CaptureRequest#SENSOR_FRAME_DURATION
3946 * @hide
3947 */
3948 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS =
3949 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3950
3951 /**
3952 * <p>This lists the maximum stall duration for each
Zhijun He513f7c32015-04-24 18:23:54 -07003953 * output format/size combination for depth streams.</p>
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003954 * <p>A stall duration is how much extra time would get added
3955 * to the normal minimum frame duration for a repeating request
3956 * that has streams with non-zero stall.</p>
3957 * <p>This functions similarly to
3958 * android.scaler.availableStallDurations for depth
3959 * streams.</p>
3960 * <p>All depth output stream formats may have a nonzero stall
3961 * duration.</p>
3962 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003963 * <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 -08003964 * <p><b>Limited capability</b> -
3965 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3966 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3967 *
3968 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3969 * @hide
3970 */
3971 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS =
3972 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3973
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07003974 /**
3975 * <p>Indicates whether a capture request may target both a
3976 * DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as
3977 * YUV_420_888, JPEG, or RAW) simultaneously.</p>
3978 * <p>If TRUE, including both depth and color outputs in a single
3979 * capture request is not supported. An application must interleave color
3980 * and depth requests. If FALSE, a single request can target both types
3981 * of output.</p>
3982 * <p>Typically, this restriction exists on camera devices that
3983 * need to emit a specific pattern or wavelength of light to
3984 * measure depth values, which causes the color image to be
3985 * corrupted during depth measurement.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003986 * <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 -07003987 * <p><b>Limited capability</b> -
3988 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3989 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3990 *
3991 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3992 */
3993 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08003994 @NonNull
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07003995 public static final Key<Boolean> DEPTH_DEPTH_IS_EXCLUSIVE =
3996 new Key<Boolean>("android.depth.depthIsExclusive", boolean.class);
3997
Shuzhen Wang23d29382017-11-26 17:24:56 -08003998 /**
Emilian Peev2776ca32018-09-18 14:00:39 +01003999 * <p>Recommended depth stream configurations for common client use cases.</p>
4000 * <p>Optional subset of the android.depth.availableDepthStreamConfigurations that
4001 * contains similar tuples listed as
4002 * (i.e. width, height, format, output/input stream, usecase bit field).
4003 * Camera devices will be able to suggest particular depth stream configurations which are
4004 * power and performance efficient for specific use cases. For more information about
4005 * retrieving the suggestions see
4006 * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004007 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev2776ca32018-09-18 14:00:39 +01004008 * @hide
4009 */
4010 public static final Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]> DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS =
4011 new Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]>("android.depth.availableRecommendedDepthStreamConfigurations", android.hardware.camera2.params.RecommendedStreamConfiguration[].class);
4012
4013 /**
Emilian Peev934ffa62019-01-04 17:48:31 +00004014 * <p>The available dynamic depth dataspace stream
4015 * configurations that this camera device supports
4016 * (i.e. format, width, height, output/input stream).</p>
4017 * <p>These are output stream configurations for use with
4018 * dataSpace DYNAMIC_DEPTH. The configurations are
4019 * listed as <code>(format, width, height, input?)</code> tuples.</p>
4020 * <p>Only devices that support depth output for at least
4021 * the HAL_PIXEL_FORMAT_Y16 dense depth map along with
4022 * HAL_PIXEL_FORMAT_BLOB with the same size or size with
4023 * the same aspect ratio can have dynamic depth dataspace
4024 * stream configuration. {@link CameraCharacteristics#DEPTH_DEPTH_IS_EXCLUSIVE android.depth.depthIsExclusive} also
4025 * needs to be set to FALSE.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004026 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev934ffa62019-01-04 17:48:31 +00004027 *
4028 * @see CameraCharacteristics#DEPTH_DEPTH_IS_EXCLUSIVE
4029 * @hide
4030 */
4031 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS =
4032 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDynamicDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
4033
4034 /**
4035 * <p>This lists the minimum frame duration for each
4036 * format/size combination for dynamic depth output streams.</p>
4037 * <p>This should correspond to the frame duration when only that
4038 * stream is active, with all processing (typically in android.*.mode)
4039 * set to either OFF or FAST.</p>
4040 * <p>When multiple streams are used in a request, the minimum frame
4041 * duration will be max(individual stream min durations).</p>
4042 * <p>The minimum frame duration of a stream (of a particular format, size)
4043 * is the same regardless of whether the stream is input or output.</p>
4044 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004045 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev934ffa62019-01-04 17:48:31 +00004046 * @hide
4047 */
4048 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS =
4049 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDynamicDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
4050
4051 /**
4052 * <p>This lists the maximum stall duration for each
4053 * output format/size combination for dynamic depth streams.</p>
4054 * <p>A stall duration is how much extra time would get added
4055 * to the normal minimum frame duration for a repeating request
4056 * that has streams with non-zero stall.</p>
4057 * <p>All dynamic depth output streams may have a nonzero stall
4058 * duration.</p>
4059 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004060 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Emilian Peev934ffa62019-01-04 17:48:31 +00004061 * @hide
4062 */
4063 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS =
4064 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDynamicDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
4065
4066 /**
Shuzhen Wang23d29382017-11-26 17:24:56 -08004067 * <p>String containing the ids of the underlying physical cameras.</p>
Shuzhen Wang61aaa322018-11-19 16:04:57 -08004068 * <p>For a logical camera, this is concatenation of all underlying physical camera IDs.
4069 * The null terminator for physical camera ID must be preserved so that the whole string
4070 * can be tokenized using '\0' to generate list of physical camera IDs.</p>
4071 * <p>For example, if the physical camera IDs of the logical camera are "2" and "3", the
Shuzhen Wang23d29382017-11-26 17:24:56 -08004072 * value of this tag will be ['2', '\0', '3', '\0'].</p>
Shuzhen Wang61aaa322018-11-19 16:04:57 -08004073 * <p>The number of physical camera IDs must be no less than 2.</p>
Shuzhen Wang23d29382017-11-26 17:24:56 -08004074 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004075 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Shuzhen Wang23d29382017-11-26 17:24:56 -08004076 * <p><b>Limited capability</b> -
4077 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4078 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4079 *
4080 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4081 * @hide
4082 */
4083 public static final Key<byte[]> LOGICAL_MULTI_CAMERA_PHYSICAL_IDS =
4084 new Key<byte[]>("android.logicalMultiCamera.physicalIds", byte[].class);
4085
4086 /**
4087 * <p>The accuracy of frame timestamp synchronization between physical cameras</p>
4088 * <p>The accuracy of the frame timestamp synchronization determines the physical cameras'
4089 * ability to start exposure at the same time. If the sensorSyncType is CALIBRATED,
4090 * the physical camera sensors usually run in master-slave mode so that their shutter
4091 * time is synchronized. For APPROXIMATE sensorSyncType, the camera sensors usually run in
4092 * master-master mode, and there could be offset between their start of exposure.</p>
4093 * <p>In both cases, all images generated for a particular capture request still carry the same
4094 * timestamps, so that they can be used to look up the matching frame number and
4095 * onCaptureStarted callback.</p>
Shuzhen Wang2da73f42019-03-12 15:16:06 -07004096 * <p>This tag is only applicable if the logical camera device supports concurrent physical
4097 * streams from different physical cameras.</p>
Shuzhen Wang23d29382017-11-26 17:24:56 -08004098 * <p><b>Possible values:</b>
4099 * <ul>
4100 * <li>{@link #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE APPROXIMATE}</li>
4101 * <li>{@link #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED CALIBRATED}</li>
4102 * </ul></p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004103 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Shuzhen Wang23d29382017-11-26 17:24:56 -08004104 * <p><b>Limited capability</b> -
4105 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4106 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4107 *
4108 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4109 * @see #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE
4110 * @see #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED
4111 */
4112 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004113 @NonNull
Shuzhen Wang23d29382017-11-26 17:24:56 -08004114 public static final Key<Integer> LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE =
4115 new Key<Integer>("android.logicalMultiCamera.sensorSyncType", int.class);
4116
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004117 /**
4118 * <p>List of distortion correction modes for {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} that are
4119 * supported by this camera device.</p>
4120 * <p>No device is required to support this API; such devices will always list only 'OFF'.
4121 * All devices that support this API will list both FAST and HIGH_QUALITY.</p>
4122 * <p><b>Range of valid values:</b><br>
4123 * Any value listed in {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode}</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004124 * <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 -07004125 *
4126 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
4127 */
4128 @PublicKey
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004129 @NonNull
Eino-Ville Talvala41670722018-03-13 19:43:07 -07004130 public static final Key<int[]> DISTORTION_CORRECTION_AVAILABLE_MODES =
4131 new Key<int[]>("android.distortionCorrection.availableModes", int[].class);
4132
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08004133 /**
4134 * <p>The available HEIC (ISO/IEC 23008-12) stream
4135 * configurations that this camera device supports
4136 * (i.e. format, width, height, output/input stream).</p>
4137 * <p>The configurations are listed as <code>(format, width, height, input?)</code> tuples.</p>
4138 * <p>If the camera device supports HEIC image format, it will support identical set of stream
4139 * combinations involving HEIC image format, compared to the combinations involving JPEG
4140 * image format as required by the device's hardware level and capabilities.</p>
4141 * <p>All the static, control, and dynamic metadata tags related to JPEG apply to HEIC formats.
4142 * Configuring JPEG and HEIC streams at the same time is not supported.</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004143 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08004144 * <p><b>Limited capability</b> -
4145 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4146 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4147 *
4148 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4149 * @hide
4150 */
4151 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS =
4152 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.heic.availableHeicStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
4153
4154 /**
4155 * <p>This lists the minimum frame duration for each
4156 * format/size combination for HEIC output formats.</p>
4157 * <p>This should correspond to the frame duration when only that
4158 * stream is active, with all processing (typically in android.*.mode)
4159 * set to either OFF or FAST.</p>
4160 * <p>When multiple streams are used in a request, the minimum frame
4161 * duration will be max(individual stream min durations).</p>
4162 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
4163 * android.scaler.availableStallDurations for more details about
4164 * calculating the max frame rate.</p>
4165 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004166 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08004167 * <p><b>Limited capability</b> -
4168 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4169 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4170 *
4171 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4172 * @see CaptureRequest#SENSOR_FRAME_DURATION
4173 * @hide
4174 */
4175 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS =
4176 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
4177
4178 /**
4179 * <p>This lists the maximum stall duration for each
4180 * output format/size combination for HEIC streams.</p>
4181 * <p>A stall duration is how much extra time would get added
4182 * to the normal minimum frame duration for a repeating request
4183 * that has streams with non-zero stall.</p>
4184 * <p>This functions similarly to
4185 * android.scaler.availableStallDurations for HEIC
4186 * streams.</p>
4187 * <p>All HEIC output stream formats may have a nonzero stall
4188 * duration.</p>
4189 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004190 * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
Shuzhen Wangf655b1c2018-12-28 15:40:36 -08004191 * <p><b>Limited capability</b> -
4192 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4193 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4194 *
4195 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4196 * @hide
4197 */
4198 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_STALL_DURATIONS =
4199 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
4200
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004201 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
4202 * End generated code
4203 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07004204
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004205
4206
Shuzhen Wang1484a21e2019-02-28 10:01:00 -08004207
4208
4209
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08004210}