blob: a787d77bc9642c8a0f3302b197de5ade36e60019 [file] [log] [blame]
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Eino-Ville Talvala2f1a2e42013-07-25 17:12:05 -070017package android.hardware.camera2;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080018
Eino-Ville Talvala8b905572015-05-14 15:43:01 -070019import android.annotation.NonNull;
20import android.annotation.Nullable;
Mathew Inwood5132cc12018-08-08 15:50:55 +010021import android.annotation.UnsupportedAppUsage;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070022import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkin6c76f582014-07-15 17:19:49 -070023import android.hardware.camera2.impl.PublicKey;
24import android.hardware.camera2.impl.SyntheticKey;
Emilian Peev75a55702017-11-07 16:09:59 +000025import android.hardware.camera2.params.SessionConfiguration;
Shuzhen Wang23d29382017-11-26 17:24:56 -080026import android.hardware.camera2.utils.ArrayUtils;
Igor Murashkind6d65152014-05-19 16:31:02 -070027import android.hardware.camera2.utils.TypeReference;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070028import android.util.Rational;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070029
Shuzhen Wang23d29382017-11-26 17:24:56 -080030import java.util.Arrays;
Igor Murashkin7a36a0f2013-09-10 18:13:09 -070031import java.util.Collections;
Shuzhen Wangbde13972018-03-19 10:30:45 -070032import java.util.HashSet;
Igor Murashkin7a36a0f2013-09-10 18:13:09 -070033import java.util.List;
Shuzhen Wangbde13972018-03-19 10:30:45 -070034import java.util.Set;
Igor Murashkin7a36a0f2013-09-10 18:13:09 -070035
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080036/**
37 * <p>The properties describing a
38 * {@link CameraDevice CameraDevice}.</p>
39 *
40 * <p>These properties are fixed for a given CameraDevice, and can be queried
41 * through the {@link CameraManager CameraManager}
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -070042 * interface with {@link CameraManager#getCameraCharacteristics}.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080043 *
Ruben Brunkf967a542014-04-28 16:31:11 -070044 * <p>{@link CameraCharacteristics} objects are immutable.</p>
45 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080046 * @see CameraDevice
47 * @see CameraManager
48 */
Igor Murashkind6d65152014-05-19 16:31:02 -070049public final class CameraCharacteristics extends CameraMetadata<CameraCharacteristics.Key<?>> {
50
51 /**
52 * A {@code Key} is used to do camera characteristics field lookups with
53 * {@link CameraCharacteristics#get}.
54 *
55 * <p>For example, to get the stream configuration map:
56 * <code><pre>
57 * StreamConfigurationMap map = cameraCharacteristics.get(
58 * CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
59 * </pre></code>
60 * </p>
61 *
62 * <p>To enumerate over all possible keys for {@link CameraCharacteristics}, see
63 * {@link CameraCharacteristics#getKeys()}.</p>
64 *
65 * @see CameraCharacteristics#get
66 * @see CameraCharacteristics#getKeys()
67 */
68 public static final class Key<T> {
69 private final CameraMetadataNative.Key<T> mKey;
70
71 /**
72 * Visible for testing and vendor extensions only.
73 *
74 * @hide
75 */
Mathew Inwood5132cc12018-08-08 15:50:55 +010076 @UnsupportedAppUsage
Emilian Peevde62d842017-03-23 19:20:40 +000077 public Key(String name, Class<T> type, long vendorId) {
78 mKey = new CameraMetadataNative.Key<T>(name, type, vendorId);
79 }
80
81 /**
82 * Visible for testing and vendor extensions only.
83 *
84 * @hide
85 */
Justin Yunf01e40c2018-05-18 20:39:45 +090086 public Key(String name, String fallbackName, Class<T> type) {
87 mKey = new CameraMetadataNative.Key<T>(name, fallbackName, type);
88 }
89
90 /**
91 * Visible for testing and vendor extensions only.
92 *
93 * @hide
94 */
Mathew Inwood5132cc12018-08-08 15:50:55 +010095 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -070096 public Key(String name, Class<T> type) {
97 mKey = new CameraMetadataNative.Key<T>(name, type);
98 }
99
100 /**
101 * Visible for testing and vendor extensions only.
102 *
103 * @hide
104 */
Mathew Inwood5132cc12018-08-08 15:50:55 +0100105 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700106 public Key(String name, TypeReference<T> typeReference) {
107 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
108 }
109
110 /**
111 * Return a camelCase, period separated name formatted like:
112 * {@code "root.section[.subsections].name"}.
113 *
114 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
115 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
116 *
117 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
118 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
119 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
120 *
121 * @return String representation of the key name
122 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700123 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700124 public String getName() {
125 return mKey.getName();
126 }
127
128 /**
Emilian Peevde62d842017-03-23 19:20:40 +0000129 * Return vendor tag id.
130 *
131 * @hide
132 */
133 public long getVendorId() {
134 return mKey.getVendorId();
135 }
136
137 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700138 * {@inheritDoc}
139 */
140 @Override
141 public final int hashCode() {
142 return mKey.hashCode();
143 }
144
145 /**
146 * {@inheritDoc}
147 */
148 @SuppressWarnings("unchecked")
149 @Override
150 public final boolean equals(Object o) {
151 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
152 }
153
154 /**
Chien-Yu Chen12a83852015-07-07 12:17:22 -0700155 * Return this {@link Key} as a string representation.
156 *
157 * <p>{@code "CameraCharacteristics.Key(%s)"}, where {@code %s} represents
158 * the name of this key as returned by {@link #getName}.</p>
159 *
160 * @return string representation of {@link Key}
161 */
162 @NonNull
163 @Override
164 public String toString() {
165 return String.format("CameraCharacteristics.Key(%s)", mKey.getName());
166 }
167
168 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700169 * Visible for CameraMetadataNative implementation only; do not use.
170 *
171 * TODO: Make this private or remove it altogether.
172 *
173 * @hide
174 */
Mathew Inwood5132cc12018-08-08 15:50:55 +0100175 @UnsupportedAppUsage
Igor Murashkind6d65152014-05-19 16:31:02 -0700176 public CameraMetadataNative.Key<T> getNativeKey() {
177 return mKey;
178 }
179
180 @SuppressWarnings({
181 "unused", "unchecked"
182 })
183 private Key(CameraMetadataNative.Key<?> nativeKey) {
184 mKey = (CameraMetadataNative.Key<T>) nativeKey;
185 }
186 }
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700187
Mathew Inwood5132cc12018-08-08 15:50:55 +0100188 @UnsupportedAppUsage
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700189 private final CameraMetadataNative mProperties;
Igor Murashkincc542a42014-06-25 11:52:23 -0700190 private List<CameraCharacteristics.Key<?>> mKeys;
Igor Murashkind6d65152014-05-19 16:31:02 -0700191 private List<CaptureRequest.Key<?>> mAvailableRequestKeys;
Emilian Peev75a55702017-11-07 16:09:59 +0000192 private List<CaptureRequest.Key<?>> mAvailableSessionKeys;
Emilian Peev2100ae72018-01-12 16:56:25 +0000193 private List<CaptureRequest.Key<?>> mAvailablePhysicalRequestKeys;
Igor Murashkind6d65152014-05-19 16:31:02 -0700194 private List<CaptureResult.Key<?>> mAvailableResultKeys;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700195
196 /**
197 * Takes ownership of the passed-in properties object
198 * @hide
199 */
Igor Murashkin68f40062013-09-10 12:15:54 -0700200 public CameraCharacteristics(CameraMetadataNative properties) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700201 mProperties = CameraMetadataNative.move(properties);
Emilian Peevde62d842017-03-23 19:20:40 +0000202 setNativeInstance(mProperties);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700203 }
204
Ruben Brunkf967a542014-04-28 16:31:11 -0700205 /**
206 * Returns a copy of the underlying {@link CameraMetadataNative}.
207 * @hide
208 */
209 public CameraMetadataNative getNativeCopy() {
210 return new CameraMetadataNative(mProperties);
211 }
212
Igor Murashkind6d65152014-05-19 16:31:02 -0700213 /**
214 * Get a camera characteristics field value.
215 *
216 * <p>The field definitions can be
217 * found in {@link CameraCharacteristics}.</p>
218 *
219 * <p>Querying the value for the same key more than once will return a value
220 * which is equal to the previous queried value.</p>
221 *
222 * @throws IllegalArgumentException if the key was not valid
223 *
224 * @param key The characteristics field to read.
225 * @return The value of that key, or {@code null} if the field is not set.
226 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700227 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700228 public <T> T get(Key<T> key) {
229 return mProperties.get(key);
230 }
231
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700232 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700233 * {@inheritDoc}
234 * @hide
235 */
236 @SuppressWarnings("unchecked")
237 @Override
238 protected <T> T getProtected(Key<?> key) {
239 return (T) mProperties.get(key);
240 }
241
242 /**
243 * {@inheritDoc}
244 * @hide
245 */
246 @SuppressWarnings("unchecked")
247 @Override
248 protected Class<Key<?>> getKeyClass() {
249 Object thisClass = Key.class;
250 return (Class<Key<?>>)thisClass;
251 }
252
253 /**
254 * {@inheritDoc}
255 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700256 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700257 @Override
258 public List<Key<?>> getKeys() {
Igor Murashkincc542a42014-06-25 11:52:23 -0700259 // List of keys is immutable; cache the results after we calculate them
260 if (mKeys != null) {
261 return mKeys;
262 }
263
264 int[] filterTags = get(REQUEST_AVAILABLE_CHARACTERISTICS_KEYS);
265 if (filterTags == null) {
266 throw new AssertionError("android.request.availableCharacteristicsKeys must be non-null"
267 + " in the characteristics");
268 }
269
270 mKeys = Collections.unmodifiableList(
Emilian Peevde62d842017-03-23 19:20:40 +0000271 getKeys(getClass(), getKeyClass(), this, filterTags));
Igor Murashkincc542a42014-06-25 11:52:23 -0700272 return mKeys;
Igor Murashkind6d65152014-05-19 16:31:02 -0700273 }
274
275 /**
Emilian Peev75a55702017-11-07 16:09:59 +0000276 * <p>Returns a subset of {@link #getAvailableCaptureRequestKeys} keys that the
277 * camera device can pass as part of the capture session initialization.</p>
278 *
279 * <p>This list includes keys that are difficult to apply per-frame and
280 * can result in unexpected delays when modified during the capture session
281 * lifetime. Typical examples include parameters that require a
282 * time-consuming hardware re-configuration or internal camera pipeline
283 * change. For performance reasons we suggest clients to pass their initial
284 * values as part of {@link SessionConfiguration#setSessionParameters}. Once
285 * the camera capture session is enabled it is also recommended to avoid
286 * changing them from their initial values set in
287 * {@link SessionConfiguration#setSessionParameters }.
288 * Control over session parameters can still be exerted in capture requests
289 * but clients should be aware and expect delays during their application.
290 * An example usage scenario could look like this:</p>
291 * <ul>
292 * <li>The camera client starts by quering the session parameter key list via
293 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
294 * <li>Before triggering the capture session create sequence, a capture request
295 * must be built via {@link CameraDevice#createCaptureRequest } using an
296 * appropriate template matching the particular use case.</li>
297 * <li>The client should go over the list of session parameters and check
298 * whether some of the keys listed matches with the parameters that
299 * they intend to modify as part of the first capture request.</li>
300 * <li>If there is no such match, the capture request can be passed
301 * unmodified to {@link SessionConfiguration#setSessionParameters }.</li>
302 * <li>If matches do exist, the client should update the respective values
303 * and pass the request to {@link SessionConfiguration#setSessionParameters }.</li>
304 * <li>After the capture session initialization completes the session parameter
305 * key list can continue to serve as reference when posting or updating
306 * further requests. As mentioned above further changes to session
307 * parameters should ideally be avoided, if updates are necessary
308 * however clients could expect a delay/glitch during the
309 * parameter switch.</li>
310 * </ul>
311 *
312 * <p>The list returned is not modifiable, so any attempts to modify it will throw
313 * a {@code UnsupportedOperationException}.</p>
314 *
315 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
316 *
317 * @return List of keys that can be passed during capture session initialization. In case the
318 * camera device doesn't support such keys the list can be null.
319 */
320 @SuppressWarnings({"unchecked"})
321 public List<CaptureRequest.Key<?>> getAvailableSessionKeys() {
322 if (mAvailableSessionKeys == null) {
323 Object crKey = CaptureRequest.Key.class;
324 Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
325
326 int[] filterTags = get(REQUEST_AVAILABLE_SESSION_KEYS);
327 if (filterTags == null) {
328 return null;
329 }
330 mAvailableSessionKeys =
331 getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags);
332 }
333 return mAvailableSessionKeys;
334 }
335
336 /**
Emilian Peev2100ae72018-01-12 16:56:25 +0000337 * <p>Returns a subset of {@link #getAvailableCaptureRequestKeys} keys that can
koprivadebd4ee2018-09-13 10:59:46 -0700338 * be overridden for physical devices backing a logical multi-camera.</p>
Emilian Peev2100ae72018-01-12 16:56:25 +0000339 *
340 * <p>This is a subset of android.request.availableRequestKeys which contains a list
koprivadebd4ee2018-09-13 10:59:46 -0700341 * of keys that can be overridden using {@link CaptureRequest.Builder#setPhysicalCameraKey }.
Emilian Peev2100ae72018-01-12 16:56:25 +0000342 * The respective value of such request key can be obtained by calling
343 * {@link CaptureRequest.Builder#getPhysicalCameraKey }. Capture requests that contain
344 * individual physical device requests must be built via
345 * {@link android.hardware.camera2.CameraDevice#createCaptureRequest(int, Set)}.
346 * Such extended capture requests can be passed only to
347 * {@link CameraCaptureSession#capture } or {@link CameraCaptureSession#captureBurst } and
348 * not to {@link CameraCaptureSession#setRepeatingRequest } or
349 * {@link CameraCaptureSession#setRepeatingBurst }.</p>
350 *
351 * <p>The list returned is not modifiable, so any attempts to modify it will throw
352 * a {@code UnsupportedOperationException}.</p>
353 *
354 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
355 *
koprivadebd4ee2018-09-13 10:59:46 -0700356 * @return List of keys that can be overridden in individual physical device requests.
Emilian Peev2100ae72018-01-12 16:56:25 +0000357 * In case the camera device doesn't support such keys the list can be null.
358 */
359 @SuppressWarnings({"unchecked"})
360 public List<CaptureRequest.Key<?>> getAvailablePhysicalCameraRequestKeys() {
Emilian Peevf60f4fb2018-02-08 17:40:48 +0000361 if (mAvailablePhysicalRequestKeys == null) {
Emilian Peev2100ae72018-01-12 16:56:25 +0000362 Object crKey = CaptureRequest.Key.class;
363 Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
364
365 int[] filterTags = get(REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS);
366 if (filterTags == null) {
367 return null;
368 }
369 mAvailablePhysicalRequestKeys =
370 getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags);
371 }
372 return mAvailablePhysicalRequestKeys;
373 }
374
375 /**
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700376 * Returns the list of keys supported by this {@link CameraDevice} for querying
377 * with a {@link CaptureRequest}.
378 *
379 * <p>The list returned is not modifiable, so any attempts to modify it will throw
380 * a {@code UnsupportedOperationException}.</p>
381 *
382 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
383 *
Igor Murashkin68f40062013-09-10 12:15:54 -0700384 * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700385 * {@link #getKeys()} instead.</p>
386 *
387 * @return List of keys supported by this CameraDevice for CaptureRequests.
388 */
Igor Murashkind6d65152014-05-19 16:31:02 -0700389 @SuppressWarnings({"unchecked"})
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700390 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700391 public List<CaptureRequest.Key<?>> getAvailableCaptureRequestKeys() {
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700392 if (mAvailableRequestKeys == null) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700393 Object crKey = CaptureRequest.Key.class;
394 Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
395
Igor Murashkincc542a42014-06-25 11:52:23 -0700396 int[] filterTags = get(REQUEST_AVAILABLE_REQUEST_KEYS);
397 if (filterTags == null) {
398 throw new AssertionError("android.request.availableRequestKeys must be non-null "
399 + "in the characteristics");
400 }
401 mAvailableRequestKeys =
402 getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags);
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700403 }
404 return mAvailableRequestKeys;
405 }
406
407 /**
408 * Returns the list of keys supported by this {@link CameraDevice} for querying
409 * with a {@link CaptureResult}.
410 *
411 * <p>The list returned is not modifiable, so any attempts to modify it will throw
412 * a {@code UnsupportedOperationException}.</p>
413 *
414 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
415 *
Igor Murashkin68f40062013-09-10 12:15:54 -0700416 * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700417 * {@link #getKeys()} instead.</p>
418 *
419 * @return List of keys supported by this CameraDevice for CaptureResults.
420 */
Igor Murashkind6d65152014-05-19 16:31:02 -0700421 @SuppressWarnings({"unchecked"})
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700422 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700423 public List<CaptureResult.Key<?>> getAvailableCaptureResultKeys() {
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700424 if (mAvailableResultKeys == null) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700425 Object crKey = CaptureResult.Key.class;
426 Class<CaptureResult.Key<?>> crKeyTyped = (Class<CaptureResult.Key<?>>)crKey;
427
Igor Murashkincc542a42014-06-25 11:52:23 -0700428 int[] filterTags = get(REQUEST_AVAILABLE_RESULT_KEYS);
429 if (filterTags == null) {
430 throw new AssertionError("android.request.availableResultKeys must be non-null "
431 + "in the characteristics");
432 }
433 mAvailableResultKeys = getAvailableKeyList(CaptureResult.class, crKeyTyped, filterTags);
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700434 }
435 return mAvailableResultKeys;
436 }
437
438 /**
439 * Returns the list of keys supported by this {@link CameraDevice} by metadataClass.
440 *
441 * <p>The list returned is not modifiable, so any attempts to modify it will throw
442 * a {@code UnsupportedOperationException}.</p>
443 *
444 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
445 *
446 * @param metadataClass The subclass of CameraMetadata that you want to get the keys for.
Igor Murashkind6d65152014-05-19 16:31:02 -0700447 * @param keyClass The class of the metadata key, e.g. CaptureRequest.Key.class
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700448 *
449 * @return List of keys supported by this CameraDevice for metadataClass.
450 *
451 * @throws IllegalArgumentException if metadataClass is not a subclass of CameraMetadata
452 */
Igor Murashkind6d65152014-05-19 16:31:02 -0700453 private <TKey> List<TKey>
Igor Murashkincc542a42014-06-25 11:52:23 -0700454 getAvailableKeyList(Class<?> metadataClass, Class<TKey> keyClass, int[] filterTags) {
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700455
456 if (metadataClass.equals(CameraMetadata.class)) {
457 throw new AssertionError(
458 "metadataClass must be a strict subclass of CameraMetadata");
459 } else if (!CameraMetadata.class.isAssignableFrom(metadataClass)) {
460 throw new AssertionError(
461 "metadataClass must be a subclass of CameraMetadata");
462 }
463
Emilian Peevde62d842017-03-23 19:20:40 +0000464 List<TKey> staticKeyList = getKeys(
Igor Murashkincc542a42014-06-25 11:52:23 -0700465 metadataClass, keyClass, /*instance*/null, filterTags);
Igor Murashkind6d65152014-05-19 16:31:02 -0700466 return Collections.unmodifiableList(staticKeyList);
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700467 }
468
Shuzhen Wang23d29382017-11-26 17:24:56 -0800469 /**
Shuzhen Wangbde13972018-03-19 10:30:45 -0700470 * Returns the set of physical camera ids that this logical {@link CameraDevice} is
Shuzhen Wang23d29382017-11-26 17:24:56 -0800471 * made up of.
472 *
473 * <p>A camera device is a logical camera if it has
474 * REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA capability. If the camera device
Shuzhen Wangbde13972018-03-19 10:30:45 -0700475 * doesn't have the capability, the return value will be an empty set. </p>
Shuzhen Wang23d29382017-11-26 17:24:56 -0800476 *
Shuzhen Wangbde13972018-03-19 10:30:45 -0700477 * <p>The set returned is not modifiable, so any attempts to modify it will throw
Shuzhen Wang23d29382017-11-26 17:24:56 -0800478 * a {@code UnsupportedOperationException}.</p>
479 *
Shuzhen Wangbde13972018-03-19 10:30:45 -0700480 * @return Set of physical camera ids for this logical camera device.
Shuzhen Wang23d29382017-11-26 17:24:56 -0800481 */
482 @NonNull
Shuzhen Wangbde13972018-03-19 10:30:45 -0700483 public Set<String> getPhysicalCameraIds() {
Shuzhen Wang23d29382017-11-26 17:24:56 -0800484 int[] availableCapabilities = get(REQUEST_AVAILABLE_CAPABILITIES);
485 if (availableCapabilities == null) {
486 throw new AssertionError("android.request.availableCapabilities must be non-null "
487 + "in the characteristics");
488 }
489
490 if (!ArrayUtils.contains(availableCapabilities,
491 REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA)) {
Shuzhen Wangbde13972018-03-19 10:30:45 -0700492 return Collections.emptySet();
Shuzhen Wang23d29382017-11-26 17:24:56 -0800493 }
494 byte[] physicalCamIds = get(LOGICAL_MULTI_CAMERA_PHYSICAL_IDS);
495
496 String physicalCamIdString = null;
497 try {
498 physicalCamIdString = new String(physicalCamIds, "UTF-8");
499 } catch (java.io.UnsupportedEncodingException e) {
500 throw new AssertionError("android.logicalCam.physicalIds must be UTF-8 string");
501 }
Shuzhen Wangbde13972018-03-19 10:30:45 -0700502 String[] physicalCameraIdArray = physicalCamIdString.split("\0");
Shuzhen Wang23d29382017-11-26 17:24:56 -0800503
Shuzhen Wangbde13972018-03-19 10:30:45 -0700504 return Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(physicalCameraIdArray)));
Shuzhen Wang23d29382017-11-26 17:24:56 -0800505 }
506
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700507 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
508 * The key entries below this point are generated from metadata
509 * definitions in /system/media/camera/docs. Do not modify by hand or
510 * modify the comment blocks at the start or end.
511 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800512
513 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700514 * <p>List of aberration correction modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode} that are
515 * supported by this camera device.</p>
516 * <p>This key lists the valid modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}. If no
517 * aberration correction modes are available for a device, this list will solely include
Yin-Chia Yeh941aac02015-01-06 10:32:47 -0800518 * OFF mode. All camera devices will support either OFF or FAST mode.</p>
519 * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always list
520 * OFF mode. This includes all FULL level devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700521 * <p>LEGACY devices will always only support FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700522 * <p><b>Range of valid values:</b><br>
523 * Any value listed in {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700524 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700525 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700526 * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
Zhijun Hea05e59d2014-07-08 18:27:47 -0700527 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700528 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700529 public static final Key<int[]> COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES =
530 new Key<int[]>("android.colorCorrection.availableAberrationModes", int[].class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700531
532 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700533 * <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 -0800534 * supported by this camera device.</p>
535 * <p>Not all of the auto-exposure anti-banding modes may be
536 * supported by a given camera device. This field lists the
537 * valid anti-banding modes that the application may request
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700538 * for this camera device with the
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800539 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} control.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700540 * <p><b>Range of valid values:</b><br>
541 * Any value listed in {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700542 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700543 *
544 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800545 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700546 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700547 public static final Key<int[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES =
548 new Key<int[]>("android.control.aeAvailableAntibandingModes", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800549
550 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700551 * <p>List of auto-exposure modes for {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} that are supported by this camera
552 * device.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800553 * <p>Not all the auto-exposure modes may be supported by a
554 * given camera device, especially if no flash unit is
555 * available. This entry lists the valid modes for
556 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} for this camera device.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700557 * <p>All camera devices support ON, and all camera devices with flash
558 * units support ON_AUTO_FLASH and ON_ALWAYS_FLASH.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -0800559 * <p>FULL mode camera devices always support OFF mode,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800560 * which enables application control of camera exposure time,
561 * sensitivity, and frame duration.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700562 * <p>LEGACY mode camera devices never support OFF mode.
563 * LIMITED mode devices support OFF if they support the MANUAL_SENSOR
564 * capability.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700565 * <p><b>Range of valid values:</b><br>
566 * Any value listed in {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700567 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800568 *
569 * @see CaptureRequest#CONTROL_AE_MODE
570 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700571 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700572 public static final Key<int[]> CONTROL_AE_AVAILABLE_MODES =
573 new Key<int[]>("android.control.aeAvailableModes", int[].class);
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800574
575 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700576 * <p>List of frame rate ranges for {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} supported by
577 * this camera device.</p>
Yin-Chia Yeh58551622015-05-21 11:27:06 -0700578 * <p>For devices at the LEGACY level or above:</p>
579 * <ul>
Yin-Chia Yeh5fdf0a12015-11-20 15:39:36 -0800580 * <li>
581 * <p>For constant-framerate recording, for each normal
582 * {@link android.media.CamcorderProfile CamcorderProfile}, that is, a
Yin-Chia Yeh58551622015-05-21 11:27:06 -0700583 * {@link android.media.CamcorderProfile CamcorderProfile} that has
584 * {@link android.media.CamcorderProfile#quality quality} in
585 * the range [{@link android.media.CamcorderProfile#QUALITY_LOW QUALITY_LOW},
586 * {@link android.media.CamcorderProfile#QUALITY_2160P QUALITY_2160P}], if the profile is
587 * supported by the device and has
588 * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code>, this list will
Yin-Chia Yeh5fdf0a12015-11-20 15:39:36 -0800589 * always include (<code>x</code>,<code>x</code>).</p>
590 * </li>
591 * <li>
592 * <p>Also, a camera device must either not support any
593 * {@link android.media.CamcorderProfile CamcorderProfile},
594 * or support at least one
595 * normal {@link android.media.CamcorderProfile CamcorderProfile} that has
596 * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code> &gt;= 24.</p>
597 * </li>
Yin-Chia Yeh58551622015-05-21 11:27:06 -0700598 * </ul>
599 * <p>For devices at the LIMITED level or above:</p>
600 * <ul>
601 * <li>For YUV_420_888 burst capture use case, this list will always include (<code>min</code>, <code>max</code>)
602 * and (<code>max</code>, <code>max</code>) where <code>min</code> &lt;= 15 and <code>max</code> = the maximum output frame rate of the
603 * maximum YUV_420_888 output size.</li>
604 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700605 * <p><b>Units</b>: Frames per second (FPS)</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700606 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700607 *
608 * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800609 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700610 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700611 public static final Key<android.util.Range<Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES =
612 new Key<android.util.Range<Integer>[]>("android.control.aeAvailableTargetFpsRanges", new TypeReference<android.util.Range<Integer>[]>() {{ }});
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800613
614 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700615 * <p>Maximum and minimum exposure compensation values for
616 * {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}, in counts of {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep},
617 * that are supported by this camera device.</p>
618 * <p><b>Range of valid values:</b><br></p>
Zhijun Hef1745ce2015-02-04 13:55:14 -0800619 * <p>Range [0,0] indicates that exposure compensation is not supported.</p>
620 * <p>For LIMITED and FULL devices, range must follow below requirements if exposure
621 * compensation is supported (<code>range != [0, 0]</code>):</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700622 * <p><code>Min.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &lt;= -2 EV</code></p>
623 * <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 -0800624 * <p>LEGACY devices may support a smaller range than this.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700625 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800626 *
627 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700628 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800629 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700630 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700631 public static final Key<android.util.Range<Integer>> CONTROL_AE_COMPENSATION_RANGE =
632 new Key<android.util.Range<Integer>>("android.control.aeCompensationRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800633
634 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700635 * <p>Smallest step by which the exposure compensation
636 * can be changed.</p>
637 * <p>This is the unit for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}. For example, if this key has
638 * 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
639 * that the target EV offset for the auto-exposure routine is -1 EV.</p>
640 * <p>One unit of EV compensation changes the brightness of the captured image by a factor
641 * of two. +1 EV doubles the image brightness, while -1 EV halves the image brightness.</p>
642 * <p><b>Units</b>: Exposure Value (EV)</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700643 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700644 *
645 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800646 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700647 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700648 public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP =
649 new Key<Rational>("android.control.aeCompensationStep", Rational.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800650
651 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700652 * <p>List of auto-focus (AF) modes for {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} that are
653 * supported by this camera device.</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800654 * <p>Not all the auto-focus modes may be supported by a
655 * given camera device. This entry lists the valid modes for
656 * {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} for this camera device.</p>
Ruben Brunk6f387092014-09-22 16:13:54 -0700657 * <p>All LIMITED and FULL mode camera devices will support OFF mode, and all
658 * camera devices with adjustable focuser units
659 * (<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 -0700660 * <p>LEGACY devices will support OFF mode only if they support
661 * focusing to infinity (by also setting {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} to
662 * <code>0.0f</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700663 * <p><b>Range of valid values:</b><br>
664 * Any value listed in {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700665 * <p>This key is available on all devices.</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800666 *
667 * @see CaptureRequest#CONTROL_AF_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700668 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Zhijun He78146ec2014-01-14 18:12:13 -0800669 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800670 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700671 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700672 public static final Key<int[]> CONTROL_AF_AVAILABLE_MODES =
673 new Key<int[]>("android.control.afAvailableModes", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800674
675 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700676 * <p>List of color effects for {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode} that are supported by this camera
677 * device.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800678 * <p>This list contains the color effect modes that can be applied to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700679 * images produced by the camera device.
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800680 * Implementations are not expected to be consistent across all devices.
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700681 * If no color effect modes are available for a device, this will only list
682 * OFF.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800683 * <p>A color effect will only be applied if
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700684 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF. OFF is always included in this list.</p>
685 * <p>This control has no effect on the operation of other control routines such
686 * as auto-exposure, white balance, or focus.</p>
687 * <p><b>Range of valid values:</b><br>
688 * Any value listed in {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700689 * <p>This key is available on all devices.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800690 *
691 * @see CaptureRequest#CONTROL_EFFECT_MODE
692 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700693 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700694 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700695 public static final Key<int[]> CONTROL_AVAILABLE_EFFECTS =
696 new Key<int[]>("android.control.availableEffects", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700697
698 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700699 * <p>List of scene modes for {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} that are supported by this camera
700 * device.</p>
Ruben Brunk8237d342014-01-17 15:33:02 -0800701 * <p>This list contains scene modes that can be set for the camera device.
702 * Only scene modes that have been fully implemented for the
703 * camera device may be included here. Implementations are not expected
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700704 * to be consistent across all devices.</p>
705 * <p>If no scene modes are supported by the camera device, this
706 * will be set to DISABLED. Otherwise DISABLED will not be listed.</p>
707 * <p>FACE_PRIORITY is always listed if face detection is
708 * supported (i.e.<code>{@link CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT android.statistics.info.maxFaceCount} &gt;
709 * 0</code>).</p>
710 * <p><b>Range of valid values:</b><br>
711 * Any value listed in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700712 * <p>This key is available on all devices.</p>
Ruben Brunk8237d342014-01-17 15:33:02 -0800713 *
714 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700715 * @see CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700716 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700717 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700718 public static final Key<int[]> CONTROL_AVAILABLE_SCENE_MODES =
719 new Key<int[]>("android.control.availableSceneModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700720
721 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700722 * <p>List of video stabilization modes for {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}
723 * that are supported by this camera device.</p>
724 * <p>OFF will always be listed.</p>
725 * <p><b>Range of valid values:</b><br>
726 * Any value listed in {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700727 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700728 *
729 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700730 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700731 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700732 public static final Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES =
733 new Key<int[]>("android.control.availableVideoStabilizationModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700734
735 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700736 * <p>List of auto-white-balance modes for {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} that are supported by this
737 * camera device.</p>
Zhijun He399f05d2014-01-15 11:31:30 -0800738 * <p>Not all the auto-white-balance modes may be supported by a
739 * given camera device. This entry lists the valid modes for
740 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} for this camera device.</p>
741 * <p>All camera devices will support ON mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700742 * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always support OFF
743 * mode, which enables application control of white balance, by using
744 * {@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
745 * mode camera devices.</p>
746 * <p><b>Range of valid values:</b><br>
747 * Any value listed in {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700748 * <p>This key is available on all devices.</p>
Zhijun He399f05d2014-01-15 11:31:30 -0800749 *
Zhijun He399f05d2014-01-15 11:31:30 -0800750 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800751 * @see CaptureRequest#COLOR_CORRECTION_MODE
752 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
753 * @see CaptureRequest#CONTROL_AWB_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700754 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700755 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700756 public static final Key<int[]> CONTROL_AWB_AVAILABLE_MODES =
757 new Key<int[]>("android.control.awbAvailableModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700758
759 /**
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800760 * <p>List of the maximum number of regions that can be used for metering in
761 * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
762 * this corresponds to the the maximum number of elements in
763 * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}, {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions},
764 * and {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700765 * <p><b>Range of valid values:</b><br></p>
766 * <p>Value must be &gt;= 0 for each element. For full-capability devices
767 * this value must be &gt;= 1 for AE and AF. The order of the elements is:
768 * <code>(AE, AWB, AF)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700769 * <p>This key is available on all devices.</p>
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800770 *
771 * @see CaptureRequest#CONTROL_AE_REGIONS
772 * @see CaptureRequest#CONTROL_AF_REGIONS
773 * @see CaptureRequest#CONTROL_AWB_REGIONS
Igor Murashkin78712a82014-05-27 18:32:18 -0700774 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700775 */
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800776 public static final Key<int[]> CONTROL_MAX_REGIONS =
777 new Key<int[]>("android.control.maxRegions", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700778
779 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700780 * <p>The maximum number of metering regions that can be used by the auto-exposure (AE)
781 * routine.</p>
782 * <p>This corresponds to the the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700783 * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700784 * <p><b>Range of valid values:</b><br>
785 * Value will be &gt;= 0. For FULL-capability devices, this
786 * value will be &gt;= 1.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700787 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700788 *
789 * @see CaptureRequest#CONTROL_AE_REGIONS
790 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700791 @PublicKey
792 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700793 public static final Key<Integer> CONTROL_MAX_REGIONS_AE =
794 new Key<Integer>("android.control.maxRegionsAe", int.class);
795
796 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700797 * <p>The maximum number of metering regions that can be used by the auto-white balance (AWB)
798 * routine.</p>
799 * <p>This corresponds to the the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700800 * {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700801 * <p><b>Range of valid values:</b><br>
802 * Value will be &gt;= 0.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700803 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700804 *
805 * @see CaptureRequest#CONTROL_AWB_REGIONS
806 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700807 @PublicKey
808 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700809 public static final Key<Integer> CONTROL_MAX_REGIONS_AWB =
810 new Key<Integer>("android.control.maxRegionsAwb", int.class);
811
812 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700813 * <p>The maximum number of metering regions that can be used by the auto-focus (AF) routine.</p>
814 * <p>This corresponds to the the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700815 * {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700816 * <p><b>Range of valid values:</b><br>
817 * Value will be &gt;= 0. For FULL-capability devices, this
818 * value will be &gt;= 1.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700819 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700820 *
821 * @see CaptureRequest#CONTROL_AF_REGIONS
822 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700823 @PublicKey
824 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700825 public static final Key<Integer> CONTROL_MAX_REGIONS_AF =
826 new Key<Integer>("android.control.maxRegionsAf", int.class);
827
828 /**
Zhijun Hefab663e2015-05-26 19:46:31 -0700829 * <p>List of available high speed video size, fps range and max batch size configurations
830 * 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 -0700831 * <p>When CONSTRAINED_HIGH_SPEED_VIDEO is supported in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities},
Zhijun Hefab663e2015-05-26 19:46:31 -0700832 * this metadata will list the supported high speed video size, fps range and max batch size
833 * configurations. All the sizes listed in this configuration will be a subset of the sizes
834 * reported by {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes }
835 * for processed non-stalling formats.</p>
836 * <p>For the high speed video use case, the application must
Zhijun Hee0404182014-06-26 13:17:09 -0700837 * select the video size and fps range from this metadata to configure the recording and
838 * preview streams and setup the recording requests. For example, if the application intends
839 * to do high speed recording, it can select the maximum size reported by this metadata to
840 * configure output streams. Once the size is selected, application can filter this metadata
841 * 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 -0700842 * recording requests. Note that for the use case of multiple output streams, application
Zhijun Hefab663e2015-05-26 19:46:31 -0700843 * must select one unique size from this metadata to use (e.g., preview and recording streams
844 * must have the same size). Otherwise, the high speed capture session creation will fail.</p>
845 * <p>The min and max fps will be multiple times of 30fps.</p>
846 * <p>High speed video streaming extends significant performance pressue to camera hardware,
847 * to achieve efficient high speed streaming, the camera device may have to aggregate
848 * multiple frames together and send to camera device for processing where the request
849 * controls are same for all the frames in this batch. Max batch size indicates
850 * the max possible number of frames the camera device will group together for this high
851 * speed stream configuration. This max batch size will be used to generate a high speed
852 * recording request list by
Eino-Ville Talvala639fffe2015-06-30 10:34:48 -0700853 * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList }.
Zhijun Hefab663e2015-05-26 19:46:31 -0700854 * The max batch size for each configuration will satisfy below conditions:</p>
855 * <ul>
856 * <li>Each max batch size will be a divisor of its corresponding fps_max / 30. For example,
857 * if max_fps is 300, max batch size will only be 1, 2, 5, or 10.</li>
858 * <li>The camera device may choose smaller internal batch size for each configuration, but
859 * the actual batch size will be a divisor of max batch size. For example, if the max batch
860 * size is 8, the actual batch size used by camera device will only be 1, 2, 4, or 8.</li>
861 * <li>The max batch size in each configuration entry must be no larger than 32.</li>
862 * </ul>
863 * <p>The camera device doesn't have to support batch mode to achieve high speed video recording,
864 * in such case, batch_size_max will be reported as 1 in each configuration entry.</p>
865 * <p>This fps ranges in this configuration list can only be used to create requests
866 * that are submitted to a high speed camera capture session created by
867 * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }.
868 * The fps ranges reported in this metadata must not be used to setup capture requests for
869 * normal capture session, or it will cause request error.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700870 * <p><b>Range of valid values:</b><br></p>
Zhijun Hefab663e2015-05-26 19:46:31 -0700871 * <p>For each configuration, the fps_max &gt;= 120fps.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700872 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
873 * <p><b>Limited capability</b> -
874 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
875 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hee0404182014-06-26 13:17:09 -0700876 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700877 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He3c1ff682015-06-23 09:21:43 -0700878 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Zhijun Hee0404182014-06-26 13:17:09 -0700879 * @hide
880 */
Yin-Chia Yeh12da1402014-07-15 10:37:31 -0700881 public static final Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]> CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS =
882 new Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]>("android.control.availableHighSpeedVideoConfigurations", android.hardware.camera2.params.HighSpeedVideoConfiguration[].class);
Zhijun Hee0404182014-06-26 13:17:09 -0700883
884 /**
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -0800885 * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</p>
Yin-Chia Yeh7e3e4312015-04-02 14:34:30 -0700886 * <p>Devices with MANUAL_SENSOR capability or BURST_CAPTURE capability will always
887 * list <code>true</code>. This includes FULL devices.</p>
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -0800888 * <p>This key is available on all devices.</p>
889 *
890 * @see CaptureRequest#CONTROL_AE_LOCK
891 */
892 @PublicKey
893 public static final Key<Boolean> CONTROL_AE_LOCK_AVAILABLE =
894 new Key<Boolean>("android.control.aeLockAvailable", boolean.class);
895
896 /**
897 * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</p>
Yin-Chia Yeh7e3e4312015-04-02 14:34:30 -0700898 * <p>Devices with MANUAL_POST_PROCESSING capability or BURST_CAPTURE capability will
899 * always list <code>true</code>. This includes FULL devices.</p>
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -0800900 * <p>This key is available on all devices.</p>
901 *
902 * @see CaptureRequest#CONTROL_AWB_LOCK
903 */
904 @PublicKey
905 public static final Key<Boolean> CONTROL_AWB_LOCK_AVAILABLE =
906 new Key<Boolean>("android.control.awbLockAvailable", boolean.class);
907
908 /**
909 * <p>List of control modes for {@link CaptureRequest#CONTROL_MODE android.control.mode} that are supported by this camera
910 * device.</p>
911 * <p>This list contains control modes that can be set for the camera device.
912 * LEGACY mode devices will always support AUTO mode. LIMITED and FULL
913 * devices will always support OFF, AUTO modes.</p>
914 * <p><b>Range of valid values:</b><br>
915 * Any value listed in {@link CaptureRequest#CONTROL_MODE android.control.mode}</p>
916 * <p>This key is available on all devices.</p>
917 *
918 * @see CaptureRequest#CONTROL_MODE
919 */
920 @PublicKey
921 public static final Key<int[]> CONTROL_AVAILABLE_MODES =
922 new Key<int[]>("android.control.availableModes", int[].class);
923
924 /**
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -0800925 * <p>Range of boosts for {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} supported
926 * by this camera device.</p>
927 * <p>Devices support post RAW sensitivity boost will advertise
928 * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} key for controling
929 * post RAW sensitivity boost.</p>
930 * <p>This key will be <code>null</code> for devices that do not support any RAW format
931 * outputs. For devices that do support RAW format outputs, this key will always
932 * present, and if a device does not support post RAW sensitivity boost, it will
933 * list <code>(100, 100)</code> in this key.</p>
934 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
935 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
936 *
937 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
938 * @see CaptureRequest#SENSOR_SENSITIVITY
939 */
940 @PublicKey
941 public static final Key<android.util.Range<Integer>> CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE =
942 new Key<android.util.Range<Integer>>("android.control.postRawSensitivityBoostRange", new TypeReference<android.util.Range<Integer>>() {{ }});
943
944 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700945 * <p>List of edge enhancement modes for {@link CaptureRequest#EDGE_MODE android.edge.mode} that are supported by this camera
946 * device.</p>
Chien-Yu Chen72333912015-07-08 11:55:19 -0700947 * <p>Full-capability camera devices must always support OFF; camera devices that support
948 * YUV_REPROCESSING or PRIVATE_REPROCESSING will list ZERO_SHUTTER_LAG; all devices will
949 * list FAST.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700950 * <p><b>Range of valid values:</b><br>
951 * Any value listed in {@link CaptureRequest#EDGE_MODE android.edge.mode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700952 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
953 * <p><b>Full capability</b> -
954 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
955 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -0800956 *
957 * @see CaptureRequest#EDGE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700958 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -0800959 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700960 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700961 public static final Key<int[]> EDGE_AVAILABLE_EDGE_MODES =
962 new Key<int[]>("android.edge.availableEdgeModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -0800963
964 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -0800965 * <p>Whether this camera device has a
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700966 * flash unit.</p>
967 * <p>Will be <code>false</code> if no flash is available.</p>
968 * <p>If there is no flash unit, none of the flash controls do
969 * anything.
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700970 * This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700971 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700972 @PublicKey
Zhijun Heca1b73a2014-02-03 12:39:53 -0800973 public static final Key<Boolean> FLASH_INFO_AVAILABLE =
974 new Key<Boolean>("android.flash.info.available", boolean.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700975
976 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700977 * <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 -0800978 * camera device.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -0800979 * <p>FULL mode camera devices will always support FAST.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700980 * <p><b>Range of valid values:</b><br>
981 * Any value listed in {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700982 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -0800983 *
984 * @see CaptureRequest#HOT_PIXEL_MODE
985 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700986 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700987 public static final Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES =
988 new Key<int[]>("android.hotPixel.availableHotPixelModes", int[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -0800989
990 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700991 * <p>List of JPEG thumbnail sizes for {@link CaptureRequest#JPEG_THUMBNAIL_SIZE android.jpeg.thumbnailSize} supported by this
992 * camera device.</p>
993 * <p>This list will include at least one non-zero resolution, plus <code>(0,0)</code> for indicating no
994 * thumbnail should be generated.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -0800995 * <p>Below condiditions will be satisfied for this size list:</p>
Zhijun He5a9ff372013-12-26 11:49:09 -0800996 * <ul>
Zhijun He5f2a47f2014-01-16 15:44:41 -0800997 * <li>The sizes will be sorted by increasing pixel area (width x height).
998 * If several resolutions have the same area, they will be sorted by increasing width.</li>
999 * <li>The aspect ratio of the largest thumbnail size will be same as the
Igor Murashkin9c595172014-05-12 13:56:20 -07001000 * aspect ratio of largest JPEG output size in android.scaler.availableStreamConfigurations.
Zhijun He5a9ff372013-12-26 11:49:09 -08001001 * The largest size is defined as the size that has the largest pixel area
1002 * in a given size list.</li>
Igor Murashkin9c595172014-05-12 13:56:20 -07001003 * <li>Each output JPEG size in android.scaler.availableStreamConfigurations will have at least
Zhijun He5a9ff372013-12-26 11:49:09 -08001004 * one corresponding size that has the same aspect ratio in availableThumbnailSizes,
1005 * and vice versa.</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001006 * <li>All non-<code>(0, 0)</code> sizes will have non-zero widths and heights.
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001007 * This key is available on all devices.</li>
Zhijun He5a9ff372013-12-26 11:49:09 -08001008 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001009 *
1010 * @see CaptureRequest#JPEG_THUMBNAIL_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001011 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001012 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001013 public static final Key<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES =
1014 new Key<android.util.Size[]>("android.jpeg.availableThumbnailSizes", android.util.Size[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001015
1016 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001017 * <p>List of aperture size values for {@link CaptureRequest#LENS_APERTURE android.lens.aperture} that are
1018 * supported by this camera device.</p>
1019 * <p>If the camera device doesn't support a variable lens aperture,
1020 * this list will contain only one value, which is the fixed aperture size.</p>
1021 * <p>If the camera device supports a variable aperture, the aperture values
Zhijun Hefb46c642014-01-14 17:57:23 -08001022 * in this list will be sorted in ascending order.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001023 * <p><b>Units</b>: The aperture f-number</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001024 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1025 * <p><b>Full capability</b> -
1026 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1027 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1028 *
1029 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001030 * @see CaptureRequest#LENS_APERTURE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001031 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001032 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001033 public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES =
1034 new Key<float[]>("android.lens.info.availableApertures", float[].class);
1035
1036 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001037 * <p>List of neutral density filter values for
1038 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} that are supported by this camera device.</p>
1039 * <p>If a neutral density filter is not supported by this camera device,
1040 * this list will contain only 0. Otherwise, this list will include every
1041 * filter density supported by the camera device, in ascending order.</p>
1042 * <p><b>Units</b>: Exposure value (EV)</p>
1043 * <p><b>Range of valid values:</b><br></p>
1044 * <p>Values are &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001045 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1046 * <p><b>Full capability</b> -
1047 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1048 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001049 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001050 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08001051 * @see CaptureRequest#LENS_FILTER_DENSITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001052 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001053 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001054 public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES =
1055 new Key<float[]>("android.lens.info.availableFilterDensities", float[].class);
1056
1057 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001058 * <p>List of focal lengths for {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength} that are supported by this camera
1059 * device.</p>
1060 * <p>If optical zoom is not supported, this list will only contain
1061 * a single value corresponding to the fixed focal length of the
1062 * device. Otherwise, this list will include every focal length supported
1063 * by the camera device, in ascending order.</p>
1064 * <p><b>Units</b>: Millimeters</p>
1065 * <p><b>Range of valid values:</b><br></p>
1066 * <p>Values are &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001067 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08001068 *
1069 * @see CaptureRequest#LENS_FOCAL_LENGTH
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001070 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001071 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001072 public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS =
1073 new Key<float[]>("android.lens.info.availableFocalLengths", float[].class);
1074
1075 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001076 * <p>List of optical image stabilization (OIS) modes for
1077 * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} that are supported by this camera device.</p>
1078 * <p>If OIS is not supported by a given camera device, this list will
Ruben Brunk00849b32014-01-17 18:30:23 -08001079 * contain only OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001080 * <p><b>Range of valid values:</b><br>
1081 * Any value listed in {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001082 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1083 * <p><b>Limited capability</b> -
1084 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1085 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk00849b32014-01-17 18:30:23 -08001086 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001087 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk00849b32014-01-17 18:30:23 -08001088 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001089 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001090 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001091 public static final Key<int[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION =
1092 new Key<int[]>("android.lens.info.availableOpticalStabilization", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001093
1094 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001095 * <p>Hyperfocal distance for this lens.</p>
Zhijun Heff413932014-02-07 15:44:30 -08001096 * <p>If the lens is not fixed focus, the camera device will report this
1097 * 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 -07001098 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1099 * <p><b>Range of valid values:</b><br>
1100 * If lens is fixed focus, &gt;= 0. If lens has focuser unit, the value is
1101 * within <code>(0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code></p>
1102 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1103 * <p><b>Limited capability</b> -
1104 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1105 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1106 *
1107 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1108 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
1109 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1110 */
1111 @PublicKey
1112 public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE =
1113 new Key<Float>("android.lens.info.hyperfocalDistance", float.class);
1114
1115 /**
1116 * <p>Shortest distance from frontmost surface
1117 * of the lens that can be brought into sharp focus.</p>
1118 * <p>If the lens is fixed-focus, this will be
1119 * 0.</p>
1120 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1121 * <p><b>Range of valid values:</b><br>
1122 * &gt;= 0</p>
Zhijun Heff413932014-02-07 15:44:30 -08001123 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001124 * <p><b>Limited capability</b> -
1125 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1126 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heff413932014-02-07 15:44:30 -08001127 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001128 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heff413932014-02-07 15:44:30 -08001129 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001130 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001131 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001132 public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE =
1133 new Key<Float>("android.lens.info.minimumFocusDistance", float.class);
1134
1135 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08001136 * <p>Dimensions of lens shading map.</p>
1137 * <p>The map should be on the order of 30-40 rows and columns, and
1138 * must be smaller than 64x64.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001139 * <p><b>Range of valid values:</b><br>
1140 * Both values &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001141 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1142 * <p><b>Full capability</b> -
1143 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1144 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1145 *
1146 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07001147 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001148 */
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001149 public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
1150 new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001151
1152 /**
Zhijun Heff413932014-02-07 15:44:30 -08001153 * <p>The lens focus distance calibration quality.</p>
1154 * <p>The lens focus distance calibration quality determines the reliability of
1155 * focus related metadata entries, i.e. {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1156 * {@link CaptureResult#LENS_FOCUS_RANGE android.lens.focusRange}, {@link CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE android.lens.info.hyperfocalDistance}, and
1157 * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001158 * <p>APPROXIMATE and CALIBRATED devices report the focus metadata in
1159 * units of diopters (1/meter), so <code>0.0f</code> represents focusing at infinity,
1160 * and increasing positive numbers represent focusing closer and closer
1161 * to the camera device. The focus distance control also uses diopters
1162 * on these devices.</p>
1163 * <p>UNCALIBRATED devices do not use units that are directly comparable
1164 * to any real physical measurement, but <code>0.0f</code> still represents farthest
1165 * focus, and {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} represents the
1166 * nearest focus the device can achieve.</p>
1167 * <p><b>Possible values:</b>
1168 * <ul>
1169 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED UNCALIBRATED}</li>
1170 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE APPROXIMATE}</li>
1171 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED CALIBRATED}</li>
1172 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001173 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1174 * <p><b>Limited capability</b> -
1175 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1176 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heff413932014-02-07 15:44:30 -08001177 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001178 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heff413932014-02-07 15:44:30 -08001179 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1180 * @see CaptureResult#LENS_FOCUS_RANGE
1181 * @see CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE
1182 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1183 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED
1184 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE
1185 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED
1186 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001187 @PublicKey
Zhijun Heff413932014-02-07 15:44:30 -08001188 public static final Key<Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION =
1189 new Key<Integer>("android.lens.info.focusDistanceCalibration", int.class);
1190
1191 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001192 * <p>Direction the camera faces relative to
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001193 * device screen.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001194 * <p><b>Possible values:</b>
1195 * <ul>
1196 * <li>{@link #LENS_FACING_FRONT FRONT}</li>
1197 * <li>{@link #LENS_FACING_BACK BACK}</li>
Zhijun He503e8152015-01-12 15:16:56 -08001198 * <li>{@link #LENS_FACING_EXTERNAL EXTERNAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001199 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001200 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001201 * @see #LENS_FACING_FRONT
1202 * @see #LENS_FACING_BACK
Zhijun He503e8152015-01-12 15:16:56 -08001203 * @see #LENS_FACING_EXTERNAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001204 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001205 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001206 public static final Key<Integer> LENS_FACING =
1207 new Key<Integer>("android.lens.facing", int.class);
1208
1209 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001210 * <p>The orientation of the camera relative to the sensor
1211 * coordinate system.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001212 * <p>The four coefficients that describe the quaternion
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001213 * rotation from the Android sensor coordinate system to a
1214 * camera-aligned coordinate system where the X-axis is
1215 * aligned with the long side of the image sensor, the Y-axis
1216 * is aligned with the short side of the image sensor, and
1217 * the Z-axis is aligned with the optical axis of the sensor.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001218 * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001219 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
1220 * amount <code>theta</code>, the following formulas can be used:</p>
1221 * <pre><code> theta = 2 * acos(w)
1222 * a_x = x / sin(theta/2)
1223 * a_y = y / sin(theta/2)
1224 * a_z = z / sin(theta/2)
1225 * </code></pre>
1226 * <p>To create a 3x3 rotation matrix that applies the rotation
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001227 * defined by this quaternion, the following matrix can be
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001228 * used:</p>
1229 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
1230 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
1231 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
1232 * </code></pre>
1233 * <p>This matrix can then be used to apply the rotation to a
1234 * column vector point with</p>
1235 * <p><code>p' = Rp</code></p>
1236 * <p>where <code>p</code> is in the device sensor coordinate system, and
1237 * <code>p'</code> is in the camera-oriented coordinate system.</p>
1238 * <p><b>Units</b>:
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001239 * Quaternion coefficients</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001240 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1241 */
1242 @PublicKey
1243 public static final Key<float[]> LENS_POSE_ROTATION =
1244 new Key<float[]>("android.lens.poseRotation", float[].class);
1245
1246 /**
1247 * <p>Position of the camera optical center.</p>
Eino-Ville Talvalad3dbfb32015-05-29 17:17:04 -07001248 * <p>The position of the camera device's lens optical center,
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001249 * as a three-dimensional vector <code>(x,y,z)</code>.</p>
1250 * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
1251 * is relative to the optical center of the largest camera device facing in the same
1252 * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
1253 * coordinate axes}. Note that only the axis definitions are shared with the sensor
1254 * coordinate system, but not the origin.</p>
1255 * <p>If this device is the largest or only camera device with a given facing, then this
1256 * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
1257 * 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 -07001258 * report <code>(0.03, 0, 0)</code>. Note that this means that, for many computer vision
1259 * applications, the position needs to be negated to convert it to a translation from the
1260 * camera to the origin.</p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001261 * <p>To transform a pixel coordinates between two cameras facing the same direction, first
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001262 * 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 -08001263 * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
1264 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
1265 * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
1266 * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
1267 * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
1268 * coordinates.</p>
1269 * <p>To compare this against a real image from the destination camera, the destination camera
1270 * image then needs to be corrected for radial distortion before comparison or sampling.</p>
1271 * <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 -07001272 * the center of the primary gyroscope on the device. The axis definitions are the same as
1273 * with PRIMARY_CAMERA.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001274 * <p><b>Units</b>: Meters</p>
1275 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1276 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001277 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001278 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001279 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001280 * @see CameraCharacteristics#LENS_POSE_ROTATION
1281 */
1282 @PublicKey
1283 public static final Key<float[]> LENS_POSE_TRANSLATION =
1284 new Key<float[]>("android.lens.poseTranslation", float[].class);
1285
1286 /**
1287 * <p>The parameters for this camera device's intrinsic
1288 * calibration.</p>
1289 * <p>The five calibration parameters that describe the
1290 * transform from camera-centric 3D coordinates to sensor
1291 * pixel coordinates:</p>
1292 * <pre><code>[f_x, f_y, c_x, c_y, s]
1293 * </code></pre>
1294 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
1295 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
1296 * axis, and <code>s</code> is a skew parameter for the sensor plane not
1297 * being aligned with the lens plane.</p>
1298 * <p>These are typically used within a transformation matrix K:</p>
1299 * <pre><code>K = [ f_x, s, c_x,
1300 * 0, f_y, c_y,
1301 * 0 0, 1 ]
1302 * </code></pre>
1303 * <p>which can then be combined with the camera pose rotation
1304 * <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 -07001305 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respectively) to calculate the
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001306 * complete transform from world coordinates to pixel
1307 * coordinates:</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001308 * <pre><code>P = [ K 0 * [ R -Rt
1309 * 0 1 ] 0 1 ]
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001310 * </code></pre>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001311 * <p>(Note the negation of poseTranslation when mapping from camera
1312 * to world coordinates, and multiplication by the rotation).</p>
1313 * <p>With <code>p_w</code> being a point in the world coordinate system
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001314 * and <code>p_s</code> being a point in the camera active pixel array
1315 * coordinate system, and with the mapping including the
1316 * homogeneous division by z:</p>
1317 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
1318 * p_s = p_h / z_h
1319 * </code></pre>
1320 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
1321 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
1322 * (depth) in pixel coordinates.</p>
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001323 * <p>Note that the coordinate system for this transform is the
1324 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
1325 * where <code>(0,0)</code> is the top-left of the
1326 * preCorrectionActiveArraySize rectangle. Once the pose and
1327 * intrinsic calibration transforms have been applied to a
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001328 * world point, then the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001329 * transform needs to be applied, and the result adjusted to
1330 * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
1331 * system (where <code>(0, 0)</code> is the top-left of the
1332 * activeArraySize rectangle), to determine the final pixel
1333 * coordinate of the world point for processed (non-RAW)
1334 * output buffers.</p>
Eino-Ville Talvala08bd1632018-08-01 17:23:09 -07001335 * <p>For camera devices, the center of pixel <code>(x,y)</code> is located at
1336 * coordinate <code>(x + 0.5, y + 0.5)</code>. So on a device with a
1337 * precorrection active array of size <code>(10,10)</code>, the valid pixel
1338 * indices go from <code>(0,0)-(9,9)</code>, and an perfectly-built camera would
1339 * have an optical center at the exact center of the pixel grid, at
1340 * coordinates <code>(5.0, 5.0)</code>, which is the top-left corner of pixel
1341 * <code>(5,5)</code>.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001342 * <p><b>Units</b>:
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001343 * Pixels in the
1344 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1345 * coordinate system.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001346 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1347 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001348 * @see CameraCharacteristics#LENS_DISTORTION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001349 * @see CameraCharacteristics#LENS_POSE_ROTATION
1350 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07001351 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001352 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001353 */
1354 @PublicKey
1355 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
1356 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
1357
1358 /**
1359 * <p>The correction coefficients to correct for this camera device's
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001360 * radial and tangential lens distortion.</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001361 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001362 * kappa_3]</code> and two tangential distortion coefficients
1363 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
1364 * lens's geometric distortion with the mapping equations:</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001365 * <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 -07001366 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001367 * 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 -07001368 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001369 * </code></pre>
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001370 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
1371 * input image that correspond to the pixel values in the
1372 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
1373 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
1374 * </code></pre>
1375 * <p>The pixel coordinates are defined in a normalized
1376 * coordinate system related to the
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001377 * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001378 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
1379 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
1380 * of both x and y coordinates are normalized to be 1 at the
1381 * edge further from the optical center, so the range
1382 * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
1383 * <p>Finally, <code>r</code> represents the radial distance from the
1384 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
1385 * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
1386 * <p>The distortion model used is the Brown-Conrady model.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001387 * <p><b>Units</b>:
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001388 * Unitless coefficients.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001389 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001390 *
1391 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001392 * @deprecated
1393 * <p>This field was inconsistently defined in terms of its
1394 * normalization. Use {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} instead.</p>
1395 *
1396 * @see CameraCharacteristics#LENS_DISTORTION
1397
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001398 */
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001399 @Deprecated
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001400 @PublicKey
1401 public static final Key<float[]> LENS_RADIAL_DISTORTION =
1402 new Key<float[]>("android.lens.radialDistortion", float[].class);
1403
1404 /**
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001405 * <p>The origin for {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}.</p>
1406 * <p>Different calibration methods and use cases can produce better or worse results
1407 * depending on the selected coordinate origin.</p>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001408 * <p><b>Possible values:</b>
1409 * <ul>
1410 * <li>{@link #LENS_POSE_REFERENCE_PRIMARY_CAMERA PRIMARY_CAMERA}</li>
1411 * <li>{@link #LENS_POSE_REFERENCE_GYROSCOPE GYROSCOPE}</li>
1412 * </ul></p>
1413 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1414 *
1415 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
1416 * @see #LENS_POSE_REFERENCE_PRIMARY_CAMERA
1417 * @see #LENS_POSE_REFERENCE_GYROSCOPE
1418 */
1419 @PublicKey
1420 public static final Key<Integer> LENS_POSE_REFERENCE =
1421 new Key<Integer>("android.lens.poseReference", int.class);
1422
1423 /**
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001424 * <p>The correction coefficients to correct for this camera device's
1425 * radial and tangential lens distortion.</p>
1426 * <p>Replaces the deprecated {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} field, which was
1427 * inconsistently defined.</p>
1428 * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2,
1429 * kappa_3]</code> and two tangential distortion coefficients
1430 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
1431 * lens's geometric distortion with the mapping equations:</p>
1432 * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1433 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
1434 * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1435 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
1436 * </code></pre>
1437 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
1438 * input image that correspond to the pixel values in the
1439 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
1440 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
1441 * </code></pre>
1442 * <p>The pixel coordinates are defined in a coordinate system
1443 * related to the {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
1444 * calibration fields; see that entry for details of the mapping stages.
1445 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code>
1446 * have <code>(0,0)</code> at the lens optical center <code>[c_x, c_y]</code>, and
1447 * the range of the coordinates depends on the focal length
1448 * terms of the intrinsic calibration.</p>
1449 * <p>Finally, <code>r</code> represents the radial distance from the
1450 * optical center, <code>r^2 = x_i^2 + y_i^2</code>.</p>
1451 * <p>The distortion model used is the Brown-Conrady model.</p>
1452 * <p><b>Units</b>:
1453 * Unitless coefficients.</p>
1454 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1455 *
1456 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
1457 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
1458 */
1459 @PublicKey
1460 public static final Key<float[]> LENS_DISTORTION =
1461 new Key<float[]>("android.lens.distortion", float[].class);
1462
1463 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001464 * <p>List of noise reduction modes for {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} that are supported
1465 * by this camera device.</p>
1466 * <p>Full-capability camera devices will always support OFF and FAST.</p>
Chien-Yu Chen72333912015-07-08 11:55:19 -07001467 * <p>Camera devices that support YUV_REPROCESSING or PRIVATE_REPROCESSING will support
1468 * ZERO_SHUTTER_LAG.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001469 * <p>Legacy-capability camera devices will only support FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001470 * <p><b>Range of valid values:</b><br>
1471 * Any value listed in {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001472 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1473 * <p><b>Limited capability</b> -
1474 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1475 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001476 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001477 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001478 * @see CaptureRequest#NOISE_REDUCTION_MODE
1479 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001480 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001481 public static final Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES =
1482 new Key<int[]>("android.noiseReduction.availableNoiseReductionModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001483
1484 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001485 * <p>If set to 1, the HAL will always split result
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001486 * metadata for a single capture into multiple buffers,
Igor Murashkinace5bf02013-12-10 17:36:40 -08001487 * returned using multiple process_capture_result calls.</p>
1488 * <p>Does not need to be listed in static
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001489 * metadata. Support for partial results will be reworked in
1490 * future versions of camera service. This quirk will stop
1491 * working at that point; DO NOT USE without careful
Igor Murashkinace5bf02013-12-10 17:36:40 -08001492 * consideration of future support.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08001493 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001494 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001495 * <p>Not used in HALv3 or newer; replaced by better partials mechanism</p>
1496
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001497 * @hide
1498 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001499 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001500 public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
1501 new Key<Byte>("android.quirks.usePartialResult", byte.class);
1502
1503 /**
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001504 * <p>The maximum numbers of different types of output streams
1505 * that can be configured and used simultaneously by a camera device.</p>
1506 * <p>This is a 3 element tuple that contains the max number of output simultaneous
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001507 * streams for raw sensor, processed (but not stalling), and processed (and stalling)
1508 * formats respectively. For example, assuming that JPEG is typically a processed and
1509 * stalling stream, if max raw sensor format output stream number is 1, max YUV streams
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001510 * number is 3, and max JPEG stream number is 2, then this tuple should be <code>(1, 3, 2)</code>.</p>
1511 * <p>This lists the upper bound of the number of output streams supported by
1512 * the camera device. Using more streams simultaneously may require more hardware and
Igor Murashkin78712a82014-05-27 18:32:18 -07001513 * CPU resources that will consume more power. The image format for an output stream can
Igor Murashkin9c595172014-05-12 13:56:20 -07001514 * be any supported format provided by android.scaler.availableStreamConfigurations.
1515 * The formats defined in android.scaler.availableStreamConfigurations can be catergorized
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001516 * into the 3 stream types as below:</p>
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001517 * <ul>
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001518 * <li>Processed (but stalling): any non-RAW format with a stallDurations &gt; 0.
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001519 * Typically {@link android.graphics.ImageFormat#JPEG JPEG format}.</li>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001520 * <li>Raw formats: {@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}, {@link android.graphics.ImageFormat#RAW10 RAW10}, or
1521 * {@link android.graphics.ImageFormat#RAW12 RAW12}.</li>
1522 * <li>Processed (but not-stalling): any non-RAW format without a stall duration. Typically
1523 * {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888},
1524 * {@link android.graphics.ImageFormat#NV21 NV21}, or {@link android.graphics.ImageFormat#YV12 YV12}.</li>
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001525 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001526 * <p><b>Range of valid values:</b><br></p>
1527 * <p>For processed (and stalling) format streams, &gt;= 1.</p>
1528 * <p>For Raw format (either stalling or non-stalling) streams, &gt;= 0.</p>
1529 * <p>For processed (but not stalling) format streams, &gt;= 3
1530 * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1531 * &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 -07001532 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001533 *
1534 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001535 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001536 */
1537 public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
1538 new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
1539
1540 /**
Igor Murashkin78712a82014-05-27 18:32:18 -07001541 * <p>The maximum numbers of different types of output streams
1542 * that can be configured and used simultaneously by a camera device
1543 * for any <code>RAW</code> formats.</p>
1544 * <p>This value contains the max number of output simultaneous
1545 * streams from the raw sensor.</p>
1546 * <p>This lists the upper bound of the number of output streams supported by
1547 * the camera device. Using more streams simultaneously may require more hardware and
1548 * CPU resources that will consume more power. The image format for this kind of an output stream can
1549 * be any <code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1550 * <p>In particular, a <code>RAW</code> format is typically one of:</p>
1551 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001552 * <li>{@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}</li>
1553 * <li>{@link android.graphics.ImageFormat#RAW10 RAW10}</li>
1554 * <li>{@link android.graphics.ImageFormat#RAW12 RAW12}</li>
Igor Murashkin78712a82014-05-27 18:32:18 -07001555 * </ul>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001556 * <p>LEGACY mode devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> LEGACY)
1557 * never support raw streams.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001558 * <p><b>Range of valid values:</b><br></p>
1559 * <p>&gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001560 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001561 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001562 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001563 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1564 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001565 @PublicKey
1566 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001567 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_RAW =
1568 new Key<Integer>("android.request.maxNumOutputRaw", int.class);
1569
1570 /**
1571 * <p>The maximum numbers of different types of output streams
1572 * that can be configured and used simultaneously by a camera device
1573 * for any processed (but not-stalling) formats.</p>
1574 * <p>This value contains the max number of output simultaneous
1575 * streams for any processed (but not-stalling) formats.</p>
1576 * <p>This lists the upper bound of the number of output streams supported by
1577 * the camera device. Using more streams simultaneously may require more hardware and
1578 * CPU resources that will consume more power. The image format for this kind of an output stream can
1579 * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1580 * <p>Processed (but not-stalling) is defined as any non-RAW format without a stall duration.
1581 * Typically:</p>
1582 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001583 * <li>{@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888}</li>
1584 * <li>{@link android.graphics.ImageFormat#NV21 NV21}</li>
1585 * <li>{@link android.graphics.ImageFormat#YV12 YV12}</li>
1586 * <li>Implementation-defined formats, i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class) }</li>
Igor Murashkin78712a82014-05-27 18:32:18 -07001587 * </ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001588 * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1589 * processed format -- it will return 0 for a non-stalling stream.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001590 * <p>LEGACY devices will support at least 2 processing/non-stalling streams.</p>
1591 * <p><b>Range of valid values:</b><br></p>
1592 * <p>&gt;= 3
1593 * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1594 * &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 -07001595 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001596 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001597 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001598 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1599 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001600 @PublicKey
1601 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001602 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC =
1603 new Key<Integer>("android.request.maxNumOutputProc", int.class);
1604
1605 /**
1606 * <p>The maximum numbers of different types of output streams
1607 * that can be configured and used simultaneously by a camera device
1608 * for any processed (and stalling) formats.</p>
1609 * <p>This value contains the max number of output simultaneous
1610 * streams for any processed (but not-stalling) formats.</p>
1611 * <p>This lists the upper bound of the number of output streams supported by
1612 * the camera device. Using more streams simultaneously may require more hardware and
1613 * CPU resources that will consume more power. The image format for this kind of an output stream can
1614 * 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 -07001615 * <p>A processed and stalling format is defined as any non-RAW format with a stallDurations
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001616 * &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 -07001617 * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1618 * processed format -- it will return a non-0 value for a stalling stream.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001619 * <p>LEGACY devices will support up to 1 processing/stalling stream.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001620 * <p><b>Range of valid values:</b><br></p>
1621 * <p>&gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001622 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001623 *
1624 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1625 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001626 @PublicKey
1627 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001628 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING =
1629 new Key<Integer>("android.request.maxNumOutputProcStalling", int.class);
1630
1631 /**
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001632 * <p>The maximum numbers of any type of input streams
1633 * that can be configured and used simultaneously by a camera device.</p>
1634 * <p>When set to 0, it means no input stream is supported.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001635 * <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
1636 * input stream, there must be at least one output stream configured to to receive the
1637 * reprocessed images.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08001638 * <p>When an input stream and some output streams are used in a reprocessing request,
1639 * only the input buffer will be used to produce these output stream buffers, and a
1640 * new sensor image will not be captured.</p>
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001641 * <p>For example, for Zero Shutter Lag (ZSL) still capture use case, the input
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001642 * stream image format will be PRIVATE, the associated output stream image format
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001643 * should be JPEG.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001644 * <p><b>Range of valid values:</b><br></p>
1645 * <p>0 or 1.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001646 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1647 * <p><b>Full capability</b> -
1648 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1649 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1650 *
1651 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001652 */
Zhijun He0e99c222015-01-29 15:26:05 -08001653 @PublicKey
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001654 public static final Key<Integer> REQUEST_MAX_NUM_INPUT_STREAMS =
1655 new Key<Integer>("android.request.maxNumInputStreams", int.class);
1656
1657 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08001658 * <p>Specifies the number of maximum pipeline stages a frame
1659 * has to go through from when it's exposed to when it's available
1660 * to the framework.</p>
1661 * <p>A typical minimum value for this is 2 (one stage to expose,
1662 * one stage to readout) from the sensor. The ISP then usually adds
1663 * its own stages to do custom HW processing. Further stages may be
1664 * added by SW processing.</p>
1665 * <p>Depending on what settings are used (e.g. YUV, JPEG) and what
1666 * processing is enabled (e.g. face detection), the actual pipeline
1667 * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than
1668 * the max pipeline depth.</p>
1669 * <p>A pipeline depth of X stages is equivalent to a pipeline latency of
1670 * X frame intervals.</p>
Zhijun Hefab663e2015-05-26 19:46:31 -07001671 * <p>This value will normally be 8 or less, however, for high speed capture session,
1672 * 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 -07001673 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08001674 *
1675 * @see CaptureResult#REQUEST_PIPELINE_DEPTH
1676 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001677 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08001678 public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH =
1679 new Key<Byte>("android.request.pipelineMaxDepth", byte.class);
1680
1681 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001682 * <p>Defines how many sub-components
Igor Murashkin2086b582014-01-17 18:30:59 -08001683 * a result will be composed of.</p>
1684 * <p>In order to combat the pipeline latency, partial results
1685 * may be delivered to the application layer from the camera device as
1686 * soon as they are available.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001687 * <p>Optional; defaults to 1. A value of 1 means that partial
1688 * results are not supported, and only the final TotalCaptureResult will
1689 * be produced by the camera device.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001690 * <p>A typical use case for this might be: after requesting an
1691 * auto-focus (AF) lock the new AF state might be available 50%
1692 * of the way through the pipeline. The camera device could
1693 * then immediately dispatch this state via a partial result to
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001694 * the application, and the rest of the metadata via later
1695 * partial results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001696 * <p><b>Range of valid values:</b><br>
1697 * &gt;= 1</p>
Zhijun He1420de42014-07-17 17:45:54 -07001698 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin2086b582014-01-17 18:30:59 -08001699 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001700 @PublicKey
Igor Murashkin2086b582014-01-17 18:30:59 -08001701 public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
1702 new Key<Integer>("android.request.partialResultCount", int.class);
1703
1704 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001705 * <p>List of capabilities that this camera device
Igor Murashkine46c0da2014-02-07 18:34:37 -08001706 * advertises as fully supporting.</p>
1707 * <p>A capability is a contract that the camera device makes in order
1708 * to be able to satisfy one or more use cases.</p>
1709 * <p>Listing a capability guarantees that the whole set of features
1710 * required to support a common use will all be available.</p>
1711 * <p>Using a subset of the functionality provided by an unsupported
1712 * capability may be possible on a specific camera device implementation;
1713 * to do this query each of android.request.availableRequestKeys,
1714 * android.request.availableResultKeys,
1715 * android.request.availableCharacteristicsKeys.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001716 * <p>The following capabilities are guaranteed to be available on
1717 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL devices:</p>
1718 * <ul>
1719 * <li>MANUAL_SENSOR</li>
Zhijun Hedf9b7472014-06-04 13:42:41 -07001720 * <li>MANUAL_POST_PROCESSING</li>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001721 * </ul>
1722 * <p>Other capabilities may be available on either FULL or LIMITED
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001723 * devices, but the application should query this key to be sure.</p>
1724 * <p><b>Possible values:</b>
1725 * <ul>
1726 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE BACKWARD_COMPATIBLE}</li>
1727 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR MANUAL_SENSOR}</li>
1728 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING MANUAL_POST_PROCESSING}</li>
1729 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}</li>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001730 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING PRIVATE_REPROCESSING}</li>
Ruben Brunk0c22e692014-11-11 12:00:34 -08001731 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}</li>
Eino-Ville Talvala126a7462014-11-04 16:31:01 -08001732 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08001733 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING YUV_REPROCESSING}</li>
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07001734 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT DEPTH_OUTPUT}</li>
Zhijun Hefab663e2015-05-26 19:46:31 -07001735 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO CONSTRAINED_HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001736 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING MOTION_TRACKING}</li>
Shuzhen Wang23d29382017-11-26 17:24:56 -08001737 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA LOGICAL_MULTI_CAMERA}</li>
Shuzhen Wang51248bf2018-03-22 00:04:45 -07001738 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME MONOCHROME}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001739 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001740 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001741 *
1742 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala08bc3b02014-07-09 10:07:36 -07001743 * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
Igor Murashkine46c0da2014-02-07 18:34:37 -08001744 * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
Zhijun He50f72432014-05-28 13:52:04 -07001745 * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING
Eino-Ville Talvala611fece2014-07-10 17:29:38 -07001746 * @see #REQUEST_AVAILABLE_CAPABILITIES_RAW
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001747 * @see #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING
Ruben Brunk0c22e692014-11-11 12:00:34 -08001748 * @see #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS
Eino-Ville Talvala126a7462014-11-04 16:31:01 -08001749 * @see #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE
Zhijun He0e99c222015-01-29 15:26:05 -08001750 * @see #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07001751 * @see #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT
Zhijun Hefab663e2015-05-26 19:46:31 -07001752 * @see #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001753 * @see #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING
Shuzhen Wang23d29382017-11-26 17:24:56 -08001754 * @see #REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA
Shuzhen Wang51248bf2018-03-22 00:04:45 -07001755 * @see #REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME
Igor Murashkine46c0da2014-02-07 18:34:37 -08001756 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001757 @PublicKey
Zhijun He421ddbe2014-05-29 13:41:49 -07001758 public static final Key<int[]> REQUEST_AVAILABLE_CAPABILITIES =
1759 new Key<int[]>("android.request.availableCapabilities", int[].class);
Igor Murashkine46c0da2014-02-07 18:34:37 -08001760
1761 /**
1762 * <p>A list of all keys that the camera device has available
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001763 * to use with {@link android.hardware.camera2.CaptureRequest }.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001764 * <p>Attempting to set a key into a CaptureRequest that is not
1765 * listed here will result in an invalid request and will be rejected
1766 * by the camera device.</p>
1767 * <p>This field can be used to query the feature set of a camera device
1768 * at a more granular level than capabilities. This is especially
1769 * important for optional keys that are not listed under any capability
1770 * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001771 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001772 *
1773 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1774 * @hide
1775 */
1776 public static final Key<int[]> REQUEST_AVAILABLE_REQUEST_KEYS =
1777 new Key<int[]>("android.request.availableRequestKeys", int[].class);
1778
1779 /**
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001780 * <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 -08001781 * <p>Attempting to get a key from a CaptureResult that is not
1782 * listed here will always return a <code>null</code> value. Getting a key from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001783 * a CaptureResult that is listed here will generally never return a <code>null</code>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001784 * value.</p>
1785 * <p>The following keys may return <code>null</code> unless they are enabled:</p>
1786 * <ul>
Ruben Brunk57493682014-05-27 18:58:08 -07001787 * <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 -08001788 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001789 * <p>(Those sometimes-null keys will nevertheless be listed here
Igor Murashkine46c0da2014-02-07 18:34:37 -08001790 * if they are available.)</p>
1791 * <p>This field can be used to query the feature set of a camera device
1792 * at a more granular level than capabilities. This is especially
1793 * important for optional keys that are not listed under any capability
1794 * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001795 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001796 *
1797 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkine46c0da2014-02-07 18:34:37 -08001798 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
1799 * @hide
1800 */
1801 public static final Key<int[]> REQUEST_AVAILABLE_RESULT_KEYS =
1802 new Key<int[]>("android.request.availableResultKeys", int[].class);
1803
1804 /**
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001805 * <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 -08001806 * <p>This entry follows the same rules as
1807 * android.request.availableResultKeys (except that it applies for
1808 * CameraCharacteristics instead of CaptureResult). See above for more
1809 * details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001810 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001811 * @hide
1812 */
1813 public static final Key<int[]> REQUEST_AVAILABLE_CHARACTERISTICS_KEYS =
1814 new Key<int[]>("android.request.availableCharacteristicsKeys", int[].class);
1815
1816 /**
Emilian Peev75a55702017-11-07 16:09:59 +00001817 * <p>A subset of the available request keys that the camera device
1818 * can pass as part of the capture session initialization.</p>
1819 * <p>This is a subset of android.request.availableRequestKeys which
1820 * contains a list of keys that are difficult to apply per-frame and
1821 * can result in unexpected delays when modified during the capture session
1822 * lifetime. Typical examples include parameters that require a
1823 * time-consuming hardware re-configuration or internal camera pipeline
1824 * change. For performance reasons we advise clients to pass their initial
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08001825 * values as part of
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001826 * {@link SessionConfiguration#setSessionParameters }.
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08001827 * Once the camera capture session is enabled it is also recommended to avoid
Emilian Peev75a55702017-11-07 16:09:59 +00001828 * changing them from their initial values set in
1829 * {@link SessionConfiguration#setSessionParameters }.
1830 * Control over session parameters can still be exerted in capture requests
1831 * but clients should be aware and expect delays during their application.
1832 * An example usage scenario could look like this:</p>
1833 * <ul>
1834 * <li>The camera client starts by quering the session parameter key list via
1835 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
1836 * <li>Before triggering the capture session create sequence, a capture request
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08001837 * must be built via
1838 * {@link CameraDevice#createCaptureRequest }
1839 * using an appropriate template matching the particular use case.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00001840 * <li>The client should go over the list of session parameters and check
1841 * whether some of the keys listed matches with the parameters that
1842 * they intend to modify as part of the first capture request.</li>
1843 * <li>If there is no such match, the capture request can be passed
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08001844 * unmodified to
1845 * {@link SessionConfiguration#setSessionParameters }.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00001846 * <li>If matches do exist, the client should update the respective values
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08001847 * and pass the request to
1848 * {@link SessionConfiguration#setSessionParameters }.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00001849 * <li>After the capture session initialization completes the session parameter
1850 * key list can continue to serve as reference when posting or updating
1851 * further requests. As mentioned above further changes to session
1852 * parameters should ideally be avoided, if updates are necessary
1853 * however clients could expect a delay/glitch during the
1854 * parameter switch.</li>
1855 * </ul>
1856 * <p>This key is available on all devices.</p>
1857 * @hide
1858 */
1859 public static final Key<int[]> REQUEST_AVAILABLE_SESSION_KEYS =
1860 new Key<int[]>("android.request.availableSessionKeys", int[].class);
1861
1862 /**
koprivadebd4ee2018-09-13 10:59:46 -07001863 * <p>A subset of the available request keys that can be overridden for
Emilian Peev2100ae72018-01-12 16:56:25 +00001864 * physical devices backing a logical multi-camera.</p>
1865 * <p>This is a subset of android.request.availableRequestKeys which contains a list
koprivadebd4ee2018-09-13 10:59:46 -07001866 * of keys that can be overridden using {@link CaptureRequest.Builder#setPhysicalCameraKey }.
Emilian Peev2100ae72018-01-12 16:56:25 +00001867 * The respective value of such request key can be obtained by calling
1868 * {@link CaptureRequest.Builder#getPhysicalCameraKey }. Capture requests that contain
1869 * individual physical device requests must be built via
Emilian Peevf60f4fb2018-02-08 17:40:48 +00001870 * {@link android.hardware.camera2.CameraDevice#createCaptureRequest(int, Set)}.</p>
Emilian Peev2100ae72018-01-12 16:56:25 +00001871 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1872 * <p><b>Limited capability</b> -
1873 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1874 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1875 *
1876 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1877 * @hide
1878 */
1879 public static final Key<int[]> REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS =
1880 new Key<int[]>("android.request.availablePhysicalCameraRequestKeys", int[].class);
1881
1882 /**
Zhijun Hef3b16df2014-01-17 13:37:59 -08001883 * <p>The list of image formats that are supported by this
Igor Murashkin418f6df2014-02-07 18:20:48 -08001884 * camera device for output streams.</p>
Zhijun Hef3b16df2014-01-17 13:37:59 -08001885 * <p>All camera devices will support JPEG and YUV_420_888 formats.</p>
1886 * <p>When set to YUV_420_888, application can access the YUV420 data directly.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001887 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001888 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001889 * <p>Not used in HALv3 or newer</p>
1890
Igor Murashkin9c595172014-05-12 13:56:20 -07001891 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001892 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001893 @Deprecated
Igor Murashkinb519cc52013-07-02 11:23:44 -07001894 public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
1895 new Key<int[]>("android.scaler.availableFormats", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001896
1897 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001898 * <p>The minimum frame duration that is supported
Igor Murashkin9c595172014-05-12 13:56:20 -07001899 * for each resolution in android.scaler.availableJpegSizes.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08001900 * <p>This corresponds to the minimum steady-state frame duration when only
1901 * that JPEG stream is active and captured in a burst, with all
1902 * processing (typically in android.*.mode) set to FAST.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001903 * <p>When multiple streams are configured, the minimum
1904 * frame duration will be &gt;= max(individual stream min
1905 * durations)</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001906 * <p><b>Units</b>: Nanoseconds</p>
1907 * <p><b>Range of valid values:</b><br>
1908 * TODO: Remove property.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001909 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001910 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001911 * <p>Not used in HALv3 or newer</p>
1912
Igor Murashkin9c595172014-05-12 13:56:20 -07001913 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001914 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001915 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001916 public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
1917 new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001918
1919 /**
Zhijun Hef3b16df2014-01-17 13:37:59 -08001920 * <p>The JPEG resolutions that are supported by this camera device.</p>
1921 * <p>The resolutions are listed as <code>(width, height)</code> pairs. All camera devices will support
1922 * 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 -07001923 * <p><b>Range of valid values:</b><br>
1924 * TODO: Remove property.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001925 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Zhijun Hef3b16df2014-01-17 13:37:59 -08001926 *
1927 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Igor Murashkin9c595172014-05-12 13:56:20 -07001928 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001929 * <p>Not used in HALv3 or newer</p>
1930
Igor Murashkin9c595172014-05-12 13:56:20 -07001931 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001932 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001933 @Deprecated
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001934 public static final Key<android.util.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
1935 new Key<android.util.Size[]>("android.scaler.availableJpegSizes", android.util.Size[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001936
1937 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001938 * <p>The maximum ratio between both active area width
1939 * and crop region width, and active area height and
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001940 * crop region height, for {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001941 * <p>This represents the maximum amount of zooming possible by
1942 * the camera device, or equivalently, the minimum cropping
1943 * window size.</p>
1944 * <p>Crop regions that have a width or height that is smaller
1945 * than this ratio allows will be rounded up to the minimum
1946 * allowed size by the camera device.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001947 * <p><b>Units</b>: Zoom scale factor</p>
1948 * <p><b>Range of valid values:</b><br>
1949 * &gt;=1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001950 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001951 *
1952 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001953 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001954 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001955 public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM =
1956 new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001957
1958 /**
Igor Murashkin143aa0b2014-01-17 15:02:34 -08001959 * <p>For each available processed output size (defined in
Igor Murashkin9c595172014-05-12 13:56:20 -07001960 * android.scaler.availableProcessedSizes), this property lists the
Igor Murashkin143aa0b2014-01-17 15:02:34 -08001961 * minimum supportable frame duration for that size.</p>
1962 * <p>This should correspond to the frame duration when only that processed
1963 * stream is active, with all processing (typically in android.*.mode)
1964 * set to FAST.</p>
1965 * <p>When multiple streams are configured, the minimum frame duration will
1966 * be &gt;= max(individual stream min durations).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001967 * <p><b>Units</b>: Nanoseconds</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001968 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001969 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001970 * <p>Not used in HALv3 or newer</p>
1971
Igor Murashkin9c595172014-05-12 13:56:20 -07001972 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001973 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001974 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001975 public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
1976 new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001977
1978 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001979 * <p>The resolutions available for use with
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001980 * processed output streams, such as YV12, NV12, and
1981 * platform opaque YUV/RGB streams to the GPU or video
Zhijun Hef3b16df2014-01-17 13:37:59 -08001982 * encoders.</p>
1983 * <p>The resolutions are listed as <code>(width, height)</code> pairs.</p>
1984 * <p>For a given use case, the actual maximum supported resolution
1985 * may be lower than what is listed here, depending on the destination
1986 * Surface for the image data. For example, for recording video,
1987 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
1988 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
1989 * can provide.</p>
1990 * <p>Please reference the documentation for the image data destination to
1991 * check if it limits the maximum size for image data.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001992 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001993 * @deprecated
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07001994 * <p>Not used in HALv3 or newer</p>
1995
Igor Murashkin9c595172014-05-12 13:56:20 -07001996 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001997 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001998 @Deprecated
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001999 public static final Key<android.util.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
2000 new Key<android.util.Size[]>("android.scaler.availableProcessedSizes", android.util.Size[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002001
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002002 /**
Igor Murashkin418f6df2014-02-07 18:20:48 -08002003 * <p>The mapping of image formats that are supported by this
2004 * camera device for input streams, to their corresponding output formats.</p>
2005 * <p>All camera devices with at least 1
Zhijun He0e99c222015-01-29 15:26:05 -08002006 * {@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} will have at least one
Igor Murashkin418f6df2014-02-07 18:20:48 -08002007 * available input format.</p>
2008 * <p>The camera device will support the following map of formats,
Zhijun He0e99c222015-01-29 15:26:05 -08002009 * if its dependent capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002010 * <table>
2011 * <thead>
2012 * <tr>
2013 * <th align="left">Input Format</th>
2014 * <th align="left">Output Format</th>
2015 * <th align="left">Capability</th>
2016 * </tr>
2017 * </thead>
2018 * <tbody>
2019 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002020 * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
2021 * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07002022 * <td align="left">PRIVATE_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002023 * </tr>
2024 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002025 * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
2026 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07002027 * <td align="left">PRIVATE_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002028 * </tr>
2029 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002030 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2031 * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
Zhijun He0e99c222015-01-29 15:26:05 -08002032 * <td align="left">YUV_REPROCESSING</td>
2033 * </tr>
2034 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002035 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2036 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Zhijun He0e99c222015-01-29 15:26:05 -08002037 * <td align="left">YUV_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08002038 * </tr>
2039 * </tbody>
2040 * </table>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002041 * <p>PRIVATE refers to a device-internal format that is not directly application-visible. A
Chien-Yu Chen8062d312015-05-12 14:24:10 -07002042 * PRIVATE input surface can be acquired by {@link android.media.ImageReader#newInstance }
2043 * with {@link android.graphics.ImageFormat#PRIVATE } as the format.</p>
2044 * <p>For a PRIVATE_REPROCESSING-capable camera device, using the PRIVATE format as either input
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002045 * 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 -08002046 * <p>Attempting to configure an input stream with output streams not
2047 * listed as available in this map is not valid.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002048 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002049 *
Zhijun He0e99c222015-01-29 15:26:05 -08002050 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2051 * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
Igor Murashkin9c595172014-05-12 13:56:20 -07002052 * @hide
Igor Murashkin418f6df2014-02-07 18:20:48 -08002053 */
Chien-Yu Chen0a551f12015-04-03 17:57:35 -07002054 public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP =
2055 new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
Igor Murashkin418f6df2014-02-07 18:20:48 -08002056
2057 /**
Igor Murashkina23ffb52014-02-07 18:52:34 -08002058 * <p>The available stream configurations that this
2059 * camera device supports
2060 * (i.e. format, width, height, output/input stream).</p>
2061 * <p>The configurations are listed as <code>(format, width, height, input?)</code>
2062 * tuples.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002063 * <p>For a given use case, the actual maximum supported resolution
2064 * may be lower than what is listed here, depending on the destination
2065 * Surface for the image data. For example, for recording video,
2066 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2067 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2068 * can provide.</p>
2069 * <p>Please reference the documentation for the image data destination to
2070 * check if it limits the maximum size for image data.</p>
2071 * <p>Not all output formats may be supported in a configuration with
2072 * an input stream of a particular format. For more details, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002073 * android.scaler.availableInputOutputFormatsMap.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002074 * <p>The following table describes the minimum required output stream
2075 * configurations based on the hardware level
2076 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
2077 * <table>
2078 * <thead>
2079 * <tr>
2080 * <th align="center">Format</th>
2081 * <th align="center">Size</th>
2082 * <th align="center">Hardware Level</th>
2083 * <th align="center">Notes</th>
2084 * </tr>
2085 * </thead>
2086 * <tbody>
2087 * <tr>
2088 * <td align="center">JPEG</td>
2089 * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
2090 * <td align="center">Any</td>
2091 * <td align="center"></td>
2092 * </tr>
2093 * <tr>
2094 * <td align="center">JPEG</td>
2095 * <td align="center">1920x1080 (1080p)</td>
2096 * <td align="center">Any</td>
2097 * <td align="center">if 1080p &lt;= activeArraySize</td>
2098 * </tr>
2099 * <tr>
2100 * <td align="center">JPEG</td>
2101 * <td align="center">1280x720 (720)</td>
2102 * <td align="center">Any</td>
2103 * <td align="center">if 720p &lt;= activeArraySize</td>
2104 * </tr>
2105 * <tr>
2106 * <td align="center">JPEG</td>
2107 * <td align="center">640x480 (480p)</td>
2108 * <td align="center">Any</td>
2109 * <td align="center">if 480p &lt;= activeArraySize</td>
2110 * </tr>
2111 * <tr>
2112 * <td align="center">JPEG</td>
2113 * <td align="center">320x240 (240p)</td>
2114 * <td align="center">Any</td>
2115 * <td align="center">if 240p &lt;= activeArraySize</td>
2116 * </tr>
2117 * <tr>
2118 * <td align="center">YUV_420_888</td>
2119 * <td align="center">all output sizes available for JPEG</td>
2120 * <td align="center">FULL</td>
2121 * <td align="center"></td>
2122 * </tr>
2123 * <tr>
2124 * <td align="center">YUV_420_888</td>
2125 * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
2126 * <td align="center">LIMITED</td>
2127 * <td align="center"></td>
2128 * </tr>
2129 * <tr>
2130 * <td align="center">IMPLEMENTATION_DEFINED</td>
2131 * <td align="center">same as YUV_420_888</td>
2132 * <td align="center">Any</td>
2133 * <td align="center"></td>
2134 * </tr>
2135 * </tbody>
2136 * </table>
2137 * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional
2138 * mandatory stream configurations on a per-capability basis.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002139 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002140 *
2141 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2142 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkina23ffb52014-02-07 18:52:34 -08002143 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Igor Murashkin9c595172014-05-12 13:56:20 -07002144 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08002145 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002146 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS =
2147 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08002148
2149 /**
2150 * <p>This lists the minimum frame duration for each
2151 * format/size combination.</p>
2152 * <p>This should correspond to the frame duration when only that
2153 * stream is active, with all processing (typically in android.*.mode)
2154 * set to either OFF or FAST.</p>
2155 * <p>When multiple streams are used in a request, the minimum frame
2156 * duration will be max(individual stream min durations).</p>
2157 * <p>The minimum frame duration of a stream (of a particular format, size)
2158 * is the same regardless of whether the stream is input or output.</p>
2159 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
Igor Murashkin9c595172014-05-12 13:56:20 -07002160 * android.scaler.availableStallDurations for more details about
Igor Murashkina23ffb52014-02-07 18:52:34 -08002161 * calculating the max frame rate.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002162 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002163 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002164 *
Igor Murashkina23ffb52014-02-07 18:52:34 -08002165 * @see CaptureRequest#SENSOR_FRAME_DURATION
Igor Murashkin9c595172014-05-12 13:56:20 -07002166 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08002167 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002168 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS =
2169 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08002170
2171 /**
2172 * <p>This lists the maximum stall duration for each
Zhijun He513f7c32015-04-24 18:23:54 -07002173 * output format/size combination.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002174 * <p>A stall duration is how much extra time would get added
2175 * to the normal minimum frame duration for a repeating request
2176 * that has streams with non-zero stall.</p>
2177 * <p>For example, consider JPEG captures which have the following
2178 * characteristics:</p>
2179 * <ul>
2180 * <li>JPEG streams act like processed YUV streams in requests for which
2181 * they are not included; in requests in which they are directly
2182 * referenced, they act as JPEG streams. This is because supporting a
2183 * JPEG stream requires the underlying YUV data to always be ready for
2184 * use by a JPEG encoder, but the encoder will only be used (and impact
2185 * frame duration) on requests that actually reference a JPEG stream.</li>
2186 * <li>The JPEG processor can run concurrently to the rest of the camera
2187 * pipeline, but cannot process more than 1 capture at a time.</li>
2188 * </ul>
2189 * <p>In other words, using a repeating YUV request would result
2190 * in a steady frame rate (let's say it's 30 FPS). If a single
2191 * JPEG request is submitted periodically, the frame rate will stay
2192 * at 30 FPS (as long as we wait for the previous JPEG to return each
2193 * time). If we try to submit a repeating YUV + JPEG request, then
2194 * the frame rate will drop from 30 FPS.</p>
2195 * <p>In general, submitting a new request with a non-0 stall time
2196 * stream will <em>not</em> cause a frame rate drop unless there are still
2197 * outstanding buffers for that stream from previous requests.</p>
2198 * <p>Submitting a repeating request with streams (call this <code>S</code>)
2199 * is the same as setting the minimum frame duration from
2200 * the normal minimum frame duration corresponding to <code>S</code>, added with
2201 * the maximum stall duration for <code>S</code>.</p>
2202 * <p>If interleaving requests with and without a stall duration,
2203 * a request will stall by the maximum of the remaining times
2204 * for each can-stall stream with outstanding buffers.</p>
2205 * <p>This means that a stalling request will not have an exposure start
2206 * until the stall has completed.</p>
2207 * <p>This should correspond to the stall duration when only that stream is
2208 * active, with all processing (typically in android.*.mode) set to FAST
2209 * or OFF. Setting any of the processing modes to HIGH_QUALITY
2210 * effectively results in an indeterminate stall duration for all
2211 * streams in a request (the regular stall calculation rules are
2212 * ignored).</p>
2213 * <p>The following formats may always have a stall duration:</p>
2214 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002215 * <li>{@link android.graphics.ImageFormat#JPEG }</li>
2216 * <li>{@link android.graphics.ImageFormat#RAW_SENSOR }</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002217 * </ul>
2218 * <p>The following formats will never have a stall duration:</p>
2219 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002220 * <li>{@link android.graphics.ImageFormat#YUV_420_888 }</li>
2221 * <li>{@link android.graphics.ImageFormat#RAW10 }</li>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002222 * <li>{@link android.graphics.ImageFormat#RAW12 }</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002223 * </ul>
2224 * <p>All other formats may or may not have an allowed stall duration on
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002225 * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Igor Murashkina23ffb52014-02-07 18:52:34 -08002226 * for more details.</p>
2227 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} for more information about
2228 * calculating the max frame rate (absent stalls).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002229 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002230 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002231 *
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002232 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkina23ffb52014-02-07 18:52:34 -08002233 * @see CaptureRequest#SENSOR_FRAME_DURATION
Igor Murashkin9c595172014-05-12 13:56:20 -07002234 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08002235 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002236 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS =
2237 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
2238
2239 /**
2240 * <p>The available stream configurations that this
2241 * camera device supports; also includes the minimum frame durations
2242 * and the stall durations for each format/size combination.</p>
2243 * <p>All camera devices will support sensor maximum resolution (defined by
2244 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.</p>
2245 * <p>For a given use case, the actual maximum supported resolution
2246 * may be lower than what is listed here, depending on the destination
2247 * Surface for the image data. For example, for recording video,
2248 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2249 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2250 * can provide.</p>
2251 * <p>Please reference the documentation for the image data destination to
2252 * check if it limits the maximum size for image data.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002253 * <p>The following table describes the minimum required output stream
2254 * configurations based on the hardware level
2255 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
2256 * <table>
2257 * <thead>
2258 * <tr>
2259 * <th align="center">Format</th>
2260 * <th align="center">Size</th>
2261 * <th align="center">Hardware Level</th>
2262 * <th align="center">Notes</th>
2263 * </tr>
2264 * </thead>
2265 * <tbody>
2266 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002267 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002268 * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} (*1)</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002269 * <td align="center">Any</td>
2270 * <td align="center"></td>
2271 * </tr>
2272 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002273 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002274 * <td align="center">1920x1080 (1080p)</td>
2275 * <td align="center">Any</td>
2276 * <td align="center">if 1080p &lt;= activeArraySize</td>
2277 * </tr>
2278 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002279 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002280 * <td align="center">1280x720 (720p)</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002281 * <td align="center">Any</td>
2282 * <td align="center">if 720p &lt;= activeArraySize</td>
2283 * </tr>
2284 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002285 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002286 * <td align="center">640x480 (480p)</td>
2287 * <td align="center">Any</td>
2288 * <td align="center">if 480p &lt;= activeArraySize</td>
2289 * </tr>
2290 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002291 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002292 * <td align="center">320x240 (240p)</td>
2293 * <td align="center">Any</td>
2294 * <td align="center">if 240p &lt;= activeArraySize</td>
2295 * </tr>
2296 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002297 * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002298 * <td align="center">all output sizes available for JPEG</td>
2299 * <td align="center">FULL</td>
2300 * <td align="center"></td>
2301 * </tr>
2302 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002303 * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002304 * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
2305 * <td align="center">LIMITED</td>
2306 * <td align="center"></td>
2307 * </tr>
2308 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002309 * <td align="center">{@link android.graphics.ImageFormat#PRIVATE }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002310 * <td align="center">same as YUV_420_888</td>
2311 * <td align="center">Any</td>
2312 * <td align="center"></td>
2313 * </tr>
2314 * </tbody>
2315 * </table>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002316 * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} and {@link android.hardware.camera2.CameraDevice#createCaptureSession } for additional mandatory
2317 * stream configurations on a per-capability basis.</p>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002318 * <p>*1: For JPEG format, the sizes may be restricted by below conditions:</p>
2319 * <ul>
2320 * <li>The HAL may choose the aspect ratio of each Jpeg size to be one of well known ones
2321 * (e.g. 4:3, 16:9, 3:2 etc.). If the sensor maximum resolution
2322 * (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) has an aspect ratio other than these,
2323 * it does not have to be included in the supported JPEG sizes.</li>
2324 * <li>Some hardware JPEG encoders may have pixel boundary alignment requirements, such as
2325 * the dimensions being a multiple of 16.
2326 * Therefore, the maximum JPEG size may be smaller than sensor maximum resolution.
2327 * However, the largest JPEG size will be as close as possible to the sensor maximum
2328 * resolution given above constraints. It is required that after aspect ratio adjustments,
2329 * additional size reduction due to other issues must be less than 3% in area. For example,
2330 * if the sensor maximum resolution is 3280x2464, if the maximum JPEG size has aspect
2331 * ratio 4:3, and the JPEG encoder alignment requirement is 16, the maximum JPEG size will be
2332 * 3264x2448.</li>
2333 * </ul>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002334 * <p>This key is available on all devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002335 *
2336 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2337 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2338 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2339 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002340 @PublicKey
2341 @SyntheticKey
Igor Murashkin9c595172014-05-12 13:56:20 -07002342 public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP =
2343 new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08002344
2345 /**
Zhijun He14986152014-05-22 21:17:37 -07002346 * <p>The crop type that this camera device supports.</p>
2347 * <p>When passing a non-centered crop region ({@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}) to a camera
2348 * device that only supports CENTER_ONLY cropping, the camera device will move the
2349 * crop region to the center of the sensor active array ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize})
2350 * and keep the crop region width and height unchanged. The camera device will return the
2351 * final used crop region in metadata result {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
2352 * <p>Camera devices that support FREEFORM cropping will support any crop region that
2353 * is inside of the active array. The camera device will apply the same crop region and
2354 * return the final used crop region in capture result metadata {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
Eino-Ville Talvala81e89282015-06-30 16:34:24 -07002355 * <p>LEGACY capability devices will only support CENTER_ONLY cropping.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002356 * <p><b>Possible values:</b>
2357 * <ul>
2358 * <li>{@link #SCALER_CROPPING_TYPE_CENTER_ONLY CENTER_ONLY}</li>
2359 * <li>{@link #SCALER_CROPPING_TYPE_FREEFORM FREEFORM}</li>
2360 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002361 * <p>This key is available on all devices.</p>
Zhijun He14986152014-05-22 21:17:37 -07002362 *
Zhijun He14986152014-05-22 21:17:37 -07002363 * @see CaptureRequest#SCALER_CROP_REGION
2364 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2365 * @see #SCALER_CROPPING_TYPE_CENTER_ONLY
2366 * @see #SCALER_CROPPING_TYPE_FREEFORM
2367 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002368 @PublicKey
Zhijun He14986152014-05-22 21:17:37 -07002369 public static final Key<Integer> SCALER_CROPPING_TYPE =
2370 new Key<Integer>("android.scaler.croppingType", int.class);
2371
2372 /**
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002373 * <p>The area of the image sensor which corresponds to active pixels after any geometric
2374 * distortion correction has been applied.</p>
2375 * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2376 * the region that actually receives light from the scene) after any geometric correction
2377 * has been applied, and should be treated as the maximum size in pixels of any of the
2378 * image output formats aside from the raw formats.</p>
2379 * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
2380 * the full pixel array, and the size of the full pixel array is given by
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002381 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002382 * <p>The coordinate system for most other keys that list pixel coordinates, including
2383 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, is defined relative to the active array rectangle given in
2384 * this field, with <code>(0, 0)</code> being the top-left of this rectangle.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002385 * <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 -07002386 * include black calibration pixels or other inactive regions.</p>
2387 * <p>For devices that do not support {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the active
2388 * array must be the same as {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.</p>
2389 * <p>For devices that support {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the active array must
2390 * be enclosed by {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}. The difference between
2391 * pre-correction active array and active array accounts for scaling or cropping caused
2392 * by lens geometric distortion correction.</p>
2393 * <p>In general, application should always refer to active array size for controls like
2394 * metering regions or crop region. Two exceptions are when the application is dealing with
2395 * RAW image buffers (RAW_SENSOR, RAW10, RAW12 etc), or when application explicitly set
2396 * {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} to OFF. In these cases, application should refer
2397 * to {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002398 * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002399 * <p>This key is available on all devices.</p>
2400 *
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002401 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002402 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002403 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002404 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002405 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002406 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002407 public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE =
2408 new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002409
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002410 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002411 * <p>Range of sensitivities for {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} supported by this
2412 * camera device.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002413 * <p>The values are the standard ISO sensitivity values,
2414 * as defined in ISO 12232:2006.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002415 * <p><b>Range of valid values:</b><br>
2416 * Min &lt;= 100, Max &gt;= 800</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002417 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2418 * <p><b>Full capability</b> -
2419 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2420 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002421 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002422 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002423 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002424 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002425 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07002426 public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE =
2427 new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002428
2429 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002430 * <p>The arrangement of color filters on sensor;
Zhijun Hed1784962014-04-08 17:41:46 -07002431 * represents the colors in the top-left 2x2 section of
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002432 * the sensor, in reading order.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002433 * <p><b>Possible values:</b>
2434 * <ul>
2435 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB RGGB}</li>
2436 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG GRBG}</li>
2437 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG GBRG}</li>
2438 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR BGGR}</li>
2439 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB RGB}</li>
2440 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002441 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2442 * <p><b>Full capability</b> -
2443 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2444 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2445 *
2446 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Hed1784962014-04-08 17:41:46 -07002447 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB
2448 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG
2449 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG
2450 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR
2451 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB
2452 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002453 @PublicKey
Zhijun Hed1784962014-04-08 17:41:46 -07002454 public static final Key<Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT =
2455 new Key<Integer>("android.sensor.info.colorFilterArrangement", int.class);
2456
2457 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002458 * <p>The range of image exposure times for {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} supported
2459 * by this camera device.</p>
2460 * <p><b>Units</b>: Nanoseconds</p>
2461 * <p><b>Range of valid values:</b><br>
2462 * The minimum exposure time will be less than 100 us. For FULL
Zhijun He28288ca2014-06-25 15:49:13 -07002463 * capability devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL),
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002464 * the maximum exposure time will be greater than 100ms.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002465 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2466 * <p><b>Full capability</b> -
2467 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2468 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08002469 *
Zhijun He28288ca2014-06-25 15:49:13 -07002470 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08002471 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002472 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002473 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07002474 public static final Key<android.util.Range<Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE =
2475 new Key<android.util.Range<Long>>("android.sensor.info.exposureTimeRange", new TypeReference<android.util.Range<Long>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002476
2477 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002478 * <p>The maximum possible frame duration (minimum frame rate) for
2479 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} that is supported this camera device.</p>
2480 * <p>Attempting to use frame durations beyond the maximum will result in the frame
2481 * duration being clipped to the maximum. See that control for a full definition of frame
2482 * durations.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002483 * <p>Refer to {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
2484 * for the minimum frame duration values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002485 * <p><b>Units</b>: Nanoseconds</p>
2486 * <p><b>Range of valid values:</b><br>
2487 * For FULL capability devices
2488 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL), at least 100ms.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002489 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2490 * <p><b>Full capability</b> -
2491 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2492 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08002493 *
Zhijun He28288ca2014-06-25 15:49:13 -07002494 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002495 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002496 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002497 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002498 public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION =
2499 new Key<Long>("android.sensor.info.maxFrameDuration", long.class);
2500
2501 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002502 * <p>The physical dimensions of the full pixel
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002503 * array.</p>
2504 * <p>This is the physical size of the sensor pixel
2505 * array defined by {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002506 * <p><b>Units</b>: Millimeters</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002507 * <p>This key is available on all devices.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002508 *
2509 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002510 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002511 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002512 public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE =
2513 new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002514
2515 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002516 * <p>Dimensions of the full pixel array, possibly
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002517 * including black calibration pixels.</p>
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002518 * <p>The pixel count of the full pixel array of the image sensor, which covers
2519 * {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area. This represents the full pixel dimensions of
2520 * the raw buffers produced by this sensor.</p>
2521 * <p>If a camera device supports raw sensor formats, either this or
2522 * {@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 -08002523 * output formats listed in {@link android.hardware.camera2.params.StreamConfigurationMap }
2524 * (this depends on whether or not the image sensor returns buffers containing pixels that
2525 * are not part of the active array region for blacklevel calibration or other purposes).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002526 * <p>Some parts of the full pixel array may not receive light from the scene,
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002527 * or be otherwise inactive. The {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} key
2528 * defines the rectangle of active pixels that will be included in processed image
2529 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002530 * <p><b>Units</b>: Pixels</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002531 * <p>This key is available on all devices.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002532 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002533 * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002534 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002535 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002536 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002537 public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE =
2538 new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class);
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002539
2540 /**
Ruben Brunke60e29552014-02-18 10:44:17 -08002541 * <p>Maximum raw value output by sensor.</p>
2542 * <p>This specifies the fully-saturated encoding level for the raw
2543 * sample values from the sensor. This is typically caused by the
2544 * sensor becoming highly non-linear or clipping. The minimum for
2545 * each channel is specified by the offset in the
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002546 * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} key.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08002547 * <p>The white level is typically determined either by sensor bit depth
Ruben Brunke89b1202014-03-24 17:10:35 -07002548 * (8-14 bits is expected), or by the point where the sensor response
Ruben Brunke60e29552014-02-18 10:44:17 -08002549 * becomes too non-linear to be useful. The default value for this is
2550 * maximum representable value for a 16-bit raw sample (2^16 - 1).</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08002551 * <p>The white level values of captured images may vary for different
2552 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
2553 * represents a coarse approximation for such case. It is recommended
2554 * to use {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} for captures when supported
2555 * by the camera device, which provides more accurate white level values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002556 * <p><b>Range of valid values:</b><br>
2557 * &gt; 255 (8-bit output)</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002558 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08002559 *
2560 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
Zhijun Hecd950b62015-11-12 17:47:52 -08002561 * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
2562 * @see CaptureRequest#SENSOR_SENSITIVITY
Ruben Brunke60e29552014-02-18 10:44:17 -08002563 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002564 @PublicKey
Ruben Brunke60e29552014-02-18 10:44:17 -08002565 public static final Key<Integer> SENSOR_INFO_WHITE_LEVEL =
2566 new Key<Integer>("android.sensor.info.whiteLevel", int.class);
2567
2568 /**
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002569 * <p>The time base source for sensor capture start timestamps.</p>
2570 * <p>The timestamps provided for captures are always in nanoseconds and monotonic, but
2571 * may not based on a time source that can be compared to other system time sources.</p>
2572 * <p>This characteristic defines the source for the timestamps, and therefore whether they
2573 * can be compared against other system time sources/timestamps.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002574 * <p><b>Possible values:</b>
2575 * <ul>
2576 * <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN UNKNOWN}</li>
2577 * <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME REALTIME}</li>
2578 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002579 * <p>This key is available on all devices.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002580 * @see #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN
2581 * @see #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME
Zhijun He45fa43a12014-06-13 18:29:37 -07002582 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002583 @PublicKey
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002584 public static final Key<Integer> SENSOR_INFO_TIMESTAMP_SOURCE =
2585 new Key<Integer>("android.sensor.info.timestampSource", int.class);
Zhijun He45fa43a12014-06-13 18:29:37 -07002586
2587 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002588 * <p>Whether the RAW images output from this camera device are subject to
2589 * lens shading correction.</p>
2590 * <p>If TRUE, all images produced by the camera device in the RAW image formats will
2591 * have lens shading correction already applied to it. If FALSE, the images will
2592 * not be adjusted for lens shading correction.
2593 * See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image formats.</p>
2594 * <p>This key will be <code>null</code> for all devices do not report this information.
2595 * Devices with RAW capability will always report this information in this key.</p>
2596 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2597 *
2598 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
2599 */
2600 @PublicKey
2601 public static final Key<Boolean> SENSOR_INFO_LENS_SHADING_APPLIED =
2602 new Key<Boolean>("android.sensor.info.lensShadingApplied", boolean.class);
2603
2604 /**
Ruben Brunk1b02df42015-07-01 12:53:45 -07002605 * <p>The area of the image sensor which corresponds to active pixels prior to the
2606 * application of any geometric distortion correction.</p>
2607 * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2608 * the region that actually receives light from the scene) before any geometric correction
2609 * has been applied, and should be treated as the active region rectangle for any of the
2610 * raw formats. All metadata associated with raw processing (e.g. the lens shading
2611 * correction map, and radial distortion fields) treats the top, left of this rectangle as
2612 * the origin, (0,0).</p>
2613 * <p>The size of this region determines the maximum field of view and the maximum number of
2614 * pixels that an image from this sensor can contain, prior to the application of
2615 * geometric distortion correction. The effective maximum pixel dimensions of a
2616 * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}
2617 * field, and the effective maximum field of view for a post-distortion-corrected image
2618 * can be calculated by applying the geometric distortion correction fields to this
2619 * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2620 * <p>E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the
2621 * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel,
2622 * (x', y'), in the raw pixel array with dimensions give in
2623 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:</p>
2624 * <ol>
2625 * <li>Choose a pixel (x', y') within the active array region of the raw buffer given in
2626 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, otherwise this pixel is considered
2627 * to be outside of the FOV, and will not be shown in the processed output image.</li>
2628 * <li>Apply geometric distortion correction to get the post-distortion pixel coordinate,
2629 * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw
2630 * buffers is defined relative to the top, left of the
2631 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} rectangle.</li>
2632 * <li>If the resulting corrected pixel coordinate is within the region given in
2633 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the
2634 * processed output image buffer is <code>(x_i - activeArray.left, y_i - activeArray.top)</code>,
2635 * when the top, left coordinate of that buffer is treated as (0, 0).</li>
2636 * </ol>
2637 * <p>Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}
2638 * is (100,100), {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is (10, 10, 100, 100),
2639 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion
2640 * correction doesn't change the pixel coordinate, the resulting pixel selected in
2641 * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer
2642 * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5)
2643 * relative to the top,left of post-processed YUV output buffer with dimensions given in
2644 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2645 * <p>The currently supported fields that correct for geometric distortion are:</p>
2646 * <ol>
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002647 * <li>{@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}.</li>
Ruben Brunk1b02df42015-07-01 12:53:45 -07002648 * </ol>
Yin-Chia Yeh6c73e402018-06-15 15:37:08 -07002649 * <p>If the camera device doesn't support geometric distortion correction, or all of the
2650 * geometric distortion fields are no-ops, this rectangle will be the same as the
2651 * 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 -07002652 * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
2653 * the full pixel array, and the size of the full pixel array is given by
2654 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
2655 * <p>The pre-correction active array may be smaller than the full pixel array, since the
2656 * full array may include black calibration pixels or other inactive regions.</p>
2657 * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
2658 * <p>This key is available on all devices.</p>
2659 *
Eino-Ville Talvala915f5042018-03-13 19:08:01 -07002660 * @see CameraCharacteristics#LENS_DISTORTION
Ruben Brunk1b02df42015-07-01 12:53:45 -07002661 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2662 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2663 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
2664 */
2665 @PublicKey
2666 public static final Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE =
2667 new Key<android.graphics.Rect>("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class);
2668
2669 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002670 * <p>The standard reference illuminant used as the scene light source when
2671 * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
2672 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
2673 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} matrices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002674 * <p>The values in this key correspond to the values defined for the
Ruben Brunk7c062362014-04-15 23:53:53 -07002675 * EXIF LightSource tag. These illuminants are standard light sources
2676 * that are often used calibrating camera devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002677 * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
Ruben Brunk7c062362014-04-15 23:53:53 -07002678 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
2679 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} will also be present.</p>
2680 * <p>Some devices may choose to provide a second set of calibration
2681 * information for improved quality, including
2682 * {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2} and its corresponding matrices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002683 * <p><b>Possible values:</b>
2684 * <ul>
2685 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT DAYLIGHT}</li>
2686 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT FLUORESCENT}</li>
2687 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN TUNGSTEN}</li>
2688 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLASH FLASH}</li>
2689 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER FINE_WEATHER}</li>
2690 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER CLOUDY_WEATHER}</li>
2691 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_SHADE SHADE}</li>
2692 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT DAYLIGHT_FLUORESCENT}</li>
2693 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT DAY_WHITE_FLUORESCENT}</li>
2694 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT COOL_WHITE_FLUORESCENT}</li>
2695 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT WHITE_FLUORESCENT}</li>
2696 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A STANDARD_A}</li>
2697 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B STANDARD_B}</li>
2698 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C STANDARD_C}</li>
2699 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D55 D55}</li>
2700 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D65 D65}</li>
2701 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D75 D75}</li>
2702 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D50 D50}</li>
2703 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN ISO_STUDIO_TUNGSTEN}</li>
2704 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002705 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk7c062362014-04-15 23:53:53 -07002706 *
2707 * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1
2708 * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM1
2709 * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX1
2710 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2711 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT
2712 * @see #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT
2713 * @see #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN
2714 * @see #SENSOR_REFERENCE_ILLUMINANT1_FLASH
2715 * @see #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER
2716 * @see #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER
2717 * @see #SENSOR_REFERENCE_ILLUMINANT1_SHADE
2718 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT
2719 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT
2720 * @see #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT
2721 * @see #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT
2722 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A
2723 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B
2724 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C
2725 * @see #SENSOR_REFERENCE_ILLUMINANT1_D55
2726 * @see #SENSOR_REFERENCE_ILLUMINANT1_D65
2727 * @see #SENSOR_REFERENCE_ILLUMINANT1_D75
2728 * @see #SENSOR_REFERENCE_ILLUMINANT1_D50
2729 * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN
2730 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002731 @PublicKey
Ruben Brunk7c062362014-04-15 23:53:53 -07002732 public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 =
2733 new Key<Integer>("android.sensor.referenceIlluminant1", int.class);
2734
2735 /**
2736 * <p>The standard reference illuminant used as the scene light source when
2737 * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
2738 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
2739 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} matrices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002740 * <p>See {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1} for more details.</p>
2741 * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
Ruben Brunk7c062362014-04-15 23:53:53 -07002742 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
2743 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} will also be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002744 * <p><b>Range of valid values:</b><br>
2745 * Any value listed in {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002746 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk7c062362014-04-15 23:53:53 -07002747 *
2748 * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2
2749 * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM2
2750 * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2
2751 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2752 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002753 @PublicKey
Ruben Brunk7c062362014-04-15 23:53:53 -07002754 public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 =
2755 new Key<Byte>("android.sensor.referenceIlluminant2", byte.class);
2756
2757 /**
2758 * <p>A per-device calibration transform matrix that maps from the
2759 * reference sensor colorspace to the actual device sensor colorspace.</p>
2760 * <p>This matrix is used to correct for per-device variations in the
2761 * sensor colorspace, and is used for processing raw buffer data.</p>
2762 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2763 * contains a per-device calibration transform that maps colors
2764 * from reference sensor color space (i.e. the "golden module"
2765 * colorspace) into this camera device's native sensor color
2766 * space under the first reference illuminant
2767 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
2768 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2769 *
2770 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2771 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002772 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002773 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1 =
2774 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002775
2776 /**
2777 * <p>A per-device calibration transform matrix that maps from the
2778 * reference sensor colorspace to the actual device sensor colorspace
2779 * (this is the colorspace of the raw buffer data).</p>
2780 * <p>This matrix is used to correct for per-device variations in the
2781 * sensor colorspace, and is used for processing raw buffer data.</p>
2782 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2783 * contains a per-device calibration transform that maps colors
2784 * from reference sensor color space (i.e. the "golden module"
2785 * colorspace) into this camera device's native sensor color
2786 * space under the second reference illuminant
2787 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
2788 * <p>This matrix will only be present if the second reference
2789 * illuminant is present.</p>
2790 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2791 *
2792 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2793 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002794 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002795 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2 =
2796 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002797
2798 /**
2799 * <p>A matrix that transforms color values from CIE XYZ color space to
2800 * reference sensor color space.</p>
2801 * <p>This matrix is used to convert from the standard CIE XYZ color
2802 * space to the reference sensor colorspace, and is used when processing
2803 * raw buffer data.</p>
2804 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2805 * contains a color transform matrix that maps colors from the CIE
2806 * XYZ color space to the reference sensor color space (i.e. the
2807 * "golden module" colorspace) under the first reference illuminant
2808 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
2809 * <p>The white points chosen in both the reference sensor color space
2810 * and the CIE XYZ colorspace when calculating this transform will
2811 * match the standard white point for the first reference illuminant
2812 * (i.e. no chromatic adaptation will be applied by this transform).</p>
2813 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2814 *
2815 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2816 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002817 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002818 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1 =
2819 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002820
2821 /**
2822 * <p>A matrix that transforms color values from CIE XYZ color space to
2823 * reference sensor color space.</p>
2824 * <p>This matrix is used to convert from the standard CIE XYZ color
2825 * space to the reference sensor colorspace, and is used when processing
2826 * raw buffer data.</p>
2827 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2828 * contains a color transform matrix that maps colors from the CIE
2829 * XYZ color space to the reference sensor color space (i.e. the
2830 * "golden module" colorspace) under the second reference illuminant
2831 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
2832 * <p>The white points chosen in both the reference sensor color space
2833 * and the CIE XYZ colorspace when calculating this transform will
2834 * match the standard white point for the second reference illuminant
2835 * (i.e. no chromatic adaptation will be applied by this transform).</p>
2836 * <p>This matrix will only be present if the second reference
2837 * illuminant is present.</p>
2838 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2839 *
2840 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2841 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002842 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002843 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2 =
2844 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002845
2846 /**
2847 * <p>A matrix that transforms white balanced camera colors from the reference
2848 * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
2849 * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
2850 * is used when processing raw buffer data.</p>
2851 * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
2852 * a color transform matrix that maps white balanced colors from the
2853 * reference sensor color space to the CIE XYZ color space with a D50 white
2854 * point.</p>
2855 * <p>Under the first reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1})
2856 * this matrix is chosen so that the standard white point for this reference
2857 * illuminant in the reference sensor colorspace is mapped to D50 in the
2858 * CIE XYZ colorspace.</p>
2859 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2860 *
2861 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2862 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002863 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002864 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1 =
2865 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002866
2867 /**
2868 * <p>A matrix that transforms white balanced camera colors from the reference
2869 * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
2870 * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
2871 * is used when processing raw buffer data.</p>
2872 * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
2873 * a color transform matrix that maps white balanced colors from the
2874 * reference sensor color space to the CIE XYZ color space with a D50 white
2875 * point.</p>
2876 * <p>Under the second reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2})
2877 * this matrix is chosen so that the standard white point for this reference
2878 * illuminant in the reference sensor colorspace is mapped to D50 in the
2879 * CIE XYZ colorspace.</p>
2880 * <p>This matrix will only be present if the second reference
2881 * illuminant is present.</p>
2882 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2883 *
2884 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2885 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002886 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002887 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2 =
2888 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002889
2890 /**
Ruben Brunk67b47022014-02-07 15:26:29 -08002891 * <p>A fixed black level offset for each of the color filter arrangement
2892 * (CFA) mosaic channels.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002893 * <p>This key specifies the zero light value for each of the CFA mosaic
Ruben Brunke60e29552014-02-18 10:44:17 -08002894 * channels in the camera sensor. The maximal value output by the
2895 * 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 -07002896 * <p>The values are given in the same order as channels listed for the CFA
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002897 * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
Ruben Brunk52842e72014-06-05 13:16:45 -07002898 * nth value given corresponds to the black level offset for the nth
2899 * color channel listed in the CFA.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08002900 * <p>The black level values of captured images may vary for different
2901 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
2902 * represents a coarse approximation for such case. It is recommended to
2903 * use {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} or use pixels from
2904 * {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} directly for captures when
2905 * supported by the camera device, which provides more accurate black
2906 * level values. For raw capture in particular, it is recommended to use
2907 * pixels from {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} to calculate black
2908 * level values for each frame.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002909 * <p><b>Range of valid values:</b><br>
2910 * &gt;= 0 for each.</p>
Ruben Brunk1ef676f2014-02-07 16:08:38 -08002911 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08002912 *
Zhijun Hecd950b62015-11-12 17:47:52 -08002913 * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
Ruben Brunk52842e72014-06-05 13:16:45 -07002914 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
Ruben Brunke60e29552014-02-18 10:44:17 -08002915 * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
Zhijun Hecd950b62015-11-12 17:47:52 -08002916 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
2917 * @see CaptureRequest#SENSOR_SENSITIVITY
Ruben Brunk67b47022014-02-07 15:26:29 -08002918 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002919 @PublicKey
Ruben Brunk52842e72014-06-05 13:16:45 -07002920 public static final Key<android.hardware.camera2.params.BlackLevelPattern> SENSOR_BLACK_LEVEL_PATTERN =
2921 new Key<android.hardware.camera2.params.BlackLevelPattern>("android.sensor.blackLevelPattern", android.hardware.camera2.params.BlackLevelPattern.class);
Ruben Brunk67b47022014-02-07 15:26:29 -08002922
2923 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002924 * <p>Maximum sensitivity that is implemented
Zhijun He153ac102014-02-03 12:25:12 -08002925 * purely through analog gain.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002926 * <p>For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002927 * equal to this, all applied gain must be analog. For
Zhijun He153ac102014-02-03 12:25:12 -08002928 * values above this, the gain applied can be a mix of analog and
2929 * digital.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002930 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002931 * <p><b>Full capability</b> -
2932 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2933 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Alex Raye83c4eb2013-10-02 17:14:36 -07002934 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002935 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002936 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002937 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002938 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002939 public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY =
2940 new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class);
2941
2942 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002943 * <p>Clockwise angle through which the output image needs to be rotated to be
2944 * upright on the device screen in its native orientation.</p>
2945 * <p>Also defines the direction of rolling shutter readout, which is from top to bottom in
2946 * the sensor's coordinate system.</p>
2947 * <p><b>Units</b>: Degrees of clockwise rotation; always a multiple of
2948 * 90</p>
2949 * <p><b>Range of valid values:</b><br>
2950 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002951 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002952 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002953 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002954 public static final Key<Integer> SENSOR_ORIENTATION =
2955 new Key<Integer>("android.sensor.orientation", int.class);
2956
2957 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002958 * <p>List of sensor test pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}
2959 * supported by this camera device.</p>
2960 * <p>Defaults to OFF, and always includes OFF if defined.</p>
2961 * <p><b>Range of valid values:</b><br>
2962 * Any value listed in {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002963 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002964 *
2965 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
Igor Murashkinc127f052014-01-17 18:06:02 -08002966 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002967 @PublicKey
Zhijun Hea4866242014-03-27 23:51:34 -07002968 public static final Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES =
2969 new Key<int[]>("android.sensor.availableTestPatternModes", int[].class);
Igor Murashkinc127f052014-01-17 18:06:02 -08002970
2971 /**
Zhijun Hecd950b62015-11-12 17:47:52 -08002972 * <p>List of disjoint rectangles indicating the sensor
2973 * optically shielded black pixel regions.</p>
2974 * <p>In most camera sensors, the active array is surrounded by some
2975 * optically shielded pixel areas. By blocking light, these pixels
2976 * provides a reliable black reference for black level compensation
2977 * in active array region.</p>
2978 * <p>This key provides a list of disjoint rectangles specifying the
2979 * regions of optically shielded (with metal shield) black pixel
2980 * regions if the camera device is capable of reading out these black
2981 * pixels in the output raw images. In comparison to the fixed black
2982 * level values reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern}, this key
2983 * may provide a more accurate way for the application to calculate
2984 * black level of each captured raw images.</p>
2985 * <p>When this key is reported, the {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} and
2986 * {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} will also be reported.</p>
2987 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2988 *
2989 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
2990 * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
2991 * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
2992 */
2993 @PublicKey
2994 public static final Key<android.graphics.Rect[]> SENSOR_OPTICAL_BLACK_REGIONS =
2995 new Key<android.graphics.Rect[]>("android.sensor.opticalBlackRegions", android.graphics.Rect[].class);
2996
2997 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002998 * <p>List of lens shading modes for {@link CaptureRequest#SHADING_MODE android.shading.mode} that are supported by this camera device.</p>
2999 * <p>This list contains lens shading modes that can be set for the camera device.
3000 * Camera devices that support the MANUAL_POST_PROCESSING capability will always
3001 * list OFF and FAST mode. This includes all FULL level devices.
3002 * LEGACY devices will always only support FAST mode.</p>
3003 * <p><b>Range of valid values:</b><br>
3004 * Any value listed in {@link CaptureRequest#SHADING_MODE android.shading.mode}</p>
3005 * <p>This key is available on all devices.</p>
3006 *
3007 * @see CaptureRequest#SHADING_MODE
3008 */
3009 @PublicKey
3010 public static final Key<int[]> SHADING_AVAILABLE_MODES =
3011 new Key<int[]>("android.shading.availableModes", int[].class);
3012
3013 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003014 * <p>List of face detection modes for {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} that are
3015 * supported by this camera device.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003016 * <p>OFF is always supported.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003017 * <p><b>Range of valid values:</b><br>
3018 * Any value listed in {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003019 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003020 *
3021 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003022 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003023 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003024 public static final Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES =
3025 new Key<int[]>("android.statistics.info.availableFaceDetectModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003026
3027 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003028 * <p>The maximum number of simultaneously detectable
3029 * faces.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003030 * <p><b>Range of valid values:</b><br>
3031 * 0 for cameras without available face detection; otherwise:
3032 * <code>&gt;=4</code> for LIMITED or FULL hwlevel devices or
3033 * <code>&gt;0</code> for LEGACY devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003034 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003035 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003036 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003037 public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT =
3038 new Key<Integer>("android.statistics.info.maxFaceCount", int.class);
3039
3040 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003041 * <p>List of hot pixel map output modes for {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode} that are
3042 * supported by this camera device.</p>
3043 * <p>If no hotpixel map output is available for this camera device, this will contain only
3044 * <code>false</code>.</p>
3045 * <p>ON is always supported on devices with the RAW capability.</p>
3046 * <p><b>Range of valid values:</b><br>
3047 * Any value listed in {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003048 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003049 *
3050 * @see CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE
3051 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003052 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003053 public static final Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES =
3054 new Key<boolean[]>("android.statistics.info.availableHotPixelMapModes", boolean[].class);
3055
3056 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003057 * <p>List of lens shading map output modes for {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} that
3058 * are supported by this camera device.</p>
3059 * <p>If no lens shading map output is available for this camera device, this key will
3060 * contain only OFF.</p>
3061 * <p>ON is always supported on devices with the RAW capability.
3062 * LEGACY mode devices will always only support OFF.</p>
3063 * <p><b>Range of valid values:</b><br>
3064 * Any value listed in {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode}</p>
3065 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3066 *
3067 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3068 */
3069 @PublicKey
Yin-Chia Yeh656931d2015-05-22 16:37:27 -07003070 public static final Key<int[]> STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES =
3071 new Key<int[]>("android.statistics.info.availableLensShadingMapModes", int[].class);
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003072
3073 /**
Chien-Yu Chenc9cf5b92018-01-18 12:24:40 -08003074 * <p>List of OIS data output modes for {@link CaptureRequest#STATISTICS_OIS_DATA_MODE android.statistics.oisDataMode} that
3075 * are supported by this camera device.</p>
3076 * <p>If no OIS data output is available for this camera device, this key will
3077 * contain only OFF.</p>
3078 * <p><b>Range of valid values:</b><br>
3079 * Any value listed in {@link CaptureRequest#STATISTICS_OIS_DATA_MODE android.statistics.oisDataMode}</p>
3080 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3081 *
3082 * @see CaptureRequest#STATISTICS_OIS_DATA_MODE
3083 */
3084 @PublicKey
3085 public static final Key<int[]> STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES =
3086 new Key<int[]>("android.statistics.info.availableOisDataModes", int[].class);
3087
3088 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003089 * <p>Maximum number of supported points in the
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003090 * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003091 * <p>If the actual number of points provided by the application (in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}*) is
3092 * less than this maximum, the camera device will resample the curve to its internal
3093 * representation, using linear interpolation.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08003094 * <p>The output curves in the result metadata may have a different number
3095 * of points than the input curves, and will represent the actual
3096 * hardware curves used as closely as possible when linearly interpolated.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003097 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3098 * <p><b>Full capability</b> -
3099 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3100 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkine0060932014-01-17 17:24:11 -08003101 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003102 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003103 * @see CaptureRequest#TONEMAP_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003104 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003105 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003106 public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS =
3107 new Key<Integer>("android.tonemap.maxCurvePoints", int.class);
3108
3109 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003110 * <p>List of tonemapping modes for {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} that are supported by this camera
3111 * device.</p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003112 * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always contain
3113 * at least one of below mode combinations:</p>
3114 * <ul>
Yin-Chia Yehfba08dd2015-04-02 14:05:14 -07003115 * <li>CONTRAST_CURVE, FAST and HIGH_QUALITY</li>
3116 * <li>GAMMA_VALUE, PRESET_CURVE, FAST and HIGH_QUALITY</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003117 * </ul>
3118 * <p>This includes all FULL level devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003119 * <p><b>Range of valid values:</b><br>
3120 * Any value listed in {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003121 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3122 * <p><b>Full capability</b> -
3123 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3124 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003125 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003126 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003127 * @see CaptureRequest#TONEMAP_MODE
3128 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003129 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07003130 public static final Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES =
3131 new Key<int[]>("android.tonemap.availableToneMapModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003132
3133 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003134 * <p>A list of camera LEDs that are available on this system.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003135 * <p><b>Possible values:</b>
3136 * <ul>
3137 * <li>{@link #LED_AVAILABLE_LEDS_TRANSMIT TRANSMIT}</li>
3138 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003139 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003140 * @see #LED_AVAILABLE_LEDS_TRANSMIT
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003141 * @hide
3142 */
3143 public static final Key<int[]> LED_AVAILABLE_LEDS =
3144 new Key<int[]>("android.led.availableLeds", int[].class);
3145
3146 /**
Igor Murashkine46c0da2014-02-07 18:34:37 -08003147 * <p>Generally classifies the overall set of the camera device functionality.</p>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003148 * <p>The supported hardware level is a high-level description of the camera device's
3149 * capabilities, summarizing several capabilities into one field. Each level adds additional
3150 * features to the previous one, and is always a strict superset of the previous level.
3151 * The ordering is <code>LEGACY &lt; LIMITED &lt; FULL &lt; LEVEL_3</code>.</p>
3152 * <p>Starting from <code>LEVEL_3</code>, the level enumerations are guaranteed to be in increasing
3153 * numerical value as well. To check if a given device is at least at a given hardware level,
3154 * the following code snippet can be used:</p>
3155 * <pre><code>// Returns true if the device supports the required hardware level, or better.
3156 * boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) {
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003157 * final int[] sortedHwLevels = {
3158 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY,
3159 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL,
3160 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
3161 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL,
3162 * CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_3
3163 * };
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003164 * int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003165 * if (requiredLevel == deviceLevel) {
3166 * return true;
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003167 * }
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003168 *
3169 * for (int sortedlevel : sortedHwLevels) {
3170 * if (sortedlevel == requiredLevel) {
3171 * return true;
3172 * } else if (sortedlevel == deviceLevel) {
3173 * return false;
3174 * }
3175 * }
3176 * return false; // Should never reach here
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003177 * }
3178 * </code></pre>
3179 * <p>At a high level, the levels are:</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08003180 * <ul>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003181 * <li><code>LEGACY</code> devices operate in a backwards-compatibility mode for older
3182 * Android devices, and have very limited capabilities.</li>
3183 * <li><code>LIMITED</code> devices represent the
3184 * baseline feature set, and may also include additional capabilities that are
3185 * subsets of <code>FULL</code>.</li>
3186 * <li><code>FULL</code> devices additionally support per-frame manual control of sensor, flash, lens and
3187 * post-processing settings, and image capture at a high rate.</li>
3188 * <li><code>LEVEL_3</code> devices additionally support YUV reprocessing and RAW image capture, along
3189 * with additional output stream configurations.</li>
Yin-Chia Yehc5657002018-07-13 13:42:43 -07003190 * <li><code>EXTERNAL</code> devices are similar to <code>LIMITED</code> devices with exceptions like some sensor or
3191 * lens information not reorted or less stable framerates.</li>
Igor Murashkine46c0da2014-02-07 18:34:37 -08003192 * </ul>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003193 * <p>See the individual level enums for full descriptions of the supported capabilities. The
3194 * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} entry describes the device's capabilities at a
3195 * finer-grain level, if needed. In addition, many controls have their available settings or
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08003196 * ranges defined in individual entries from {@link android.hardware.camera2.CameraCharacteristics }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003197 * <p>Some features are not part of any particular hardware level or capability and must be
3198 * queried separately. These include:</p>
3199 * <ul>
3200 * <li>Calibrated timestamps ({@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME)</li>
3201 * <li>Precision lens control ({@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} <code>==</code> CALIBRATED)</li>
3202 * <li>Face detection ({@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes})</li>
3203 * <li>Optical or electrical image stabilization
3204 * ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization},
3205 * {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes})</li>
3206 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003207 * <p><b>Possible values:</b>
3208 * <ul>
3209 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED}</li>
3210 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}</li>
3211 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}</li>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003212 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_3 3}</li>
Yin-Chia Yeh43cea5a2018-01-19 11:38:12 -08003213 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL EXTERNAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003214 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003215 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08003216 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003217 * @see CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES
3218 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
3219 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Igor Murashkine46c0da2014-02-07 18:34:37 -08003220 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003221 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
3222 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003223 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
3224 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
Ruben Brunk4a61a862014-07-01 16:00:26 -07003225 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08003226 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_3
Yin-Chia Yeh43cea5a2018-01-19 11:38:12 -08003227 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003228 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003229 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003230 public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
3231 new Key<Integer>("android.info.supportedHardwareLevel", int.class);
3232
Igor Murashkin3865a842014-01-17 18:18:39 -08003233 /**
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08003234 * <p>A short string for manufacturer version information about the camera device, such as
3235 * ISP hardware, sensors, etc.</p>
3236 * <p>This can be used in {@link android.media.ExifInterface#TAG_IMAGE_DESCRIPTION TAG_IMAGE_DESCRIPTION}
3237 * in jpeg EXIF. This key may be absent if no version information is available on the
3238 * device.</p>
3239 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3240 */
3241 @PublicKey
3242 public static final Key<String> INFO_VERSION =
3243 new Key<String>("android.info.version", String.class);
3244
3245 /**
Igor Murashkin3865a842014-01-17 18:18:39 -08003246 * <p>The maximum number of frames that can occur after a request
3247 * (different than the previous) has been submitted, and before the
Chien-Yu Chen161a76c2015-06-26 11:23:55 -07003248 * result's state becomes synchronized.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003249 * <p>This defines the maximum distance (in number of metadata results),
Chien-Yu Chen161a76c2015-06-26 11:23:55 -07003250 * between the frame number of the request that has new controls to apply
3251 * and the frame number of the result that has all the controls applied.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003252 * <p>In other words this acts as an upper boundary for how many frames
3253 * must occur before the camera device knows for a fact that the new
3254 * submitted camera settings have been applied in outgoing frames.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003255 * <p><b>Units</b>: Frame counts</p>
3256 * <p><b>Possible values:</b>
3257 * <ul>
3258 * <li>{@link #SYNC_MAX_LATENCY_PER_FRAME_CONTROL PER_FRAME_CONTROL}</li>
3259 * <li>{@link #SYNC_MAX_LATENCY_UNKNOWN UNKNOWN}</li>
3260 * </ul></p>
3261 * <p><b>Available values for this device:</b><br>
3262 * A positive value, PER_FRAME_CONTROL, or UNKNOWN.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003263 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003264 * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL
3265 * @see #SYNC_MAX_LATENCY_UNKNOWN
3266 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003267 @PublicKey
Igor Murashkin3865a842014-01-17 18:18:39 -08003268 public static final Key<Integer> SYNC_MAX_LATENCY =
3269 new Key<Integer>("android.sync.maxLatency", int.class);
3270
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003271 /**
Zhijun He513f7c32015-04-24 18:23:54 -07003272 * <p>The maximal camera capture pipeline stall (in unit of frame count) introduced by a
3273 * reprocess capture request.</p>
3274 * <p>The key describes the maximal interference that one reprocess (input) request
3275 * can introduce to the camera simultaneous streaming of regular (output) capture
3276 * requests, including repeating requests.</p>
3277 * <p>When a reprocessing capture request is submitted while a camera output repeating request
3278 * (e.g. preview) is being served by the camera device, it may preempt the camera capture
3279 * pipeline for at least one frame duration so that the camera device is unable to process
3280 * the following capture request in time for the next sensor start of exposure boundary.
3281 * When this happens, the application may observe a capture time gap (longer than one frame
3282 * duration) between adjacent capture output frames, which usually exhibits as preview
3283 * glitch if the repeating request output targets include a preview surface. This key gives
3284 * the worst-case number of frame stall introduced by one reprocess request with any kind of
3285 * formats/sizes combination.</p>
3286 * <p>If this key reports 0, it means a reprocess request doesn't introduce any glitch to the
3287 * ongoing camera repeating request outputs, as if this reprocess request is never issued.</p>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07003288 * <p>This key is supported if the camera device supports PRIVATE or YUV reprocessing (
3289 * i.e. {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains PRIVATE_REPROCESSING or
Zhijun He513f7c32015-04-24 18:23:54 -07003290 * YUV_REPROCESSING).</p>
3291 * <p><b>Units</b>: Number of frames.</p>
3292 * <p><b>Range of valid values:</b><br>
3293 * &lt;= 4</p>
3294 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3295 * <p><b>Limited capability</b> -
3296 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3297 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3298 *
3299 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3300 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3301 */
3302 @PublicKey
3303 public static final Key<Integer> REPROCESS_MAX_CAPTURE_STALL =
3304 new Key<Integer>("android.reprocess.maxCaptureStall", int.class);
3305
3306 /**
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003307 * <p>The available depth dataspace stream
3308 * configurations that this camera device supports
3309 * (i.e. format, width, height, output/input stream).</p>
3310 * <p>These are output stream configurations for use with
3311 * dataSpace HAL_DATASPACE_DEPTH. The configurations are
3312 * listed as <code>(format, width, height, input?)</code> tuples.</p>
3313 * <p>Only devices that support depth output for at least
3314 * the HAL_PIXEL_FORMAT_Y16 dense depth map may include
3315 * this entry.</p>
3316 * <p>A device that also supports the HAL_PIXEL_FORMAT_BLOB
3317 * sparse depth point cloud must report a single entry for
3318 * the format in this list as <code>(HAL_PIXEL_FORMAT_BLOB,
3319 * android.depth.maxDepthSamples, 1, OUTPUT)</code> in addition to
3320 * the entries for HAL_PIXEL_FORMAT_Y16.</p>
3321 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3322 * <p><b>Limited capability</b> -
3323 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3324 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3325 *
3326 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3327 * @hide
3328 */
3329 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS =
3330 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
3331
3332 /**
3333 * <p>This lists the minimum frame duration for each
3334 * format/size combination for depth output formats.</p>
3335 * <p>This should correspond to the frame duration when only that
3336 * stream is active, with all processing (typically in android.*.mode)
3337 * set to either OFF or FAST.</p>
3338 * <p>When multiple streams are used in a request, the minimum frame
3339 * duration will be max(individual stream min durations).</p>
3340 * <p>The minimum frame duration of a stream (of a particular format, size)
3341 * is the same regardless of whether the stream is input or output.</p>
3342 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
3343 * android.scaler.availableStallDurations for more details about
3344 * calculating the max frame rate.</p>
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003345 * <p><b>Units</b>: (format, width, height, ns) x n</p>
3346 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3347 * <p><b>Limited capability</b> -
3348 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3349 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3350 *
3351 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3352 * @see CaptureRequest#SENSOR_FRAME_DURATION
3353 * @hide
3354 */
3355 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS =
3356 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3357
3358 /**
3359 * <p>This lists the maximum stall duration for each
Zhijun He513f7c32015-04-24 18:23:54 -07003360 * output format/size combination for depth streams.</p>
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003361 * <p>A stall duration is how much extra time would get added
3362 * to the normal minimum frame duration for a repeating request
3363 * that has streams with non-zero stall.</p>
3364 * <p>This functions similarly to
3365 * android.scaler.availableStallDurations for depth
3366 * streams.</p>
3367 * <p>All depth output stream formats may have a nonzero stall
3368 * duration.</p>
3369 * <p><b>Units</b>: (format, width, height, ns) x n</p>
3370 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3371 * <p><b>Limited capability</b> -
3372 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3373 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3374 *
3375 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3376 * @hide
3377 */
3378 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS =
3379 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3380
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07003381 /**
3382 * <p>Indicates whether a capture request may target both a
3383 * DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as
3384 * YUV_420_888, JPEG, or RAW) simultaneously.</p>
3385 * <p>If TRUE, including both depth and color outputs in a single
3386 * capture request is not supported. An application must interleave color
3387 * and depth requests. If FALSE, a single request can target both types
3388 * of output.</p>
3389 * <p>Typically, this restriction exists on camera devices that
3390 * need to emit a specific pattern or wavelength of light to
3391 * measure depth values, which causes the color image to be
3392 * corrupted during depth measurement.</p>
3393 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3394 * <p><b>Limited capability</b> -
3395 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3396 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3397 *
3398 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3399 */
3400 @PublicKey
3401 public static final Key<Boolean> DEPTH_DEPTH_IS_EXCLUSIVE =
3402 new Key<Boolean>("android.depth.depthIsExclusive", boolean.class);
3403
Shuzhen Wang23d29382017-11-26 17:24:56 -08003404 /**
3405 * <p>String containing the ids of the underlying physical cameras.</p>
3406 * <p>For a logical camera, this is concatenation of all underlying physical camera ids.
3407 * The null terminator for physical camera id must be preserved so that the whole string
3408 * can be tokenized using '\0' to generate list of physical camera ids.</p>
3409 * <p>For example, if the physical camera ids of the logical camera are "2" and "3", the
3410 * value of this tag will be ['2', '\0', '3', '\0'].</p>
3411 * <p>The number of physical camera ids must be no less than 2.</p>
3412 * <p><b>Units</b>: UTF-8 null-terminated string</p>
3413 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3414 * <p><b>Limited capability</b> -
3415 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3416 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3417 *
3418 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3419 * @hide
3420 */
3421 public static final Key<byte[]> LOGICAL_MULTI_CAMERA_PHYSICAL_IDS =
3422 new Key<byte[]>("android.logicalMultiCamera.physicalIds", byte[].class);
3423
3424 /**
3425 * <p>The accuracy of frame timestamp synchronization between physical cameras</p>
3426 * <p>The accuracy of the frame timestamp synchronization determines the physical cameras'
3427 * ability to start exposure at the same time. If the sensorSyncType is CALIBRATED,
3428 * the physical camera sensors usually run in master-slave mode so that their shutter
3429 * time is synchronized. For APPROXIMATE sensorSyncType, the camera sensors usually run in
3430 * master-master mode, and there could be offset between their start of exposure.</p>
3431 * <p>In both cases, all images generated for a particular capture request still carry the same
3432 * timestamps, so that they can be used to look up the matching frame number and
3433 * onCaptureStarted callback.</p>
3434 * <p><b>Possible values:</b>
3435 * <ul>
3436 * <li>{@link #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE APPROXIMATE}</li>
3437 * <li>{@link #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED CALIBRATED}</li>
3438 * </ul></p>
3439 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3440 * <p><b>Limited capability</b> -
3441 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3442 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3443 *
3444 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3445 * @see #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE
3446 * @see #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED
3447 */
3448 @PublicKey
3449 public static final Key<Integer> LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE =
3450 new Key<Integer>("android.logicalMultiCamera.sensorSyncType", int.class);
3451
Eino-Ville Talvala41670722018-03-13 19:43:07 -07003452 /**
3453 * <p>List of distortion correction modes for {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} that are
3454 * supported by this camera device.</p>
3455 * <p>No device is required to support this API; such devices will always list only 'OFF'.
3456 * All devices that support this API will list both FAST and HIGH_QUALITY.</p>
3457 * <p><b>Range of valid values:</b><br>
3458 * Any value listed in {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode}</p>
3459 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3460 *
3461 * @see CaptureRequest#DISTORTION_CORRECTION_MODE
3462 */
3463 @PublicKey
3464 public static final Key<int[]> DISTORTION_CORRECTION_AVAILABLE_MODES =
3465 new Key<int[]>("android.distortionCorrection.availableModes", int[].class);
3466
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003467 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3468 * End generated code
3469 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07003470
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003471
3472
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08003473}