blob: 1201ef48220a2f72b3250ec06ed4d9bf148a7614 [file] [log] [blame]
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Eino-Ville Talvala2f1a2e42013-07-25 17:12:05 -070017package android.hardware.camera2;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080018
Eino-Ville Talvala8b905572015-05-14 15:43:01 -070019import android.annotation.NonNull;
20import android.annotation.Nullable;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070021import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkin6c76f582014-07-15 17:19:49 -070022import android.hardware.camera2.impl.PublicKey;
23import android.hardware.camera2.impl.SyntheticKey;
Emilian Peev75a55702017-11-07 16:09:59 +000024import android.hardware.camera2.params.SessionConfiguration;
Igor Murashkind6d65152014-05-19 16:31:02 -070025import android.hardware.camera2.utils.TypeReference;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070026import android.util.Rational;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070027
Igor Murashkin7a36a0f2013-09-10 18:13:09 -070028import java.util.Collections;
29import java.util.List;
30
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080031/**
32 * <p>The properties describing a
33 * {@link CameraDevice CameraDevice}.</p>
34 *
35 * <p>These properties are fixed for a given CameraDevice, and can be queried
36 * through the {@link CameraManager CameraManager}
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -070037 * interface with {@link CameraManager#getCameraCharacteristics}.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080038 *
Ruben Brunkf967a542014-04-28 16:31:11 -070039 * <p>{@link CameraCharacteristics} objects are immutable.</p>
40 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080041 * @see CameraDevice
42 * @see CameraManager
43 */
Igor Murashkind6d65152014-05-19 16:31:02 -070044public final class CameraCharacteristics extends CameraMetadata<CameraCharacteristics.Key<?>> {
45
46 /**
47 * A {@code Key} is used to do camera characteristics field lookups with
48 * {@link CameraCharacteristics#get}.
49 *
50 * <p>For example, to get the stream configuration map:
51 * <code><pre>
52 * StreamConfigurationMap map = cameraCharacteristics.get(
53 * CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
54 * </pre></code>
55 * </p>
56 *
57 * <p>To enumerate over all possible keys for {@link CameraCharacteristics}, see
58 * {@link CameraCharacteristics#getKeys()}.</p>
59 *
60 * @see CameraCharacteristics#get
61 * @see CameraCharacteristics#getKeys()
62 */
63 public static final class Key<T> {
64 private final CameraMetadataNative.Key<T> mKey;
65
66 /**
67 * Visible for testing and vendor extensions only.
68 *
69 * @hide
70 */
Emilian Peevde62d842017-03-23 19:20:40 +000071 public Key(String name, Class<T> type, long vendorId) {
72 mKey = new CameraMetadataNative.Key<T>(name, type, vendorId);
73 }
74
75 /**
76 * Visible for testing and vendor extensions only.
77 *
78 * @hide
79 */
Igor Murashkind6d65152014-05-19 16:31:02 -070080 public Key(String name, Class<T> type) {
81 mKey = new CameraMetadataNative.Key<T>(name, type);
82 }
83
84 /**
85 * Visible for testing and vendor extensions only.
86 *
87 * @hide
88 */
89 public Key(String name, TypeReference<T> typeReference) {
90 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
91 }
92
93 /**
94 * Return a camelCase, period separated name formatted like:
95 * {@code "root.section[.subsections].name"}.
96 *
97 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
98 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
99 *
100 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
101 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
102 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
103 *
104 * @return String representation of the key name
105 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700106 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700107 public String getName() {
108 return mKey.getName();
109 }
110
111 /**
Emilian Peevde62d842017-03-23 19:20:40 +0000112 * Return vendor tag id.
113 *
114 * @hide
115 */
116 public long getVendorId() {
117 return mKey.getVendorId();
118 }
119
120 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700121 * {@inheritDoc}
122 */
123 @Override
124 public final int hashCode() {
125 return mKey.hashCode();
126 }
127
128 /**
129 * {@inheritDoc}
130 */
131 @SuppressWarnings("unchecked")
132 @Override
133 public final boolean equals(Object o) {
134 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
135 }
136
137 /**
Chien-Yu Chen12a83852015-07-07 12:17:22 -0700138 * Return this {@link Key} as a string representation.
139 *
140 * <p>{@code "CameraCharacteristics.Key(%s)"}, where {@code %s} represents
141 * the name of this key as returned by {@link #getName}.</p>
142 *
143 * @return string representation of {@link Key}
144 */
145 @NonNull
146 @Override
147 public String toString() {
148 return String.format("CameraCharacteristics.Key(%s)", mKey.getName());
149 }
150
151 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700152 * Visible for CameraMetadataNative implementation only; do not use.
153 *
154 * TODO: Make this private or remove it altogether.
155 *
156 * @hide
157 */
158 public CameraMetadataNative.Key<T> getNativeKey() {
159 return mKey;
160 }
161
162 @SuppressWarnings({
163 "unused", "unchecked"
164 })
165 private Key(CameraMetadataNative.Key<?> nativeKey) {
166 mKey = (CameraMetadataNative.Key<T>) nativeKey;
167 }
168 }
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700169
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700170 private final CameraMetadataNative mProperties;
Igor Murashkincc542a42014-06-25 11:52:23 -0700171 private List<CameraCharacteristics.Key<?>> mKeys;
Igor Murashkind6d65152014-05-19 16:31:02 -0700172 private List<CaptureRequest.Key<?>> mAvailableRequestKeys;
Emilian Peev75a55702017-11-07 16:09:59 +0000173 private List<CaptureRequest.Key<?>> mAvailableSessionKeys;
Igor Murashkind6d65152014-05-19 16:31:02 -0700174 private List<CaptureResult.Key<?>> mAvailableResultKeys;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700175
176 /**
177 * Takes ownership of the passed-in properties object
178 * @hide
179 */
Igor Murashkin68f40062013-09-10 12:15:54 -0700180 public CameraCharacteristics(CameraMetadataNative properties) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700181 mProperties = CameraMetadataNative.move(properties);
Emilian Peevde62d842017-03-23 19:20:40 +0000182 setNativeInstance(mProperties);
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700183 }
184
Ruben Brunkf967a542014-04-28 16:31:11 -0700185 /**
186 * Returns a copy of the underlying {@link CameraMetadataNative}.
187 * @hide
188 */
189 public CameraMetadataNative getNativeCopy() {
190 return new CameraMetadataNative(mProperties);
191 }
192
Igor Murashkind6d65152014-05-19 16:31:02 -0700193 /**
194 * Get a camera characteristics field value.
195 *
196 * <p>The field definitions can be
197 * found in {@link CameraCharacteristics}.</p>
198 *
199 * <p>Querying the value for the same key more than once will return a value
200 * which is equal to the previous queried value.</p>
201 *
202 * @throws IllegalArgumentException if the key was not valid
203 *
204 * @param key The characteristics field to read.
205 * @return The value of that key, or {@code null} if the field is not set.
206 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700207 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700208 public <T> T get(Key<T> key) {
209 return mProperties.get(key);
210 }
211
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700212 /**
Igor Murashkind6d65152014-05-19 16:31:02 -0700213 * {@inheritDoc}
214 * @hide
215 */
216 @SuppressWarnings("unchecked")
217 @Override
218 protected <T> T getProtected(Key<?> key) {
219 return (T) mProperties.get(key);
220 }
221
222 /**
223 * {@inheritDoc}
224 * @hide
225 */
226 @SuppressWarnings("unchecked")
227 @Override
228 protected Class<Key<?>> getKeyClass() {
229 Object thisClass = Key.class;
230 return (Class<Key<?>>)thisClass;
231 }
232
233 /**
234 * {@inheritDoc}
235 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700236 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700237 @Override
238 public List<Key<?>> getKeys() {
Igor Murashkincc542a42014-06-25 11:52:23 -0700239 // List of keys is immutable; cache the results after we calculate them
240 if (mKeys != null) {
241 return mKeys;
242 }
243
244 int[] filterTags = get(REQUEST_AVAILABLE_CHARACTERISTICS_KEYS);
245 if (filterTags == null) {
246 throw new AssertionError("android.request.availableCharacteristicsKeys must be non-null"
247 + " in the characteristics");
248 }
249
250 mKeys = Collections.unmodifiableList(
Emilian Peevde62d842017-03-23 19:20:40 +0000251 getKeys(getClass(), getKeyClass(), this, filterTags));
Igor Murashkincc542a42014-06-25 11:52:23 -0700252 return mKeys;
Igor Murashkind6d65152014-05-19 16:31:02 -0700253 }
254
255 /**
Emilian Peev75a55702017-11-07 16:09:59 +0000256 * <p>Returns a subset of {@link #getAvailableCaptureRequestKeys} keys that the
257 * camera device can pass as part of the capture session initialization.</p>
258 *
259 * <p>This list includes keys that are difficult to apply per-frame and
260 * can result in unexpected delays when modified during the capture session
261 * lifetime. Typical examples include parameters that require a
262 * time-consuming hardware re-configuration or internal camera pipeline
263 * change. For performance reasons we suggest clients to pass their initial
264 * values as part of {@link SessionConfiguration#setSessionParameters}. Once
265 * the camera capture session is enabled it is also recommended to avoid
266 * changing them from their initial values set in
267 * {@link SessionConfiguration#setSessionParameters }.
268 * Control over session parameters can still be exerted in capture requests
269 * but clients should be aware and expect delays during their application.
270 * An example usage scenario could look like this:</p>
271 * <ul>
272 * <li>The camera client starts by quering the session parameter key list via
273 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
274 * <li>Before triggering the capture session create sequence, a capture request
275 * must be built via {@link CameraDevice#createCaptureRequest } using an
276 * appropriate template matching the particular use case.</li>
277 * <li>The client should go over the list of session parameters and check
278 * whether some of the keys listed matches with the parameters that
279 * they intend to modify as part of the first capture request.</li>
280 * <li>If there is no such match, the capture request can be passed
281 * unmodified to {@link SessionConfiguration#setSessionParameters }.</li>
282 * <li>If matches do exist, the client should update the respective values
283 * and pass the request to {@link SessionConfiguration#setSessionParameters }.</li>
284 * <li>After the capture session initialization completes the session parameter
285 * key list can continue to serve as reference when posting or updating
286 * further requests. As mentioned above further changes to session
287 * parameters should ideally be avoided, if updates are necessary
288 * however clients could expect a delay/glitch during the
289 * parameter switch.</li>
290 * </ul>
291 *
292 * <p>The list returned is not modifiable, so any attempts to modify it will throw
293 * a {@code UnsupportedOperationException}.</p>
294 *
295 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
296 *
297 * @return List of keys that can be passed during capture session initialization. In case the
298 * camera device doesn't support such keys the list can be null.
299 */
300 @SuppressWarnings({"unchecked"})
301 public List<CaptureRequest.Key<?>> getAvailableSessionKeys() {
302 if (mAvailableSessionKeys == null) {
303 Object crKey = CaptureRequest.Key.class;
304 Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
305
306 int[] filterTags = get(REQUEST_AVAILABLE_SESSION_KEYS);
307 if (filterTags == null) {
308 return null;
309 }
310 mAvailableSessionKeys =
311 getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags);
312 }
313 return mAvailableSessionKeys;
314 }
315
316 /**
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700317 * Returns the list of keys supported by this {@link CameraDevice} for querying
318 * with a {@link CaptureRequest}.
319 *
320 * <p>The list returned is not modifiable, so any attempts to modify it will throw
321 * a {@code UnsupportedOperationException}.</p>
322 *
323 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
324 *
Igor Murashkin68f40062013-09-10 12:15:54 -0700325 * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700326 * {@link #getKeys()} instead.</p>
327 *
328 * @return List of keys supported by this CameraDevice for CaptureRequests.
329 */
Igor Murashkind6d65152014-05-19 16:31:02 -0700330 @SuppressWarnings({"unchecked"})
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700331 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700332 public List<CaptureRequest.Key<?>> getAvailableCaptureRequestKeys() {
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700333 if (mAvailableRequestKeys == null) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700334 Object crKey = CaptureRequest.Key.class;
335 Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
336
Igor Murashkincc542a42014-06-25 11:52:23 -0700337 int[] filterTags = get(REQUEST_AVAILABLE_REQUEST_KEYS);
338 if (filterTags == null) {
339 throw new AssertionError("android.request.availableRequestKeys must be non-null "
340 + "in the characteristics");
341 }
342 mAvailableRequestKeys =
343 getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags);
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700344 }
345 return mAvailableRequestKeys;
346 }
347
348 /**
349 * Returns the list of keys supported by this {@link CameraDevice} for querying
350 * with a {@link CaptureResult}.
351 *
352 * <p>The list returned is not modifiable, so any attempts to modify it will throw
353 * a {@code UnsupportedOperationException}.</p>
354 *
355 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
356 *
Igor Murashkin68f40062013-09-10 12:15:54 -0700357 * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700358 * {@link #getKeys()} instead.</p>
359 *
360 * @return List of keys supported by this CameraDevice for CaptureResults.
361 */
Igor Murashkind6d65152014-05-19 16:31:02 -0700362 @SuppressWarnings({"unchecked"})
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700363 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700364 public List<CaptureResult.Key<?>> getAvailableCaptureResultKeys() {
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700365 if (mAvailableResultKeys == null) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700366 Object crKey = CaptureResult.Key.class;
367 Class<CaptureResult.Key<?>> crKeyTyped = (Class<CaptureResult.Key<?>>)crKey;
368
Igor Murashkincc542a42014-06-25 11:52:23 -0700369 int[] filterTags = get(REQUEST_AVAILABLE_RESULT_KEYS);
370 if (filterTags == null) {
371 throw new AssertionError("android.request.availableResultKeys must be non-null "
372 + "in the characteristics");
373 }
374 mAvailableResultKeys = getAvailableKeyList(CaptureResult.class, crKeyTyped, filterTags);
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700375 }
376 return mAvailableResultKeys;
377 }
378
379 /**
380 * Returns the list of keys supported by this {@link CameraDevice} by metadataClass.
381 *
382 * <p>The list returned is not modifiable, so any attempts to modify it will throw
383 * a {@code UnsupportedOperationException}.</p>
384 *
385 * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
386 *
387 * @param metadataClass The subclass of CameraMetadata that you want to get the keys for.
Igor Murashkind6d65152014-05-19 16:31:02 -0700388 * @param keyClass The class of the metadata key, e.g. CaptureRequest.Key.class
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700389 *
390 * @return List of keys supported by this CameraDevice for metadataClass.
391 *
392 * @throws IllegalArgumentException if metadataClass is not a subclass of CameraMetadata
393 */
Igor Murashkind6d65152014-05-19 16:31:02 -0700394 private <TKey> List<TKey>
Igor Murashkincc542a42014-06-25 11:52:23 -0700395 getAvailableKeyList(Class<?> metadataClass, Class<TKey> keyClass, int[] filterTags) {
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700396
397 if (metadataClass.equals(CameraMetadata.class)) {
398 throw new AssertionError(
399 "metadataClass must be a strict subclass of CameraMetadata");
400 } else if (!CameraMetadata.class.isAssignableFrom(metadataClass)) {
401 throw new AssertionError(
402 "metadataClass must be a subclass of CameraMetadata");
403 }
404
Emilian Peevde62d842017-03-23 19:20:40 +0000405 List<TKey> staticKeyList = getKeys(
Igor Murashkincc542a42014-06-25 11:52:23 -0700406 metadataClass, keyClass, /*instance*/null, filterTags);
Igor Murashkind6d65152014-05-19 16:31:02 -0700407 return Collections.unmodifiableList(staticKeyList);
Igor Murashkin7a36a0f2013-09-10 18:13:09 -0700408 }
409
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700410 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
411 * The key entries below this point are generated from metadata
412 * definitions in /system/media/camera/docs. Do not modify by hand or
413 * modify the comment blocks at the start or end.
414 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800415
416 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700417 * <p>List of aberration correction modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode} that are
418 * supported by this camera device.</p>
419 * <p>This key lists the valid modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}. If no
420 * aberration correction modes are available for a device, this list will solely include
Yin-Chia Yeh941aac02015-01-06 10:32:47 -0800421 * OFF mode. All camera devices will support either OFF or FAST mode.</p>
422 * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always list
423 * OFF mode. This includes all FULL level devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700424 * <p>LEGACY devices will always only support FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700425 * <p><b>Range of valid values:</b><br>
426 * Any value listed in {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700427 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700428 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700429 * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
Zhijun Hea05e59d2014-07-08 18:27:47 -0700430 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700431 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700432 public static final Key<int[]> COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES =
433 new Key<int[]>("android.colorCorrection.availableAberrationModes", int[].class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700434
435 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700436 * <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 -0800437 * supported by this camera device.</p>
438 * <p>Not all of the auto-exposure anti-banding modes may be
439 * supported by a given camera device. This field lists the
440 * valid anti-banding modes that the application may request
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700441 * for this camera device with the
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800442 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} control.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700443 * <p><b>Range of valid values:</b><br>
444 * Any value listed in {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700445 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700446 *
447 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800448 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700449 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700450 public static final Key<int[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES =
451 new Key<int[]>("android.control.aeAvailableAntibandingModes", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800452
453 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700454 * <p>List of auto-exposure modes for {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} that are supported by this camera
455 * device.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800456 * <p>Not all the auto-exposure modes may be supported by a
457 * given camera device, especially if no flash unit is
458 * available. This entry lists the valid modes for
459 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} for this camera device.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700460 * <p>All camera devices support ON, and all camera devices with flash
461 * units support ON_AUTO_FLASH and ON_ALWAYS_FLASH.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -0800462 * <p>FULL mode camera devices always support OFF mode,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800463 * which enables application control of camera exposure time,
464 * sensitivity, and frame duration.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700465 * <p>LEGACY mode camera devices never support OFF mode.
466 * LIMITED mode devices support OFF if they support the MANUAL_SENSOR
467 * capability.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700468 * <p><b>Range of valid values:</b><br>
469 * Any value listed in {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700470 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800471 *
472 * @see CaptureRequest#CONTROL_AE_MODE
473 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700474 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700475 public static final Key<int[]> CONTROL_AE_AVAILABLE_MODES =
476 new Key<int[]>("android.control.aeAvailableModes", int[].class);
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800477
478 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700479 * <p>List of frame rate ranges for {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} supported by
480 * this camera device.</p>
Yin-Chia Yeh58551622015-05-21 11:27:06 -0700481 * <p>For devices at the LEGACY level or above:</p>
482 * <ul>
Yin-Chia Yeh5fdf0a12015-11-20 15:39:36 -0800483 * <li>
484 * <p>For constant-framerate recording, for each normal
485 * {@link android.media.CamcorderProfile CamcorderProfile}, that is, a
Yin-Chia Yeh58551622015-05-21 11:27:06 -0700486 * {@link android.media.CamcorderProfile CamcorderProfile} that has
487 * {@link android.media.CamcorderProfile#quality quality} in
488 * the range [{@link android.media.CamcorderProfile#QUALITY_LOW QUALITY_LOW},
489 * {@link android.media.CamcorderProfile#QUALITY_2160P QUALITY_2160P}], if the profile is
490 * supported by the device and has
491 * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code>, this list will
Yin-Chia Yeh5fdf0a12015-11-20 15:39:36 -0800492 * always include (<code>x</code>,<code>x</code>).</p>
493 * </li>
494 * <li>
495 * <p>Also, a camera device must either not support any
496 * {@link android.media.CamcorderProfile CamcorderProfile},
497 * or support at least one
498 * normal {@link android.media.CamcorderProfile CamcorderProfile} that has
499 * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code> &gt;= 24.</p>
500 * </li>
Yin-Chia Yeh58551622015-05-21 11:27:06 -0700501 * </ul>
502 * <p>For devices at the LIMITED level or above:</p>
503 * <ul>
504 * <li>For YUV_420_888 burst capture use case, this list will always include (<code>min</code>, <code>max</code>)
505 * and (<code>max</code>, <code>max</code>) where <code>min</code> &lt;= 15 and <code>max</code> = the maximum output frame rate of the
506 * maximum YUV_420_888 output size.</li>
507 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700508 * <p><b>Units</b>: Frames per second (FPS)</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700509 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700510 *
511 * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800512 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700513 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700514 public static final Key<android.util.Range<Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES =
515 new Key<android.util.Range<Integer>[]>("android.control.aeAvailableTargetFpsRanges", new TypeReference<android.util.Range<Integer>[]>() {{ }});
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800516
517 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700518 * <p>Maximum and minimum exposure compensation values for
519 * {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}, in counts of {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep},
520 * that are supported by this camera device.</p>
521 * <p><b>Range of valid values:</b><br></p>
Zhijun Hef1745ce2015-02-04 13:55:14 -0800522 * <p>Range [0,0] indicates that exposure compensation is not supported.</p>
523 * <p>For LIMITED and FULL devices, range must follow below requirements if exposure
524 * compensation is supported (<code>range != [0, 0]</code>):</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700525 * <p><code>Min.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &lt;= -2 EV</code></p>
526 * <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 -0800527 * <p>LEGACY devices may support a smaller range than this.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700528 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800529 *
530 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700531 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800532 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700533 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700534 public static final Key<android.util.Range<Integer>> CONTROL_AE_COMPENSATION_RANGE =
535 new Key<android.util.Range<Integer>>("android.control.aeCompensationRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800536
537 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700538 * <p>Smallest step by which the exposure compensation
539 * can be changed.</p>
540 * <p>This is the unit for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}. For example, if this key has
541 * 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
542 * that the target EV offset for the auto-exposure routine is -1 EV.</p>
543 * <p>One unit of EV compensation changes the brightness of the captured image by a factor
544 * of two. +1 EV doubles the image brightness, while -1 EV halves the image brightness.</p>
545 * <p><b>Units</b>: Exposure Value (EV)</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700546 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700547 *
548 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800549 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700550 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700551 public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP =
552 new Key<Rational>("android.control.aeCompensationStep", Rational.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800553
554 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700555 * <p>List of auto-focus (AF) modes for {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} that are
556 * supported by this camera device.</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800557 * <p>Not all the auto-focus modes may be supported by a
558 * given camera device. This entry lists the valid modes for
559 * {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} for this camera device.</p>
Ruben Brunk6f387092014-09-22 16:13:54 -0700560 * <p>All LIMITED and FULL mode camera devices will support OFF mode, and all
561 * camera devices with adjustable focuser units
562 * (<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 -0700563 * <p>LEGACY devices will support OFF mode only if they support
564 * focusing to infinity (by also setting {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} to
565 * <code>0.0f</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700566 * <p><b>Range of valid values:</b><br>
567 * Any value listed in {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700568 * <p>This key is available on all devices.</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800569 *
570 * @see CaptureRequest#CONTROL_AF_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700571 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Zhijun He78146ec2014-01-14 18:12:13 -0800572 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800573 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700574 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700575 public static final Key<int[]> CONTROL_AF_AVAILABLE_MODES =
576 new Key<int[]>("android.control.afAvailableModes", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800577
578 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700579 * <p>List of color effects for {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode} that are supported by this camera
580 * device.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800581 * <p>This list contains the color effect modes that can be applied to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700582 * images produced by the camera device.
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800583 * Implementations are not expected to be consistent across all devices.
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700584 * If no color effect modes are available for a device, this will only list
585 * OFF.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800586 * <p>A color effect will only be applied if
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700587 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF. OFF is always included in this list.</p>
588 * <p>This control has no effect on the operation of other control routines such
589 * as auto-exposure, white balance, or focus.</p>
590 * <p><b>Range of valid values:</b><br>
591 * Any value listed in {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700592 * <p>This key is available on all devices.</p>
Ruben Brunk5f1dcfe2014-01-17 16:42:51 -0800593 *
594 * @see CaptureRequest#CONTROL_EFFECT_MODE
595 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700596 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700597 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700598 public static final Key<int[]> CONTROL_AVAILABLE_EFFECTS =
599 new Key<int[]>("android.control.availableEffects", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700600
601 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700602 * <p>List of scene modes for {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} that are supported by this camera
603 * device.</p>
Ruben Brunk8237d342014-01-17 15:33:02 -0800604 * <p>This list contains scene modes that can be set for the camera device.
605 * Only scene modes that have been fully implemented for the
606 * camera device may be included here. Implementations are not expected
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700607 * to be consistent across all devices.</p>
608 * <p>If no scene modes are supported by the camera device, this
609 * will be set to DISABLED. Otherwise DISABLED will not be listed.</p>
610 * <p>FACE_PRIORITY is always listed if face detection is
611 * supported (i.e.<code>{@link CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT android.statistics.info.maxFaceCount} &gt;
612 * 0</code>).</p>
613 * <p><b>Range of valid values:</b><br>
614 * Any value listed in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700615 * <p>This key is available on all devices.</p>
Ruben Brunk8237d342014-01-17 15:33:02 -0800616 *
617 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700618 * @see CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700619 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700620 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700621 public static final Key<int[]> CONTROL_AVAILABLE_SCENE_MODES =
622 new Key<int[]>("android.control.availableSceneModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700623
624 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700625 * <p>List of video stabilization modes for {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}
626 * that are supported by this camera device.</p>
627 * <p>OFF will always be listed.</p>
628 * <p><b>Range of valid values:</b><br>
629 * Any value listed in {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700630 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700631 *
632 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700633 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700634 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700635 public static final Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES =
636 new Key<int[]>("android.control.availableVideoStabilizationModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700637
638 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700639 * <p>List of auto-white-balance modes for {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} that are supported by this
640 * camera device.</p>
Zhijun He399f05d2014-01-15 11:31:30 -0800641 * <p>Not all the auto-white-balance modes may be supported by a
642 * given camera device. This entry lists the valid modes for
643 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} for this camera device.</p>
644 * <p>All camera devices will support ON mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700645 * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always support OFF
646 * mode, which enables application control of white balance, by using
647 * {@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
648 * mode camera devices.</p>
649 * <p><b>Range of valid values:</b><br>
650 * Any value listed in {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700651 * <p>This key is available on all devices.</p>
Zhijun He399f05d2014-01-15 11:31:30 -0800652 *
Zhijun He399f05d2014-01-15 11:31:30 -0800653 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800654 * @see CaptureRequest#COLOR_CORRECTION_MODE
655 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
656 * @see CaptureRequest#CONTROL_AWB_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700657 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700658 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700659 public static final Key<int[]> CONTROL_AWB_AVAILABLE_MODES =
660 new Key<int[]>("android.control.awbAvailableModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700661
662 /**
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800663 * <p>List of the maximum number of regions that can be used for metering in
664 * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
665 * this corresponds to the the maximum number of elements in
666 * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}, {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions},
667 * and {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700668 * <p><b>Range of valid values:</b><br></p>
669 * <p>Value must be &gt;= 0 for each element. For full-capability devices
670 * this value must be &gt;= 1 for AE and AF. The order of the elements is:
671 * <code>(AE, AWB, AF)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700672 * <p>This key is available on all devices.</p>
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800673 *
674 * @see CaptureRequest#CONTROL_AE_REGIONS
675 * @see CaptureRequest#CONTROL_AF_REGIONS
676 * @see CaptureRequest#CONTROL_AWB_REGIONS
Igor Murashkin78712a82014-05-27 18:32:18 -0700677 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700678 */
Ruben Brunk90bc34e2014-02-03 17:54:24 -0800679 public static final Key<int[]> CONTROL_MAX_REGIONS =
680 new Key<int[]>("android.control.maxRegions", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700681
682 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700683 * <p>The maximum number of metering regions that can be used by the auto-exposure (AE)
684 * routine.</p>
685 * <p>This corresponds to the the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700686 * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700687 * <p><b>Range of valid values:</b><br>
688 * Value will be &gt;= 0. For FULL-capability devices, this
689 * value will be &gt;= 1.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700690 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700691 *
692 * @see CaptureRequest#CONTROL_AE_REGIONS
693 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700694 @PublicKey
695 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700696 public static final Key<Integer> CONTROL_MAX_REGIONS_AE =
697 new Key<Integer>("android.control.maxRegionsAe", int.class);
698
699 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700700 * <p>The maximum number of metering regions that can be used by the auto-white balance (AWB)
701 * routine.</p>
702 * <p>This corresponds to the the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700703 * {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700704 * <p><b>Range of valid values:</b><br>
705 * Value will be &gt;= 0.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700706 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700707 *
708 * @see CaptureRequest#CONTROL_AWB_REGIONS
709 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700710 @PublicKey
711 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700712 public static final Key<Integer> CONTROL_MAX_REGIONS_AWB =
713 new Key<Integer>("android.control.maxRegionsAwb", int.class);
714
715 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700716 * <p>The maximum number of metering regions that can be used by the auto-focus (AF) routine.</p>
717 * <p>This corresponds to the the maximum allowed number of elements in
Igor Murashkin78712a82014-05-27 18:32:18 -0700718 * {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700719 * <p><b>Range of valid values:</b><br>
720 * Value will be &gt;= 0. For FULL-capability devices, this
721 * value will be &gt;= 1.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700722 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -0700723 *
724 * @see CaptureRequest#CONTROL_AF_REGIONS
725 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700726 @PublicKey
727 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700728 public static final Key<Integer> CONTROL_MAX_REGIONS_AF =
729 new Key<Integer>("android.control.maxRegionsAf", int.class);
730
731 /**
Zhijun Hefab663e2015-05-26 19:46:31 -0700732 * <p>List of available high speed video size, fps range and max batch size configurations
733 * 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 -0700734 * <p>When CONSTRAINED_HIGH_SPEED_VIDEO is supported in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities},
Zhijun Hefab663e2015-05-26 19:46:31 -0700735 * this metadata will list the supported high speed video size, fps range and max batch size
736 * configurations. All the sizes listed in this configuration will be a subset of the sizes
737 * reported by {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes }
738 * for processed non-stalling formats.</p>
739 * <p>For the high speed video use case, the application must
Zhijun Hee0404182014-06-26 13:17:09 -0700740 * select the video size and fps range from this metadata to configure the recording and
741 * preview streams and setup the recording requests. For example, if the application intends
742 * to do high speed recording, it can select the maximum size reported by this metadata to
743 * configure output streams. Once the size is selected, application can filter this metadata
744 * 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 -0700745 * recording requests. Note that for the use case of multiple output streams, application
Zhijun Hefab663e2015-05-26 19:46:31 -0700746 * must select one unique size from this metadata to use (e.g., preview and recording streams
747 * must have the same size). Otherwise, the high speed capture session creation will fail.</p>
748 * <p>The min and max fps will be multiple times of 30fps.</p>
749 * <p>High speed video streaming extends significant performance pressue to camera hardware,
750 * to achieve efficient high speed streaming, the camera device may have to aggregate
751 * multiple frames together and send to camera device for processing where the request
752 * controls are same for all the frames in this batch. Max batch size indicates
753 * the max possible number of frames the camera device will group together for this high
754 * speed stream configuration. This max batch size will be used to generate a high speed
755 * recording request list by
Eino-Ville Talvala639fffe2015-06-30 10:34:48 -0700756 * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList }.
Zhijun Hefab663e2015-05-26 19:46:31 -0700757 * The max batch size for each configuration will satisfy below conditions:</p>
758 * <ul>
759 * <li>Each max batch size will be a divisor of its corresponding fps_max / 30. For example,
760 * if max_fps is 300, max batch size will only be 1, 2, 5, or 10.</li>
761 * <li>The camera device may choose smaller internal batch size for each configuration, but
762 * the actual batch size will be a divisor of max batch size. For example, if the max batch
763 * size is 8, the actual batch size used by camera device will only be 1, 2, 4, or 8.</li>
764 * <li>The max batch size in each configuration entry must be no larger than 32.</li>
765 * </ul>
766 * <p>The camera device doesn't have to support batch mode to achieve high speed video recording,
767 * in such case, batch_size_max will be reported as 1 in each configuration entry.</p>
768 * <p>This fps ranges in this configuration list can only be used to create requests
769 * that are submitted to a high speed camera capture session created by
770 * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }.
771 * The fps ranges reported in this metadata must not be used to setup capture requests for
772 * normal capture session, or it will cause request error.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700773 * <p><b>Range of valid values:</b><br></p>
Zhijun Hefab663e2015-05-26 19:46:31 -0700774 * <p>For each configuration, the fps_max &gt;= 120fps.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700775 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
776 * <p><b>Limited capability</b> -
777 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
778 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hee0404182014-06-26 13:17:09 -0700779 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700780 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He3c1ff682015-06-23 09:21:43 -0700781 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Zhijun Hee0404182014-06-26 13:17:09 -0700782 * @hide
783 */
Yin-Chia Yeh12da1402014-07-15 10:37:31 -0700784 public static final Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]> CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS =
785 new Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]>("android.control.availableHighSpeedVideoConfigurations", android.hardware.camera2.params.HighSpeedVideoConfiguration[].class);
Zhijun Hee0404182014-06-26 13:17:09 -0700786
787 /**
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -0800788 * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</p>
Yin-Chia Yeh7e3e4312015-04-02 14:34:30 -0700789 * <p>Devices with MANUAL_SENSOR capability or BURST_CAPTURE capability will always
790 * list <code>true</code>. This includes FULL devices.</p>
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -0800791 * <p>This key is available on all devices.</p>
792 *
793 * @see CaptureRequest#CONTROL_AE_LOCK
794 */
795 @PublicKey
796 public static final Key<Boolean> CONTROL_AE_LOCK_AVAILABLE =
797 new Key<Boolean>("android.control.aeLockAvailable", boolean.class);
798
799 /**
800 * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</p>
Yin-Chia Yeh7e3e4312015-04-02 14:34:30 -0700801 * <p>Devices with MANUAL_POST_PROCESSING capability or BURST_CAPTURE capability will
802 * always list <code>true</code>. This includes FULL devices.</p>
Yin-Chia Yehdc0ba092015-02-20 15:52:06 -0800803 * <p>This key is available on all devices.</p>
804 *
805 * @see CaptureRequest#CONTROL_AWB_LOCK
806 */
807 @PublicKey
808 public static final Key<Boolean> CONTROL_AWB_LOCK_AVAILABLE =
809 new Key<Boolean>("android.control.awbLockAvailable", boolean.class);
810
811 /**
812 * <p>List of control modes for {@link CaptureRequest#CONTROL_MODE android.control.mode} that are supported by this camera
813 * device.</p>
814 * <p>This list contains control modes that can be set for the camera device.
815 * LEGACY mode devices will always support AUTO mode. LIMITED and FULL
816 * devices will always support OFF, AUTO modes.</p>
817 * <p><b>Range of valid values:</b><br>
818 * Any value listed in {@link CaptureRequest#CONTROL_MODE android.control.mode}</p>
819 * <p>This key is available on all devices.</p>
820 *
821 * @see CaptureRequest#CONTROL_MODE
822 */
823 @PublicKey
824 public static final Key<int[]> CONTROL_AVAILABLE_MODES =
825 new Key<int[]>("android.control.availableModes", int[].class);
826
827 /**
Yin-Chia Yeh1ee1a0a2016-01-18 19:13:47 -0800828 * <p>Range of boosts for {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} supported
829 * by this camera device.</p>
830 * <p>Devices support post RAW sensitivity boost will advertise
831 * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} key for controling
832 * post RAW sensitivity boost.</p>
833 * <p>This key will be <code>null</code> for devices that do not support any RAW format
834 * outputs. For devices that do support RAW format outputs, this key will always
835 * present, and if a device does not support post RAW sensitivity boost, it will
836 * list <code>(100, 100)</code> in this key.</p>
837 * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
838 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
839 *
840 * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
841 * @see CaptureRequest#SENSOR_SENSITIVITY
842 */
843 @PublicKey
844 public static final Key<android.util.Range<Integer>> CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE =
845 new Key<android.util.Range<Integer>>("android.control.postRawSensitivityBoostRange", new TypeReference<android.util.Range<Integer>>() {{ }});
846
847 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700848 * <p>List of edge enhancement modes for {@link CaptureRequest#EDGE_MODE android.edge.mode} that are supported by this camera
849 * device.</p>
Chien-Yu Chen72333912015-07-08 11:55:19 -0700850 * <p>Full-capability camera devices must always support OFF; camera devices that support
851 * YUV_REPROCESSING or PRIVATE_REPROCESSING will list ZERO_SHUTTER_LAG; all devices will
852 * list FAST.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700853 * <p><b>Range of valid values:</b><br>
854 * Any value listed in {@link CaptureRequest#EDGE_MODE android.edge.mode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700855 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
856 * <p><b>Full capability</b> -
857 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
858 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -0800859 *
860 * @see CaptureRequest#EDGE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700861 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -0800862 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700863 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700864 public static final Key<int[]> EDGE_AVAILABLE_EDGE_MODES =
865 new Key<int[]>("android.edge.availableEdgeModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -0800866
867 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -0800868 * <p>Whether this camera device has a
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700869 * flash unit.</p>
870 * <p>Will be <code>false</code> if no flash is available.</p>
871 * <p>If there is no flash unit, none of the flash controls do
872 * anything.
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700873 * This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700874 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700875 @PublicKey
Zhijun Heca1b73a2014-02-03 12:39:53 -0800876 public static final Key<Boolean> FLASH_INFO_AVAILABLE =
877 new Key<Boolean>("android.flash.info.available", boolean.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700878
879 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700880 * <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 -0800881 * camera device.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -0800882 * <p>FULL mode camera devices will always support FAST.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700883 * <p><b>Range of valid values:</b><br>
884 * Any value listed in {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700885 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -0800886 *
887 * @see CaptureRequest#HOT_PIXEL_MODE
888 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700889 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700890 public static final Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES =
891 new Key<int[]>("android.hotPixel.availableHotPixelModes", int[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -0800892
893 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700894 * <p>List of JPEG thumbnail sizes for {@link CaptureRequest#JPEG_THUMBNAIL_SIZE android.jpeg.thumbnailSize} supported by this
895 * camera device.</p>
896 * <p>This list will include at least one non-zero resolution, plus <code>(0,0)</code> for indicating no
897 * thumbnail should be generated.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -0800898 * <p>Below condiditions will be satisfied for this size list:</p>
Zhijun He5a9ff372013-12-26 11:49:09 -0800899 * <ul>
Zhijun He5f2a47f2014-01-16 15:44:41 -0800900 * <li>The sizes will be sorted by increasing pixel area (width x height).
901 * If several resolutions have the same area, they will be sorted by increasing width.</li>
902 * <li>The aspect ratio of the largest thumbnail size will be same as the
Igor Murashkin9c595172014-05-12 13:56:20 -0700903 * aspect ratio of largest JPEG output size in android.scaler.availableStreamConfigurations.
Zhijun He5a9ff372013-12-26 11:49:09 -0800904 * The largest size is defined as the size that has the largest pixel area
905 * in a given size list.</li>
Igor Murashkin9c595172014-05-12 13:56:20 -0700906 * <li>Each output JPEG size in android.scaler.availableStreamConfigurations will have at least
Zhijun He5a9ff372013-12-26 11:49:09 -0800907 * one corresponding size that has the same aspect ratio in availableThumbnailSizes,
908 * and vice versa.</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700909 * <li>All non-<code>(0, 0)</code> sizes will have non-zero widths and heights.
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700910 * This key is available on all devices.</li>
Zhijun He5a9ff372013-12-26 11:49:09 -0800911 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700912 *
913 * @see CaptureRequest#JPEG_THUMBNAIL_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700914 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700915 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -0700916 public static final Key<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES =
917 new Key<android.util.Size[]>("android.jpeg.availableThumbnailSizes", android.util.Size[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700918
919 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700920 * <p>List of aperture size values for {@link CaptureRequest#LENS_APERTURE android.lens.aperture} that are
921 * supported by this camera device.</p>
922 * <p>If the camera device doesn't support a variable lens aperture,
923 * this list will contain only one value, which is the fixed aperture size.</p>
924 * <p>If the camera device supports a variable aperture, the aperture values
Zhijun Hefb46c642014-01-14 17:57:23 -0800925 * in this list will be sorted in ascending order.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700926 * <p><b>Units</b>: The aperture f-number</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700927 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
928 * <p><b>Full capability</b> -
929 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
930 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
931 *
932 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700933 * @see CaptureRequest#LENS_APERTURE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700934 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700935 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700936 public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES =
937 new Key<float[]>("android.lens.info.availableApertures", float[].class);
938
939 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700940 * <p>List of neutral density filter values for
941 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} that are supported by this camera device.</p>
942 * <p>If a neutral density filter is not supported by this camera device,
943 * this list will contain only 0. Otherwise, this list will include every
944 * filter density supported by the camera device, in ascending order.</p>
945 * <p><b>Units</b>: Exposure value (EV)</p>
946 * <p><b>Range of valid values:</b><br></p>
947 * <p>Values are &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700948 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
949 * <p><b>Full capability</b> -
950 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
951 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -0800952 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700953 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -0800954 * @see CaptureRequest#LENS_FILTER_DENSITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700955 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700956 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700957 public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES =
958 new Key<float[]>("android.lens.info.availableFilterDensities", float[].class);
959
960 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700961 * <p>List of focal lengths for {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength} that are supported by this camera
962 * device.</p>
963 * <p>If optical zoom is not supported, this list will only contain
964 * a single value corresponding to the fixed focal length of the
965 * device. Otherwise, this list will include every focal length supported
966 * by the camera device, in ascending order.</p>
967 * <p><b>Units</b>: Millimeters</p>
968 * <p><b>Range of valid values:</b><br></p>
969 * <p>Values are &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700970 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -0800971 *
972 * @see CaptureRequest#LENS_FOCAL_LENGTH
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700973 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700974 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700975 public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS =
976 new Key<float[]>("android.lens.info.availableFocalLengths", float[].class);
977
978 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700979 * <p>List of optical image stabilization (OIS) modes for
980 * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} that are supported by this camera device.</p>
981 * <p>If OIS is not supported by a given camera device, this list will
Ruben Brunk00849b32014-01-17 18:30:23 -0800982 * contain only OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700983 * <p><b>Range of valid values:</b><br>
984 * Any value listed in {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700985 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
986 * <p><b>Limited capability</b> -
987 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
988 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk00849b32014-01-17 18:30:23 -0800989 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700990 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk00849b32014-01-17 18:30:23 -0800991 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700992 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700993 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700994 public static final Key<int[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION =
995 new Key<int[]>("android.lens.info.availableOpticalStabilization", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700996
997 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700998 * <p>Hyperfocal distance for this lens.</p>
Zhijun Heff413932014-02-07 15:44:30 -0800999 * <p>If the lens is not fixed focus, the camera device will report this
1000 * 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 -07001001 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1002 * <p><b>Range of valid values:</b><br>
1003 * If lens is fixed focus, &gt;= 0. If lens has focuser unit, the value is
1004 * within <code>(0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code></p>
1005 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1006 * <p><b>Limited capability</b> -
1007 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1008 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1009 *
1010 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1011 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
1012 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1013 */
1014 @PublicKey
1015 public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE =
1016 new Key<Float>("android.lens.info.hyperfocalDistance", float.class);
1017
1018 /**
1019 * <p>Shortest distance from frontmost surface
1020 * of the lens that can be brought into sharp focus.</p>
1021 * <p>If the lens is fixed-focus, this will be
1022 * 0.</p>
1023 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1024 * <p><b>Range of valid values:</b><br>
1025 * &gt;= 0</p>
Zhijun Heff413932014-02-07 15:44:30 -08001026 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001027 * <p><b>Limited capability</b> -
1028 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1029 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heff413932014-02-07 15:44:30 -08001030 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001031 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heff413932014-02-07 15:44:30 -08001032 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001033 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001034 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001035 public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE =
1036 new Key<Float>("android.lens.info.minimumFocusDistance", float.class);
1037
1038 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08001039 * <p>Dimensions of lens shading map.</p>
1040 * <p>The map should be on the order of 30-40 rows and columns, and
1041 * must be smaller than 64x64.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001042 * <p><b>Range of valid values:</b><br>
1043 * Both values &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001044 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1045 * <p><b>Full capability</b> -
1046 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1047 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1048 *
1049 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07001050 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001051 */
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001052 public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
1053 new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001054
1055 /**
Zhijun Heff413932014-02-07 15:44:30 -08001056 * <p>The lens focus distance calibration quality.</p>
1057 * <p>The lens focus distance calibration quality determines the reliability of
1058 * focus related metadata entries, i.e. {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1059 * {@link CaptureResult#LENS_FOCUS_RANGE android.lens.focusRange}, {@link CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE android.lens.info.hyperfocalDistance}, and
1060 * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001061 * <p>APPROXIMATE and CALIBRATED devices report the focus metadata in
1062 * units of diopters (1/meter), so <code>0.0f</code> represents focusing at infinity,
1063 * and increasing positive numbers represent focusing closer and closer
1064 * to the camera device. The focus distance control also uses diopters
1065 * on these devices.</p>
1066 * <p>UNCALIBRATED devices do not use units that are directly comparable
1067 * to any real physical measurement, but <code>0.0f</code> still represents farthest
1068 * focus, and {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} represents the
1069 * nearest focus the device can achieve.</p>
1070 * <p><b>Possible values:</b>
1071 * <ul>
1072 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED UNCALIBRATED}</li>
1073 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE APPROXIMATE}</li>
1074 * <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED CALIBRATED}</li>
1075 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001076 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1077 * <p><b>Limited capability</b> -
1078 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1079 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heff413932014-02-07 15:44:30 -08001080 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001081 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heff413932014-02-07 15:44:30 -08001082 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1083 * @see CaptureResult#LENS_FOCUS_RANGE
1084 * @see CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE
1085 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1086 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED
1087 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE
1088 * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED
1089 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001090 @PublicKey
Zhijun Heff413932014-02-07 15:44:30 -08001091 public static final Key<Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION =
1092 new Key<Integer>("android.lens.info.focusDistanceCalibration", int.class);
1093
1094 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001095 * <p>Direction the camera faces relative to
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001096 * device screen.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001097 * <p><b>Possible values:</b>
1098 * <ul>
1099 * <li>{@link #LENS_FACING_FRONT FRONT}</li>
1100 * <li>{@link #LENS_FACING_BACK BACK}</li>
Zhijun He503e8152015-01-12 15:16:56 -08001101 * <li>{@link #LENS_FACING_EXTERNAL EXTERNAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001102 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001103 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001104 * @see #LENS_FACING_FRONT
1105 * @see #LENS_FACING_BACK
Zhijun He503e8152015-01-12 15:16:56 -08001106 * @see #LENS_FACING_EXTERNAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001107 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001108 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001109 public static final Key<Integer> LENS_FACING =
1110 new Key<Integer>("android.lens.facing", int.class);
1111
1112 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001113 * <p>The orientation of the camera relative to the sensor
1114 * coordinate system.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001115 * <p>The four coefficients that describe the quaternion
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001116 * rotation from the Android sensor coordinate system to a
1117 * camera-aligned coordinate system where the X-axis is
1118 * aligned with the long side of the image sensor, the Y-axis
1119 * is aligned with the short side of the image sensor, and
1120 * the Z-axis is aligned with the optical axis of the sensor.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001121 * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001122 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
1123 * amount <code>theta</code>, the following formulas can be used:</p>
1124 * <pre><code> theta = 2 * acos(w)
1125 * a_x = x / sin(theta/2)
1126 * a_y = y / sin(theta/2)
1127 * a_z = z / sin(theta/2)
1128 * </code></pre>
1129 * <p>To create a 3x3 rotation matrix that applies the rotation
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001130 * defined by this quaternion, the following matrix can be
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001131 * used:</p>
1132 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
1133 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
1134 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
1135 * </code></pre>
1136 * <p>This matrix can then be used to apply the rotation to a
1137 * column vector point with</p>
1138 * <p><code>p' = Rp</code></p>
1139 * <p>where <code>p</code> is in the device sensor coordinate system, and
1140 * <code>p'</code> is in the camera-oriented coordinate system.</p>
1141 * <p><b>Units</b>:
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001142 * Quaternion coefficients</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001143 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1144 */
1145 @PublicKey
1146 public static final Key<float[]> LENS_POSE_ROTATION =
1147 new Key<float[]>("android.lens.poseRotation", float[].class);
1148
1149 /**
1150 * <p>Position of the camera optical center.</p>
Eino-Ville Talvalad3dbfb32015-05-29 17:17:04 -07001151 * <p>The position of the camera device's lens optical center,
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001152 * as a three-dimensional vector <code>(x,y,z)</code>.</p>
1153 * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
1154 * is relative to the optical center of the largest camera device facing in the same
1155 * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
1156 * coordinate axes}. Note that only the axis definitions are shared with the sensor
1157 * coordinate system, but not the origin.</p>
1158 * <p>If this device is the largest or only camera device with a given facing, then this
1159 * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
1160 * from the main sensor along the +X axis (to the right from the user's perspective) will
1161 * report <code>(0.03, 0, 0)</code>.</p>
1162 * <p>To transform a pixel coordinates between two cameras facing the same direction, first
1163 * the source camera {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} must be corrected for. Then the source
1164 * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
1165 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
1166 * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
1167 * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
1168 * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
1169 * coordinates.</p>
1170 * <p>To compare this against a real image from the destination camera, the destination camera
1171 * image then needs to be corrected for radial distortion before comparison or sampling.</p>
1172 * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to
1173 * the center of the primary gyroscope on the device.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001174 * <p><b>Units</b>: Meters</p>
1175 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1176 *
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001177 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001178 * @see CameraCharacteristics#LENS_POSE_REFERENCE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001179 * @see CameraCharacteristics#LENS_POSE_ROTATION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001180 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001181 */
1182 @PublicKey
1183 public static final Key<float[]> LENS_POSE_TRANSLATION =
1184 new Key<float[]>("android.lens.poseTranslation", float[].class);
1185
1186 /**
1187 * <p>The parameters for this camera device's intrinsic
1188 * calibration.</p>
1189 * <p>The five calibration parameters that describe the
1190 * transform from camera-centric 3D coordinates to sensor
1191 * pixel coordinates:</p>
1192 * <pre><code>[f_x, f_y, c_x, c_y, s]
1193 * </code></pre>
1194 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
1195 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
1196 * axis, and <code>s</code> is a skew parameter for the sensor plane not
1197 * being aligned with the lens plane.</p>
1198 * <p>These are typically used within a transformation matrix K:</p>
1199 * <pre><code>K = [ f_x, s, c_x,
1200 * 0, f_y, c_y,
1201 * 0 0, 1 ]
1202 * </code></pre>
1203 * <p>which can then be combined with the camera pose rotation
1204 * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
1205 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the
1206 * complete transform from world coordinates to pixel
1207 * coordinates:</p>
1208 * <pre><code>P = [ K 0 * [ R t
1209 * 0 1 ] 0 1 ]
1210 * </code></pre>
1211 * <p>and with <code>p_w</code> being a point in the world coordinate system
1212 * and <code>p_s</code> being a point in the camera active pixel array
1213 * coordinate system, and with the mapping including the
1214 * homogeneous division by z:</p>
1215 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
1216 * p_s = p_h / z_h
1217 * </code></pre>
1218 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
1219 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
1220 * (depth) in pixel coordinates.</p>
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001221 * <p>Note that the coordinate system for this transform is the
1222 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
1223 * where <code>(0,0)</code> is the top-left of the
1224 * preCorrectionActiveArraySize rectangle. Once the pose and
1225 * intrinsic calibration transforms have been applied to a
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001226 * world point, then the {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion}
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001227 * transform needs to be applied, and the result adjusted to
1228 * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
1229 * system (where <code>(0, 0)</code> is the top-left of the
1230 * activeArraySize rectangle), to determine the final pixel
1231 * coordinate of the world point for processed (non-RAW)
1232 * output buffers.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001233 * <p><b>Units</b>:
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001234 * Pixels in the
1235 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1236 * coordinate system.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001237 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1238 *
1239 * @see CameraCharacteristics#LENS_POSE_ROTATION
1240 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001241 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07001242 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvalab8bd8ab2015-06-16 11:44:10 -07001243 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001244 */
1245 @PublicKey
1246 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
1247 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
1248
1249 /**
1250 * <p>The correction coefficients to correct for this camera device's
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001251 * radial and tangential lens distortion.</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001252 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001253 * kappa_3]</code> and two tangential distortion coefficients
1254 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
1255 * lens's geometric distortion with the mapping equations:</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001256 * <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 -07001257 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07001258 * 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 -07001259 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001260 * </code></pre>
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001261 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
1262 * input image that correspond to the pixel values in the
1263 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
1264 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
1265 * </code></pre>
1266 * <p>The pixel coordinates are defined in a normalized
1267 * coordinate system related to the
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001268 * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001269 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
1270 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
1271 * of both x and y coordinates are normalized to be 1 at the
1272 * edge further from the optical center, so the range
1273 * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
1274 * <p>Finally, <code>r</code> represents the radial distance from the
1275 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
1276 * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
1277 * <p>The distortion model used is the Brown-Conrady model.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001278 * <p><b>Units</b>:
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07001279 * Unitless coefficients.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001280 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07001281 *
1282 * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00001283 */
1284 @PublicKey
1285 public static final Key<float[]> LENS_RADIAL_DISTORTION =
1286 new Key<float[]>("android.lens.radialDistortion", float[].class);
1287
1288 /**
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001289 * <p>The origin for {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}.</p>
1290 * <p>Different calibration methods and use cases can produce better or worse results
1291 * depending on the selected coordinate origin.</p>
1292 * <p>For devices designed to support the MOTION_TRACKING capability, the GYROSCOPE origin
1293 * makes device calibration and later usage by applications combining camera and gyroscope
1294 * information together simpler.</p>
1295 * <p><b>Possible values:</b>
1296 * <ul>
1297 * <li>{@link #LENS_POSE_REFERENCE_PRIMARY_CAMERA PRIMARY_CAMERA}</li>
1298 * <li>{@link #LENS_POSE_REFERENCE_GYROSCOPE GYROSCOPE}</li>
1299 * </ul></p>
1300 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1301 *
1302 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
1303 * @see #LENS_POSE_REFERENCE_PRIMARY_CAMERA
1304 * @see #LENS_POSE_REFERENCE_GYROSCOPE
1305 */
1306 @PublicKey
1307 public static final Key<Integer> LENS_POSE_REFERENCE =
1308 new Key<Integer>("android.lens.poseReference", int.class);
1309
1310 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001311 * <p>List of noise reduction modes for {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} that are supported
1312 * by this camera device.</p>
1313 * <p>Full-capability camera devices will always support OFF and FAST.</p>
Chien-Yu Chen72333912015-07-08 11:55:19 -07001314 * <p>Camera devices that support YUV_REPROCESSING or PRIVATE_REPROCESSING will support
1315 * ZERO_SHUTTER_LAG.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001316 * <p>Legacy-capability camera devices will only support FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001317 * <p><b>Range of valid values:</b><br>
1318 * Any value listed in {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001319 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1320 * <p><b>Limited capability</b> -
1321 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1322 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001323 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001324 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001325 * @see CaptureRequest#NOISE_REDUCTION_MODE
1326 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001327 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07001328 public static final Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES =
1329 new Key<int[]>("android.noiseReduction.availableNoiseReductionModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001330
1331 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001332 * <p>If set to 1, the HAL will always split result
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001333 * metadata for a single capture into multiple buffers,
Igor Murashkinace5bf02013-12-10 17:36:40 -08001334 * returned using multiple process_capture_result calls.</p>
1335 * <p>Does not need to be listed in static
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001336 * metadata. Support for partial results will be reworked in
1337 * future versions of camera service. This quirk will stop
1338 * working at that point; DO NOT USE without careful
Igor Murashkinace5bf02013-12-10 17:36:40 -08001339 * consideration of future support.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08001340 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001341 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001342 * @hide
1343 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001344 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001345 public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
1346 new Key<Byte>("android.quirks.usePartialResult", byte.class);
1347
1348 /**
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001349 * <p>The maximum numbers of different types of output streams
1350 * that can be configured and used simultaneously by a camera device.</p>
1351 * <p>This is a 3 element tuple that contains the max number of output simultaneous
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001352 * streams for raw sensor, processed (but not stalling), and processed (and stalling)
1353 * formats respectively. For example, assuming that JPEG is typically a processed and
1354 * stalling stream, if max raw sensor format output stream number is 1, max YUV streams
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001355 * number is 3, and max JPEG stream number is 2, then this tuple should be <code>(1, 3, 2)</code>.</p>
1356 * <p>This lists the upper bound of the number of output streams supported by
1357 * the camera device. Using more streams simultaneously may require more hardware and
Igor Murashkin78712a82014-05-27 18:32:18 -07001358 * CPU resources that will consume more power. The image format for an output stream can
Igor Murashkin9c595172014-05-12 13:56:20 -07001359 * be any supported format provided by android.scaler.availableStreamConfigurations.
1360 * The formats defined in android.scaler.availableStreamConfigurations can be catergorized
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001361 * into the 3 stream types as below:</p>
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001362 * <ul>
Zhijun Hea4d0a8f2014-04-29 12:35:27 -07001363 * <li>Processed (but stalling): any non-RAW format with a stallDurations &gt; 0.
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001364 * Typically {@link android.graphics.ImageFormat#JPEG JPEG format}.</li>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001365 * <li>Raw formats: {@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}, {@link android.graphics.ImageFormat#RAW10 RAW10}, or
1366 * {@link android.graphics.ImageFormat#RAW12 RAW12}.</li>
1367 * <li>Processed (but not-stalling): any non-RAW format without a stall duration. Typically
1368 * {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888},
1369 * {@link android.graphics.ImageFormat#NV21 NV21}, or {@link android.graphics.ImageFormat#YV12 YV12}.</li>
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001370 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001371 * <p><b>Range of valid values:</b><br></p>
1372 * <p>For processed (and stalling) format streams, &gt;= 1.</p>
1373 * <p>For Raw format (either stalling or non-stalling) streams, &gt;= 0.</p>
1374 * <p>For processed (but not stalling) format streams, &gt;= 3
1375 * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1376 * &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 -07001377 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001378 *
1379 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001380 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001381 */
1382 public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
1383 new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
1384
1385 /**
Igor Murashkin78712a82014-05-27 18:32:18 -07001386 * <p>The maximum numbers of different types of output streams
1387 * that can be configured and used simultaneously by a camera device
1388 * for any <code>RAW</code> formats.</p>
1389 * <p>This value contains the max number of output simultaneous
1390 * streams from the raw sensor.</p>
1391 * <p>This lists the upper bound of the number of output streams supported by
1392 * the camera device. Using more streams simultaneously may require more hardware and
1393 * CPU resources that will consume more power. The image format for this kind of an output stream can
1394 * be any <code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1395 * <p>In particular, a <code>RAW</code> format is typically one of:</p>
1396 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001397 * <li>{@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}</li>
1398 * <li>{@link android.graphics.ImageFormat#RAW10 RAW10}</li>
1399 * <li>{@link android.graphics.ImageFormat#RAW12 RAW12}</li>
Igor Murashkin78712a82014-05-27 18:32:18 -07001400 * </ul>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001401 * <p>LEGACY mode devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> LEGACY)
1402 * never support raw streams.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001403 * <p><b>Range of valid values:</b><br></p>
1404 * <p>&gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001405 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001406 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001407 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001408 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1409 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001410 @PublicKey
1411 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001412 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_RAW =
1413 new Key<Integer>("android.request.maxNumOutputRaw", int.class);
1414
1415 /**
1416 * <p>The maximum numbers of different types of output streams
1417 * that can be configured and used simultaneously by a camera device
1418 * for any processed (but not-stalling) formats.</p>
1419 * <p>This value contains the max number of output simultaneous
1420 * streams for any processed (but not-stalling) formats.</p>
1421 * <p>This lists the upper bound of the number of output streams supported by
1422 * the camera device. Using more streams simultaneously may require more hardware and
1423 * CPU resources that will consume more power. The image format for this kind of an output stream can
1424 * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1425 * <p>Processed (but not-stalling) is defined as any non-RAW format without a stall duration.
1426 * Typically:</p>
1427 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001428 * <li>{@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888}</li>
1429 * <li>{@link android.graphics.ImageFormat#NV21 NV21}</li>
1430 * <li>{@link android.graphics.ImageFormat#YV12 YV12}</li>
1431 * <li>Implementation-defined formats, i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class) }</li>
Igor Murashkin78712a82014-05-27 18:32:18 -07001432 * </ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001433 * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1434 * processed format -- it will return 0 for a non-stalling stream.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001435 * <p>LEGACY devices will support at least 2 processing/non-stalling streams.</p>
1436 * <p><b>Range of valid values:</b><br></p>
1437 * <p>&gt;= 3
1438 * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1439 * &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 -07001440 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001441 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001442 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin78712a82014-05-27 18:32:18 -07001443 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1444 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001445 @PublicKey
1446 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001447 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC =
1448 new Key<Integer>("android.request.maxNumOutputProc", int.class);
1449
1450 /**
1451 * <p>The maximum numbers of different types of output streams
1452 * that can be configured and used simultaneously by a camera device
1453 * for any processed (and stalling) formats.</p>
1454 * <p>This value contains the max number of output simultaneous
1455 * streams for any processed (but not-stalling) formats.</p>
1456 * <p>This lists the upper bound of the number of output streams supported by
1457 * the camera device. Using more streams simultaneously may require more hardware and
1458 * CPU resources that will consume more power. The image format for this kind of an output stream can
1459 * 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 -07001460 * <p>A processed and stalling format is defined as any non-RAW format with a stallDurations
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001461 * &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 -07001462 * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1463 * processed format -- it will return a non-0 value for a stalling stream.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001464 * <p>LEGACY devices will support up to 1 processing/stalling stream.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001465 * <p><b>Range of valid values:</b><br></p>
1466 * <p>&gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001467 * <p>This key is available on all devices.</p>
Igor Murashkin78712a82014-05-27 18:32:18 -07001468 *
1469 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1470 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001471 @PublicKey
1472 @SyntheticKey
Igor Murashkin78712a82014-05-27 18:32:18 -07001473 public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING =
1474 new Key<Integer>("android.request.maxNumOutputProcStalling", int.class);
1475
1476 /**
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001477 * <p>The maximum numbers of any type of input streams
1478 * that can be configured and used simultaneously by a camera device.</p>
1479 * <p>When set to 0, it means no input stream is supported.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001480 * <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
1481 * input stream, there must be at least one output stream configured to to receive the
1482 * reprocessed images.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08001483 * <p>When an input stream and some output streams are used in a reprocessing request,
1484 * only the input buffer will be used to produce these output stream buffers, and a
1485 * new sensor image will not be captured.</p>
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001486 * <p>For example, for Zero Shutter Lag (ZSL) still capture use case, the input
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001487 * stream image format will be PRIVATE, the associated output stream image format
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001488 * should be JPEG.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001489 * <p><b>Range of valid values:</b><br></p>
1490 * <p>0 or 1.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001491 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1492 * <p><b>Full capability</b> -
1493 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1494 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1495 *
1496 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001497 */
Zhijun He0e99c222015-01-29 15:26:05 -08001498 @PublicKey
Zhijun Hea5a0cac2014-02-05 07:55:44 -08001499 public static final Key<Integer> REQUEST_MAX_NUM_INPUT_STREAMS =
1500 new Key<Integer>("android.request.maxNumInputStreams", int.class);
1501
1502 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08001503 * <p>Specifies the number of maximum pipeline stages a frame
1504 * has to go through from when it's exposed to when it's available
1505 * to the framework.</p>
1506 * <p>A typical minimum value for this is 2 (one stage to expose,
1507 * one stage to readout) from the sensor. The ISP then usually adds
1508 * its own stages to do custom HW processing. Further stages may be
1509 * added by SW processing.</p>
1510 * <p>Depending on what settings are used (e.g. YUV, JPEG) and what
1511 * processing is enabled (e.g. face detection), the actual pipeline
1512 * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than
1513 * the max pipeline depth.</p>
1514 * <p>A pipeline depth of X stages is equivalent to a pipeline latency of
1515 * X frame intervals.</p>
Zhijun Hefab663e2015-05-26 19:46:31 -07001516 * <p>This value will normally be 8 or less, however, for high speed capture session,
1517 * 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 -07001518 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08001519 *
1520 * @see CaptureResult#REQUEST_PIPELINE_DEPTH
1521 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001522 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08001523 public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH =
1524 new Key<Byte>("android.request.pipelineMaxDepth", byte.class);
1525
1526 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001527 * <p>Defines how many sub-components
Igor Murashkin2086b582014-01-17 18:30:59 -08001528 * a result will be composed of.</p>
1529 * <p>In order to combat the pipeline latency, partial results
1530 * may be delivered to the application layer from the camera device as
1531 * soon as they are available.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001532 * <p>Optional; defaults to 1. A value of 1 means that partial
1533 * results are not supported, and only the final TotalCaptureResult will
1534 * be produced by the camera device.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001535 * <p>A typical use case for this might be: after requesting an
1536 * auto-focus (AF) lock the new AF state might be available 50%
1537 * of the way through the pipeline. The camera device could
1538 * then immediately dispatch this state via a partial result to
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001539 * the application, and the rest of the metadata via later
1540 * partial results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001541 * <p><b>Range of valid values:</b><br>
1542 * &gt;= 1</p>
Zhijun He1420de42014-07-17 17:45:54 -07001543 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin2086b582014-01-17 18:30:59 -08001544 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001545 @PublicKey
Igor Murashkin2086b582014-01-17 18:30:59 -08001546 public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
1547 new Key<Integer>("android.request.partialResultCount", int.class);
1548
1549 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001550 * <p>List of capabilities that this camera device
Igor Murashkine46c0da2014-02-07 18:34:37 -08001551 * advertises as fully supporting.</p>
1552 * <p>A capability is a contract that the camera device makes in order
1553 * to be able to satisfy one or more use cases.</p>
1554 * <p>Listing a capability guarantees that the whole set of features
1555 * required to support a common use will all be available.</p>
1556 * <p>Using a subset of the functionality provided by an unsupported
1557 * capability may be possible on a specific camera device implementation;
1558 * to do this query each of android.request.availableRequestKeys,
1559 * android.request.availableResultKeys,
1560 * android.request.availableCharacteristicsKeys.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001561 * <p>The following capabilities are guaranteed to be available on
1562 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL devices:</p>
1563 * <ul>
1564 * <li>MANUAL_SENSOR</li>
Zhijun Hedf9b7472014-06-04 13:42:41 -07001565 * <li>MANUAL_POST_PROCESSING</li>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001566 * </ul>
1567 * <p>Other capabilities may be available on either FULL or LIMITED
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001568 * devices, but the application should query this key to be sure.</p>
1569 * <p><b>Possible values:</b>
1570 * <ul>
1571 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE BACKWARD_COMPATIBLE}</li>
1572 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR MANUAL_SENSOR}</li>
1573 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING MANUAL_POST_PROCESSING}</li>
1574 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}</li>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001575 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING PRIVATE_REPROCESSING}</li>
Ruben Brunk0c22e692014-11-11 12:00:34 -08001576 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}</li>
Eino-Ville Talvala126a7462014-11-04 16:31:01 -08001577 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08001578 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING YUV_REPROCESSING}</li>
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07001579 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT DEPTH_OUTPUT}</li>
Zhijun Hefab663e2015-05-26 19:46:31 -07001580 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO CONSTRAINED_HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001581 * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING MOTION_TRACKING}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001582 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001583 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001584 *
1585 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala08bc3b02014-07-09 10:07:36 -07001586 * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
Igor Murashkine46c0da2014-02-07 18:34:37 -08001587 * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
Zhijun He50f72432014-05-28 13:52:04 -07001588 * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING
Eino-Ville Talvala611fece2014-07-10 17:29:38 -07001589 * @see #REQUEST_AVAILABLE_CAPABILITIES_RAW
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001590 * @see #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING
Ruben Brunk0c22e692014-11-11 12:00:34 -08001591 * @see #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS
Eino-Ville Talvala126a7462014-11-04 16:31:01 -08001592 * @see #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE
Zhijun He0e99c222015-01-29 15:26:05 -08001593 * @see #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07001594 * @see #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT
Zhijun Hefab663e2015-05-26 19:46:31 -07001595 * @see #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001596 * @see #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING
Igor Murashkine46c0da2014-02-07 18:34:37 -08001597 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001598 @PublicKey
Zhijun He421ddbe2014-05-29 13:41:49 -07001599 public static final Key<int[]> REQUEST_AVAILABLE_CAPABILITIES =
1600 new Key<int[]>("android.request.availableCapabilities", int[].class);
Igor Murashkine46c0da2014-02-07 18:34:37 -08001601
1602 /**
1603 * <p>A list of all keys that the camera device has available
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001604 * to use with {@link android.hardware.camera2.CaptureRequest }.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001605 * <p>Attempting to set a key into a CaptureRequest that is not
1606 * listed here will result in an invalid request and will be rejected
1607 * by the camera device.</p>
1608 * <p>This field can be used to query the feature set of a camera device
1609 * at a more granular level than capabilities. This is especially
1610 * important for optional keys that are not listed under any capability
1611 * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001612 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001613 *
1614 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1615 * @hide
1616 */
1617 public static final Key<int[]> REQUEST_AVAILABLE_REQUEST_KEYS =
1618 new Key<int[]>("android.request.availableRequestKeys", int[].class);
1619
1620 /**
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001621 * <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 -08001622 * <p>Attempting to get a key from a CaptureResult that is not
1623 * listed here will always return a <code>null</code> value. Getting a key from
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001624 * a CaptureResult that is listed here will generally never return a <code>null</code>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001625 * value.</p>
1626 * <p>The following keys may return <code>null</code> unless they are enabled:</p>
1627 * <ul>
Ruben Brunk57493682014-05-27 18:58:08 -07001628 * <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 -08001629 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001630 * <p>(Those sometimes-null keys will nevertheless be listed here
Igor Murashkine46c0da2014-02-07 18:34:37 -08001631 * if they are available.)</p>
1632 * <p>This field can be used to query the feature set of a camera device
1633 * at a more granular level than capabilities. This is especially
1634 * important for optional keys that are not listed under any capability
1635 * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001636 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001637 *
1638 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkine46c0da2014-02-07 18:34:37 -08001639 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
1640 * @hide
1641 */
1642 public static final Key<int[]> REQUEST_AVAILABLE_RESULT_KEYS =
1643 new Key<int[]>("android.request.availableResultKeys", int[].class);
1644
1645 /**
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08001646 * <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 -08001647 * <p>This entry follows the same rules as
1648 * android.request.availableResultKeys (except that it applies for
1649 * CameraCharacteristics instead of CaptureResult). See above for more
1650 * details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001651 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08001652 * @hide
1653 */
1654 public static final Key<int[]> REQUEST_AVAILABLE_CHARACTERISTICS_KEYS =
1655 new Key<int[]>("android.request.availableCharacteristicsKeys", int[].class);
1656
1657 /**
Emilian Peev75a55702017-11-07 16:09:59 +00001658 * <p>A subset of the available request keys that the camera device
1659 * can pass as part of the capture session initialization.</p>
1660 * <p>This is a subset of android.request.availableRequestKeys which
1661 * contains a list of keys that are difficult to apply per-frame and
1662 * can result in unexpected delays when modified during the capture session
1663 * lifetime. Typical examples include parameters that require a
1664 * time-consuming hardware re-configuration or internal camera pipeline
1665 * change. For performance reasons we advise clients to pass their initial
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08001666 * values as part of
Eino-Ville Talvalaec99efa2017-11-29 15:35:42 -08001667 * {@link SessionConfiguration#setSessionParameters }.
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08001668 * Once the camera capture session is enabled it is also recommended to avoid
Emilian Peev75a55702017-11-07 16:09:59 +00001669 * changing them from their initial values set in
1670 * {@link SessionConfiguration#setSessionParameters }.
1671 * Control over session parameters can still be exerted in capture requests
1672 * but clients should be aware and expect delays during their application.
1673 * An example usage scenario could look like this:</p>
1674 * <ul>
1675 * <li>The camera client starts by quering the session parameter key list via
1676 * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
1677 * <li>Before triggering the capture session create sequence, a capture request
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08001678 * must be built via
1679 * {@link CameraDevice#createCaptureRequest }
1680 * using an appropriate template matching the particular use case.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00001681 * <li>The client should go over the list of session parameters and check
1682 * whether some of the keys listed matches with the parameters that
1683 * they intend to modify as part of the first capture request.</li>
1684 * <li>If there is no such match, the capture request can be passed
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08001685 * unmodified to
1686 * {@link SessionConfiguration#setSessionParameters }.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00001687 * <li>If matches do exist, the client should update the respective values
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08001688 * and pass the request to
1689 * {@link SessionConfiguration#setSessionParameters }.</li>
Emilian Peev75a55702017-11-07 16:09:59 +00001690 * <li>After the capture session initialization completes the session parameter
1691 * key list can continue to serve as reference when posting or updating
1692 * further requests. As mentioned above further changes to session
1693 * parameters should ideally be avoided, if updates are necessary
1694 * however clients could expect a delay/glitch during the
1695 * parameter switch.</li>
1696 * </ul>
1697 * <p>This key is available on all devices.</p>
1698 * @hide
1699 */
1700 public static final Key<int[]> REQUEST_AVAILABLE_SESSION_KEYS =
1701 new Key<int[]>("android.request.availableSessionKeys", int[].class);
1702
1703 /**
Zhijun Hef3b16df2014-01-17 13:37:59 -08001704 * <p>The list of image formats that are supported by this
Igor Murashkin418f6df2014-02-07 18:20:48 -08001705 * camera device for output streams.</p>
Zhijun Hef3b16df2014-01-17 13:37:59 -08001706 * <p>All camera devices will support JPEG and YUV_420_888 formats.</p>
1707 * <p>When set to YUV_420_888, application can access the YUV420 data directly.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001708 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001709 * @deprecated
1710 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001711 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001712 @Deprecated
Igor Murashkinb519cc52013-07-02 11:23:44 -07001713 public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
1714 new Key<int[]>("android.scaler.availableFormats", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001715
1716 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001717 * <p>The minimum frame duration that is supported
Igor Murashkin9c595172014-05-12 13:56:20 -07001718 * for each resolution in android.scaler.availableJpegSizes.</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08001719 * <p>This corresponds to the minimum steady-state frame duration when only
1720 * that JPEG stream is active and captured in a burst, with all
1721 * processing (typically in android.*.mode) set to FAST.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001722 * <p>When multiple streams are configured, the minimum
1723 * frame duration will be &gt;= max(individual stream min
1724 * durations)</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001725 * <p><b>Units</b>: Nanoseconds</p>
1726 * <p><b>Range of valid values:</b><br>
1727 * TODO: Remove property.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001728 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001729 * @deprecated
1730 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001731 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001732 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001733 public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
1734 new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001735
1736 /**
Zhijun Hef3b16df2014-01-17 13:37:59 -08001737 * <p>The JPEG resolutions that are supported by this camera device.</p>
1738 * <p>The resolutions are listed as <code>(width, height)</code> pairs. All camera devices will support
1739 * 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 -07001740 * <p><b>Range of valid values:</b><br>
1741 * TODO: Remove property.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001742 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Zhijun Hef3b16df2014-01-17 13:37:59 -08001743 *
1744 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Igor Murashkin9c595172014-05-12 13:56:20 -07001745 * @deprecated
1746 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001747 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001748 @Deprecated
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001749 public static final Key<android.util.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
1750 new Key<android.util.Size[]>("android.scaler.availableJpegSizes", android.util.Size[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001751
1752 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001753 * <p>The maximum ratio between both active area width
1754 * and crop region width, and active area height and
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001755 * crop region height, for {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001756 * <p>This represents the maximum amount of zooming possible by
1757 * the camera device, or equivalently, the minimum cropping
1758 * window size.</p>
1759 * <p>Crop regions that have a width or height that is smaller
1760 * than this ratio allows will be rounded up to the minimum
1761 * allowed size by the camera device.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001762 * <p><b>Units</b>: Zoom scale factor</p>
1763 * <p><b>Range of valid values:</b><br>
1764 * &gt;=1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001765 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001766 *
1767 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001768 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001769 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001770 public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM =
1771 new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001772
1773 /**
Igor Murashkin143aa0b2014-01-17 15:02:34 -08001774 * <p>For each available processed output size (defined in
Igor Murashkin9c595172014-05-12 13:56:20 -07001775 * android.scaler.availableProcessedSizes), this property lists the
Igor Murashkin143aa0b2014-01-17 15:02:34 -08001776 * minimum supportable frame duration for that size.</p>
1777 * <p>This should correspond to the frame duration when only that processed
1778 * stream is active, with all processing (typically in android.*.mode)
1779 * set to FAST.</p>
1780 * <p>When multiple streams are configured, the minimum frame duration will
1781 * be &gt;= max(individual stream min durations).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001782 * <p><b>Units</b>: Nanoseconds</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001783 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001784 * @deprecated
1785 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001786 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001787 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001788 public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
1789 new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001790
1791 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001792 * <p>The resolutions available for use with
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001793 * processed output streams, such as YV12, NV12, and
1794 * platform opaque YUV/RGB streams to the GPU or video
Zhijun Hef3b16df2014-01-17 13:37:59 -08001795 * encoders.</p>
1796 * <p>The resolutions are listed as <code>(width, height)</code> pairs.</p>
1797 * <p>For a given use case, the actual maximum supported resolution
1798 * may be lower than what is listed here, depending on the destination
1799 * Surface for the image data. For example, for recording video,
1800 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
1801 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
1802 * can provide.</p>
1803 * <p>Please reference the documentation for the image data destination to
1804 * check if it limits the maximum size for image data.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001805 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001806 * @deprecated
1807 * @hide
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001808 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001809 @Deprecated
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001810 public static final Key<android.util.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
1811 new Key<android.util.Size[]>("android.scaler.availableProcessedSizes", android.util.Size[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001812
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001813 /**
Igor Murashkin418f6df2014-02-07 18:20:48 -08001814 * <p>The mapping of image formats that are supported by this
1815 * camera device for input streams, to their corresponding output formats.</p>
1816 * <p>All camera devices with at least 1
Zhijun He0e99c222015-01-29 15:26:05 -08001817 * {@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} will have at least one
Igor Murashkin418f6df2014-02-07 18:20:48 -08001818 * available input format.</p>
1819 * <p>The camera device will support the following map of formats,
Zhijun He0e99c222015-01-29 15:26:05 -08001820 * if its dependent capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
Igor Murashkin418f6df2014-02-07 18:20:48 -08001821 * <table>
1822 * <thead>
1823 * <tr>
1824 * <th align="left">Input Format</th>
1825 * <th align="left">Output Format</th>
1826 * <th align="left">Capability</th>
1827 * </tr>
1828 * </thead>
1829 * <tbody>
1830 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001831 * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
1832 * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001833 * <td align="left">PRIVATE_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08001834 * </tr>
1835 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001836 * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
1837 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001838 * <td align="left">PRIVATE_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08001839 * </tr>
1840 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001841 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1842 * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
Zhijun He0e99c222015-01-29 15:26:05 -08001843 * <td align="left">YUV_REPROCESSING</td>
1844 * </tr>
1845 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001846 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1847 * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Zhijun He0e99c222015-01-29 15:26:05 -08001848 * <td align="left">YUV_REPROCESSING</td>
Igor Murashkin418f6df2014-02-07 18:20:48 -08001849 * </tr>
1850 * </tbody>
1851 * </table>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001852 * <p>PRIVATE refers to a device-internal format that is not directly application-visible. A
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001853 * PRIVATE input surface can be acquired by {@link android.media.ImageReader#newInstance }
1854 * with {@link android.graphics.ImageFormat#PRIVATE } as the format.</p>
1855 * <p>For a PRIVATE_REPROCESSING-capable camera device, using the PRIVATE format as either input
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07001856 * 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 -08001857 * <p>Attempting to configure an input stream with output streams not
1858 * listed as available in this map is not valid.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001859 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001860 *
Zhijun He0e99c222015-01-29 15:26:05 -08001861 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1862 * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
Igor Murashkin9c595172014-05-12 13:56:20 -07001863 * @hide
Igor Murashkin418f6df2014-02-07 18:20:48 -08001864 */
Chien-Yu Chen0a551f12015-04-03 17:57:35 -07001865 public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP =
1866 new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
Igor Murashkin418f6df2014-02-07 18:20:48 -08001867
1868 /**
Igor Murashkina23ffb52014-02-07 18:52:34 -08001869 * <p>The available stream configurations that this
1870 * camera device supports
1871 * (i.e. format, width, height, output/input stream).</p>
1872 * <p>The configurations are listed as <code>(format, width, height, input?)</code>
1873 * tuples.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08001874 * <p>For a given use case, the actual maximum supported resolution
1875 * may be lower than what is listed here, depending on the destination
1876 * Surface for the image data. For example, for recording video,
1877 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
1878 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
1879 * can provide.</p>
1880 * <p>Please reference the documentation for the image data destination to
1881 * check if it limits the maximum size for image data.</p>
1882 * <p>Not all output formats may be supported in a configuration with
1883 * an input stream of a particular format. For more details, see
Igor Murashkin9c595172014-05-12 13:56:20 -07001884 * android.scaler.availableInputOutputFormatsMap.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08001885 * <p>The following table describes the minimum required output stream
1886 * configurations based on the hardware level
1887 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
1888 * <table>
1889 * <thead>
1890 * <tr>
1891 * <th align="center">Format</th>
1892 * <th align="center">Size</th>
1893 * <th align="center">Hardware Level</th>
1894 * <th align="center">Notes</th>
1895 * </tr>
1896 * </thead>
1897 * <tbody>
1898 * <tr>
1899 * <td align="center">JPEG</td>
1900 * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
1901 * <td align="center">Any</td>
1902 * <td align="center"></td>
1903 * </tr>
1904 * <tr>
1905 * <td align="center">JPEG</td>
1906 * <td align="center">1920x1080 (1080p)</td>
1907 * <td align="center">Any</td>
1908 * <td align="center">if 1080p &lt;= activeArraySize</td>
1909 * </tr>
1910 * <tr>
1911 * <td align="center">JPEG</td>
1912 * <td align="center">1280x720 (720)</td>
1913 * <td align="center">Any</td>
1914 * <td align="center">if 720p &lt;= activeArraySize</td>
1915 * </tr>
1916 * <tr>
1917 * <td align="center">JPEG</td>
1918 * <td align="center">640x480 (480p)</td>
1919 * <td align="center">Any</td>
1920 * <td align="center">if 480p &lt;= activeArraySize</td>
1921 * </tr>
1922 * <tr>
1923 * <td align="center">JPEG</td>
1924 * <td align="center">320x240 (240p)</td>
1925 * <td align="center">Any</td>
1926 * <td align="center">if 240p &lt;= activeArraySize</td>
1927 * </tr>
1928 * <tr>
1929 * <td align="center">YUV_420_888</td>
1930 * <td align="center">all output sizes available for JPEG</td>
1931 * <td align="center">FULL</td>
1932 * <td align="center"></td>
1933 * </tr>
1934 * <tr>
1935 * <td align="center">YUV_420_888</td>
1936 * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
1937 * <td align="center">LIMITED</td>
1938 * <td align="center"></td>
1939 * </tr>
1940 * <tr>
1941 * <td align="center">IMPLEMENTATION_DEFINED</td>
1942 * <td align="center">same as YUV_420_888</td>
1943 * <td align="center">Any</td>
1944 * <td align="center"></td>
1945 * </tr>
1946 * </tbody>
1947 * </table>
1948 * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional
1949 * mandatory stream configurations on a per-capability basis.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001950 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08001951 *
1952 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1953 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkina23ffb52014-02-07 18:52:34 -08001954 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Igor Murashkin9c595172014-05-12 13:56:20 -07001955 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08001956 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001957 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS =
1958 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08001959
1960 /**
1961 * <p>This lists the minimum frame duration for each
1962 * format/size combination.</p>
1963 * <p>This should correspond to the frame duration when only that
1964 * stream is active, with all processing (typically in android.*.mode)
1965 * set to either OFF or FAST.</p>
1966 * <p>When multiple streams are used in a request, the minimum frame
1967 * duration will be max(individual stream min durations).</p>
1968 * <p>The minimum frame duration of a stream (of a particular format, size)
1969 * is the same regardless of whether the stream is input or output.</p>
1970 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
Igor Murashkin9c595172014-05-12 13:56:20 -07001971 * android.scaler.availableStallDurations for more details about
Igor Murashkina23ffb52014-02-07 18:52:34 -08001972 * calculating the max frame rate.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001973 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001974 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08001975 *
Igor Murashkina23ffb52014-02-07 18:52:34 -08001976 * @see CaptureRequest#SENSOR_FRAME_DURATION
Igor Murashkin9c595172014-05-12 13:56:20 -07001977 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08001978 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001979 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS =
1980 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08001981
1982 /**
1983 * <p>This lists the maximum stall duration for each
Zhijun He513f7c32015-04-24 18:23:54 -07001984 * output format/size combination.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08001985 * <p>A stall duration is how much extra time would get added
1986 * to the normal minimum frame duration for a repeating request
1987 * that has streams with non-zero stall.</p>
1988 * <p>For example, consider JPEG captures which have the following
1989 * characteristics:</p>
1990 * <ul>
1991 * <li>JPEG streams act like processed YUV streams in requests for which
1992 * they are not included; in requests in which they are directly
1993 * referenced, they act as JPEG streams. This is because supporting a
1994 * JPEG stream requires the underlying YUV data to always be ready for
1995 * use by a JPEG encoder, but the encoder will only be used (and impact
1996 * frame duration) on requests that actually reference a JPEG stream.</li>
1997 * <li>The JPEG processor can run concurrently to the rest of the camera
1998 * pipeline, but cannot process more than 1 capture at a time.</li>
1999 * </ul>
2000 * <p>In other words, using a repeating YUV request would result
2001 * in a steady frame rate (let's say it's 30 FPS). If a single
2002 * JPEG request is submitted periodically, the frame rate will stay
2003 * at 30 FPS (as long as we wait for the previous JPEG to return each
2004 * time). If we try to submit a repeating YUV + JPEG request, then
2005 * the frame rate will drop from 30 FPS.</p>
2006 * <p>In general, submitting a new request with a non-0 stall time
2007 * stream will <em>not</em> cause a frame rate drop unless there are still
2008 * outstanding buffers for that stream from previous requests.</p>
2009 * <p>Submitting a repeating request with streams (call this <code>S</code>)
2010 * is the same as setting the minimum frame duration from
2011 * the normal minimum frame duration corresponding to <code>S</code>, added with
2012 * the maximum stall duration for <code>S</code>.</p>
2013 * <p>If interleaving requests with and without a stall duration,
2014 * a request will stall by the maximum of the remaining times
2015 * for each can-stall stream with outstanding buffers.</p>
2016 * <p>This means that a stalling request will not have an exposure start
2017 * until the stall has completed.</p>
2018 * <p>This should correspond to the stall duration when only that stream is
2019 * active, with all processing (typically in android.*.mode) set to FAST
2020 * or OFF. Setting any of the processing modes to HIGH_QUALITY
2021 * effectively results in an indeterminate stall duration for all
2022 * streams in a request (the regular stall calculation rules are
2023 * ignored).</p>
2024 * <p>The following formats may always have a stall duration:</p>
2025 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002026 * <li>{@link android.graphics.ImageFormat#JPEG }</li>
2027 * <li>{@link android.graphics.ImageFormat#RAW_SENSOR }</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002028 * </ul>
2029 * <p>The following formats will never have a stall duration:</p>
2030 * <ul>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002031 * <li>{@link android.graphics.ImageFormat#YUV_420_888 }</li>
2032 * <li>{@link android.graphics.ImageFormat#RAW10 }</li>
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002033 * <li>{@link android.graphics.ImageFormat#RAW12 }</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002034 * </ul>
2035 * <p>All other formats may or may not have an allowed stall duration on
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002036 * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Igor Murashkina23ffb52014-02-07 18:52:34 -08002037 * for more details.</p>
2038 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} for more information about
2039 * calculating the max frame rate (absent stalls).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002040 * <p><b>Units</b>: (format, width, height, ns) x n</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002041 * <p>This key is available on all devices.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002042 *
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002043 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Igor Murashkina23ffb52014-02-07 18:52:34 -08002044 * @see CaptureRequest#SENSOR_FRAME_DURATION
Igor Murashkin9c595172014-05-12 13:56:20 -07002045 * @hide
Igor Murashkina23ffb52014-02-07 18:52:34 -08002046 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002047 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS =
2048 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
2049
2050 /**
2051 * <p>The available stream configurations that this
2052 * camera device supports; also includes the minimum frame durations
2053 * and the stall durations for each format/size combination.</p>
2054 * <p>All camera devices will support sensor maximum resolution (defined by
2055 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.</p>
2056 * <p>For a given use case, the actual maximum supported resolution
2057 * may be lower than what is listed here, depending on the destination
2058 * Surface for the image data. For example, for recording video,
2059 * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2060 * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2061 * can provide.</p>
2062 * <p>Please reference the documentation for the image data destination to
2063 * check if it limits the maximum size for image data.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002064 * <p>The following table describes the minimum required output stream
2065 * configurations based on the hardware level
2066 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
2067 * <table>
2068 * <thead>
2069 * <tr>
2070 * <th align="center">Format</th>
2071 * <th align="center">Size</th>
2072 * <th align="center">Hardware Level</th>
2073 * <th align="center">Notes</th>
2074 * </tr>
2075 * </thead>
2076 * <tbody>
2077 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002078 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002079 * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} (*1)</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002080 * <td align="center">Any</td>
2081 * <td align="center"></td>
2082 * </tr>
2083 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002084 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002085 * <td align="center">1920x1080 (1080p)</td>
2086 * <td align="center">Any</td>
2087 * <td align="center">if 1080p &lt;= activeArraySize</td>
2088 * </tr>
2089 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002090 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002091 * <td align="center">1280x720 (720p)</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002092 * <td align="center">Any</td>
2093 * <td align="center">if 720p &lt;= activeArraySize</td>
2094 * </tr>
2095 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002096 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002097 * <td align="center">640x480 (480p)</td>
2098 * <td align="center">Any</td>
2099 * <td align="center">if 480p &lt;= activeArraySize</td>
2100 * </tr>
2101 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002102 * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002103 * <td align="center">320x240 (240p)</td>
2104 * <td align="center">Any</td>
2105 * <td align="center">if 240p &lt;= activeArraySize</td>
2106 * </tr>
2107 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002108 * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002109 * <td align="center">all output sizes available for JPEG</td>
2110 * <td align="center">FULL</td>
2111 * <td align="center"></td>
2112 * </tr>
2113 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002114 * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002115 * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
2116 * <td align="center">LIMITED</td>
2117 * <td align="center"></td>
2118 * </tr>
2119 * <tr>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002120 * <td align="center">{@link android.graphics.ImageFormat#PRIVATE }</td>
Igor Murashkin9c595172014-05-12 13:56:20 -07002121 * <td align="center">same as YUV_420_888</td>
2122 * <td align="center">Any</td>
2123 * <td align="center"></td>
2124 * </tr>
2125 * </tbody>
2126 * </table>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002127 * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} and {@link android.hardware.camera2.CameraDevice#createCaptureSession } for additional mandatory
2128 * stream configurations on a per-capability basis.</p>
Yin-Chia Yeh56830462015-07-08 14:26:05 -07002129 * <p>*1: For JPEG format, the sizes may be restricted by below conditions:</p>
2130 * <ul>
2131 * <li>The HAL may choose the aspect ratio of each Jpeg size to be one of well known ones
2132 * (e.g. 4:3, 16:9, 3:2 etc.). If the sensor maximum resolution
2133 * (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) has an aspect ratio other than these,
2134 * it does not have to be included in the supported JPEG sizes.</li>
2135 * <li>Some hardware JPEG encoders may have pixel boundary alignment requirements, such as
2136 * the dimensions being a multiple of 16.
2137 * Therefore, the maximum JPEG size may be smaller than sensor maximum resolution.
2138 * However, the largest JPEG size will be as close as possible to the sensor maximum
2139 * resolution given above constraints. It is required that after aspect ratio adjustments,
2140 * additional size reduction due to other issues must be less than 3% in area. For example,
2141 * if the sensor maximum resolution is 3280x2464, if the maximum JPEG size has aspect
2142 * ratio 4:3, and the JPEG encoder alignment requirement is 16, the maximum JPEG size will be
2143 * 3264x2448.</li>
2144 * </ul>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002145 * <p>This key is available on all devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002146 *
2147 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2148 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2149 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2150 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002151 @PublicKey
2152 @SyntheticKey
Igor Murashkin9c595172014-05-12 13:56:20 -07002153 public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP =
2154 new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class);
Igor Murashkina23ffb52014-02-07 18:52:34 -08002155
2156 /**
Zhijun He14986152014-05-22 21:17:37 -07002157 * <p>The crop type that this camera device supports.</p>
2158 * <p>When passing a non-centered crop region ({@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}) to a camera
2159 * device that only supports CENTER_ONLY cropping, the camera device will move the
2160 * crop region to the center of the sensor active array ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize})
2161 * and keep the crop region width and height unchanged. The camera device will return the
2162 * final used crop region in metadata result {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
2163 * <p>Camera devices that support FREEFORM cropping will support any crop region that
2164 * is inside of the active array. The camera device will apply the same crop region and
2165 * 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 -07002166 * <p>LEGACY capability devices will only support CENTER_ONLY cropping.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002167 * <p><b>Possible values:</b>
2168 * <ul>
2169 * <li>{@link #SCALER_CROPPING_TYPE_CENTER_ONLY CENTER_ONLY}</li>
2170 * <li>{@link #SCALER_CROPPING_TYPE_FREEFORM FREEFORM}</li>
2171 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002172 * <p>This key is available on all devices.</p>
Zhijun He14986152014-05-22 21:17:37 -07002173 *
Zhijun He14986152014-05-22 21:17:37 -07002174 * @see CaptureRequest#SCALER_CROP_REGION
2175 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2176 * @see #SCALER_CROPPING_TYPE_CENTER_ONLY
2177 * @see #SCALER_CROPPING_TYPE_FREEFORM
2178 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002179 @PublicKey
Zhijun He14986152014-05-22 21:17:37 -07002180 public static final Key<Integer> SCALER_CROPPING_TYPE =
2181 new Key<Integer>("android.scaler.croppingType", int.class);
2182
2183 /**
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002184 * <p>The area of the image sensor which corresponds to active pixels after any geometric
2185 * distortion correction has been applied.</p>
2186 * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2187 * the region that actually receives light from the scene) after any geometric correction
2188 * has been applied, and should be treated as the maximum size in pixels of any of the
2189 * image output formats aside from the raw formats.</p>
2190 * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
2191 * the full pixel array, and the size of the full pixel array is given by
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002192 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002193 * <p>The coordinate system for most other keys that list pixel coordinates, including
2194 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, is defined relative to the active array rectangle given in
2195 * this field, with <code>(0, 0)</code> being the top-left of this rectangle.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002196 * <p>The active array may be smaller than the full pixel array, since the full array may
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002197 * include black calibration pixels or other inactive regions, and geometric correction
2198 * resulting in scaling or cropping may have been applied.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002199 * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002200 * <p>This key is available on all devices.</p>
2201 *
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002202 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002203 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002204 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002205 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002206 public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE =
2207 new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002208
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002209 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002210 * <p>Range of sensitivities for {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} supported by this
2211 * camera device.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002212 * <p>The values are the standard ISO sensitivity values,
2213 * as defined in ISO 12232:2006.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002214 * <p><b>Range of valid values:</b><br>
2215 * Min &lt;= 100, Max &gt;= 800</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002216 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2217 * <p><b>Full capability</b> -
2218 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2219 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002220 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002221 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002222 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002223 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002224 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07002225 public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE =
2226 new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002227
2228 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002229 * <p>The arrangement of color filters on sensor;
Zhijun Hed1784962014-04-08 17:41:46 -07002230 * represents the colors in the top-left 2x2 section of
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002231 * the sensor, in reading order.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002232 * <p><b>Possible values:</b>
2233 * <ul>
2234 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB RGGB}</li>
2235 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG GRBG}</li>
2236 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG GBRG}</li>
2237 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR BGGR}</li>
2238 * <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB RGB}</li>
2239 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002240 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2241 * <p><b>Full capability</b> -
2242 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2243 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2244 *
2245 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Hed1784962014-04-08 17:41:46 -07002246 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB
2247 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG
2248 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG
2249 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR
2250 * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB
2251 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002252 @PublicKey
Zhijun Hed1784962014-04-08 17:41:46 -07002253 public static final Key<Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT =
2254 new Key<Integer>("android.sensor.info.colorFilterArrangement", int.class);
2255
2256 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002257 * <p>The range of image exposure times for {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} supported
2258 * by this camera device.</p>
2259 * <p><b>Units</b>: Nanoseconds</p>
2260 * <p><b>Range of valid values:</b><br>
2261 * The minimum exposure time will be less than 100 us. For FULL
Zhijun He28288ca2014-06-25 15:49:13 -07002262 * capability devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL),
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002263 * the maximum exposure time will be greater than 100ms.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002264 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2265 * <p><b>Full capability</b> -
2266 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2267 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08002268 *
Zhijun He28288ca2014-06-25 15:49:13 -07002269 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08002270 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002271 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002272 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07002273 public static final Key<android.util.Range<Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE =
2274 new Key<android.util.Range<Long>>("android.sensor.info.exposureTimeRange", new TypeReference<android.util.Range<Long>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002275
2276 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002277 * <p>The maximum possible frame duration (minimum frame rate) for
2278 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} that is supported this camera device.</p>
2279 * <p>Attempting to use frame durations beyond the maximum will result in the frame
2280 * duration being clipped to the maximum. See that control for a full definition of frame
2281 * durations.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002282 * <p>Refer to {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
2283 * for the minimum frame duration values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002284 * <p><b>Units</b>: Nanoseconds</p>
2285 * <p><b>Range of valid values:</b><br>
2286 * For FULL capability devices
2287 * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL), at least 100ms.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002288 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2289 * <p><b>Full capability</b> -
2290 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2291 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin6b7ddc42014-02-03 14:39:19 -08002292 *
Zhijun He28288ca2014-06-25 15:49:13 -07002293 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002294 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002295 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002296 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002297 public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION =
2298 new Key<Long>("android.sensor.info.maxFrameDuration", long.class);
2299
2300 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002301 * <p>The physical dimensions of the full pixel
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002302 * array.</p>
2303 * <p>This is the physical size of the sensor pixel
2304 * array defined by {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002305 * <p><b>Units</b>: Millimeters</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002306 * <p>This key is available on all devices.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002307 *
2308 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002309 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002310 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002311 public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE =
2312 new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002313
2314 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002315 * <p>Dimensions of the full pixel array, possibly
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002316 * including black calibration pixels.</p>
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002317 * <p>The pixel count of the full pixel array of the image sensor, which covers
2318 * {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area. This represents the full pixel dimensions of
2319 * the raw buffers produced by this sensor.</p>
2320 * <p>If a camera device supports raw sensor formats, either this or
2321 * {@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 -08002322 * output formats listed in {@link android.hardware.camera2.params.StreamConfigurationMap }
2323 * (this depends on whether or not the image sensor returns buffers containing pixels that
2324 * are not part of the active array region for blacklevel calibration or other purposes).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002325 * <p>Some parts of the full pixel array may not receive light from the scene,
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002326 * or be otherwise inactive. The {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} key
2327 * defines the rectangle of active pixels that will be included in processed image
2328 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002329 * <p><b>Units</b>: Pixels</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002330 * <p>This key is available on all devices.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002331 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002332 * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE
Ruben Brunk224eb3a2015-06-15 17:32:06 -07002333 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002334 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002335 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002336 public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE =
2337 new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class);
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002338
2339 /**
Ruben Brunke60e29552014-02-18 10:44:17 -08002340 * <p>Maximum raw value output by sensor.</p>
2341 * <p>This specifies the fully-saturated encoding level for the raw
2342 * sample values from the sensor. This is typically caused by the
2343 * sensor becoming highly non-linear or clipping. The minimum for
2344 * each channel is specified by the offset in the
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002345 * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} key.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08002346 * <p>The white level is typically determined either by sensor bit depth
Ruben Brunke89b1202014-03-24 17:10:35 -07002347 * (8-14 bits is expected), or by the point where the sensor response
Ruben Brunke60e29552014-02-18 10:44:17 -08002348 * becomes too non-linear to be useful. The default value for this is
2349 * maximum representable value for a 16-bit raw sample (2^16 - 1).</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08002350 * <p>The white level values of captured images may vary for different
2351 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
2352 * represents a coarse approximation for such case. It is recommended
2353 * to use {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} for captures when supported
2354 * by the camera device, which provides more accurate white level values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002355 * <p><b>Range of valid values:</b><br>
2356 * &gt; 255 (8-bit output)</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002357 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08002358 *
2359 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
Zhijun Hecd950b62015-11-12 17:47:52 -08002360 * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
2361 * @see CaptureRequest#SENSOR_SENSITIVITY
Ruben Brunke60e29552014-02-18 10:44:17 -08002362 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002363 @PublicKey
Ruben Brunke60e29552014-02-18 10:44:17 -08002364 public static final Key<Integer> SENSOR_INFO_WHITE_LEVEL =
2365 new Key<Integer>("android.sensor.info.whiteLevel", int.class);
2366
2367 /**
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002368 * <p>The time base source for sensor capture start timestamps.</p>
2369 * <p>The timestamps provided for captures are always in nanoseconds and monotonic, but
2370 * may not based on a time source that can be compared to other system time sources.</p>
2371 * <p>This characteristic defines the source for the timestamps, and therefore whether they
2372 * can be compared against other system time sources/timestamps.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002373 * <p><b>Possible values:</b>
2374 * <ul>
2375 * <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN UNKNOWN}</li>
2376 * <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME REALTIME}</li>
2377 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002378 * <p>This key is available on all devices.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002379 * @see #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN
2380 * @see #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME
Zhijun He45fa43a12014-06-13 18:29:37 -07002381 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002382 @PublicKey
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002383 public static final Key<Integer> SENSOR_INFO_TIMESTAMP_SOURCE =
2384 new Key<Integer>("android.sensor.info.timestampSource", int.class);
Zhijun He45fa43a12014-06-13 18:29:37 -07002385
2386 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002387 * <p>Whether the RAW images output from this camera device are subject to
2388 * lens shading correction.</p>
2389 * <p>If TRUE, all images produced by the camera device in the RAW image formats will
2390 * have lens shading correction already applied to it. If FALSE, the images will
2391 * not be adjusted for lens shading correction.
2392 * See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image formats.</p>
2393 * <p>This key will be <code>null</code> for all devices do not report this information.
2394 * Devices with RAW capability will always report this information in this key.</p>
2395 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2396 *
2397 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
2398 */
2399 @PublicKey
2400 public static final Key<Boolean> SENSOR_INFO_LENS_SHADING_APPLIED =
2401 new Key<Boolean>("android.sensor.info.lensShadingApplied", boolean.class);
2402
2403 /**
Ruben Brunk1b02df42015-07-01 12:53:45 -07002404 * <p>The area of the image sensor which corresponds to active pixels prior to the
2405 * application of any geometric distortion correction.</p>
2406 * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2407 * the region that actually receives light from the scene) before any geometric correction
2408 * has been applied, and should be treated as the active region rectangle for any of the
2409 * raw formats. All metadata associated with raw processing (e.g. the lens shading
2410 * correction map, and radial distortion fields) treats the top, left of this rectangle as
2411 * the origin, (0,0).</p>
2412 * <p>The size of this region determines the maximum field of view and the maximum number of
2413 * pixels that an image from this sensor can contain, prior to the application of
2414 * geometric distortion correction. The effective maximum pixel dimensions of a
2415 * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}
2416 * field, and the effective maximum field of view for a post-distortion-corrected image
2417 * can be calculated by applying the geometric distortion correction fields to this
2418 * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2419 * <p>E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the
2420 * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel,
2421 * (x', y'), in the raw pixel array with dimensions give in
2422 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:</p>
2423 * <ol>
2424 * <li>Choose a pixel (x', y') within the active array region of the raw buffer given in
2425 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, otherwise this pixel is considered
2426 * to be outside of the FOV, and will not be shown in the processed output image.</li>
2427 * <li>Apply geometric distortion correction to get the post-distortion pixel coordinate,
2428 * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw
2429 * buffers is defined relative to the top, left of the
2430 * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} rectangle.</li>
2431 * <li>If the resulting corrected pixel coordinate is within the region given in
2432 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the
2433 * processed output image buffer is <code>(x_i - activeArray.left, y_i - activeArray.top)</code>,
2434 * when the top, left coordinate of that buffer is treated as (0, 0).</li>
2435 * </ol>
2436 * <p>Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}
2437 * is (100,100), {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is (10, 10, 100, 100),
2438 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion
2439 * correction doesn't change the pixel coordinate, the resulting pixel selected in
2440 * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer
2441 * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5)
2442 * relative to the top,left of post-processed YUV output buffer with dimensions given in
2443 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2444 * <p>The currently supported fields that correct for geometric distortion are:</p>
2445 * <ol>
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002446 * <li>{@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion}.</li>
Ruben Brunk1b02df42015-07-01 12:53:45 -07002447 * </ol>
2448 * <p>If all of the geometric distortion fields are no-ops, this rectangle will be the same
2449 * as the post-distortion-corrected rectangle given in
2450 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2451 * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
2452 * the full pixel array, and the size of the full pixel array is given by
2453 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
2454 * <p>The pre-correction active array may be smaller than the full pixel array, since the
2455 * full array may include black calibration pixels or other inactive regions.</p>
2456 * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
2457 * <p>This key is available on all devices.</p>
2458 *
Eino-Ville Talvalaabf0b8b2015-08-19 16:21:15 -07002459 * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
Ruben Brunk1b02df42015-07-01 12:53:45 -07002460 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2461 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2462 * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
2463 */
2464 @PublicKey
2465 public static final Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE =
2466 new Key<android.graphics.Rect>("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class);
2467
2468 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002469 * <p>The standard reference illuminant used as the scene light source when
2470 * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
2471 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
2472 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} matrices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002473 * <p>The values in this key correspond to the values defined for the
Ruben Brunk7c062362014-04-15 23:53:53 -07002474 * EXIF LightSource tag. These illuminants are standard light sources
2475 * that are often used calibrating camera devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002476 * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
Ruben Brunk7c062362014-04-15 23:53:53 -07002477 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
2478 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} will also be present.</p>
2479 * <p>Some devices may choose to provide a second set of calibration
2480 * information for improved quality, including
2481 * {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2} and its corresponding matrices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002482 * <p><b>Possible values:</b>
2483 * <ul>
2484 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT DAYLIGHT}</li>
2485 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT FLUORESCENT}</li>
2486 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN TUNGSTEN}</li>
2487 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLASH FLASH}</li>
2488 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER FINE_WEATHER}</li>
2489 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER CLOUDY_WEATHER}</li>
2490 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_SHADE SHADE}</li>
2491 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT DAYLIGHT_FLUORESCENT}</li>
2492 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT DAY_WHITE_FLUORESCENT}</li>
2493 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT COOL_WHITE_FLUORESCENT}</li>
2494 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT WHITE_FLUORESCENT}</li>
2495 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A STANDARD_A}</li>
2496 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B STANDARD_B}</li>
2497 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C STANDARD_C}</li>
2498 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D55 D55}</li>
2499 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D65 D65}</li>
2500 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D75 D75}</li>
2501 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D50 D50}</li>
2502 * <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN ISO_STUDIO_TUNGSTEN}</li>
2503 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002504 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk7c062362014-04-15 23:53:53 -07002505 *
2506 * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1
2507 * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM1
2508 * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX1
2509 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2510 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT
2511 * @see #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT
2512 * @see #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN
2513 * @see #SENSOR_REFERENCE_ILLUMINANT1_FLASH
2514 * @see #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER
2515 * @see #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER
2516 * @see #SENSOR_REFERENCE_ILLUMINANT1_SHADE
2517 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT
2518 * @see #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT
2519 * @see #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT
2520 * @see #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT
2521 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A
2522 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B
2523 * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C
2524 * @see #SENSOR_REFERENCE_ILLUMINANT1_D55
2525 * @see #SENSOR_REFERENCE_ILLUMINANT1_D65
2526 * @see #SENSOR_REFERENCE_ILLUMINANT1_D75
2527 * @see #SENSOR_REFERENCE_ILLUMINANT1_D50
2528 * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN
2529 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002530 @PublicKey
Ruben Brunk7c062362014-04-15 23:53:53 -07002531 public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 =
2532 new Key<Integer>("android.sensor.referenceIlluminant1", int.class);
2533
2534 /**
2535 * <p>The standard reference illuminant used as the scene light source when
2536 * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
2537 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
2538 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} matrices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002539 * <p>See {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1} for more details.</p>
2540 * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
Ruben Brunk7c062362014-04-15 23:53:53 -07002541 * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
2542 * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} will also be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002543 * <p><b>Range of valid values:</b><br>
2544 * Any value listed in {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002545 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk7c062362014-04-15 23:53:53 -07002546 *
2547 * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2
2548 * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM2
2549 * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2
2550 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2551 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002552 @PublicKey
Ruben Brunk7c062362014-04-15 23:53:53 -07002553 public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 =
2554 new Key<Byte>("android.sensor.referenceIlluminant2", byte.class);
2555
2556 /**
2557 * <p>A per-device calibration transform matrix that maps from the
2558 * reference sensor colorspace to the actual device sensor colorspace.</p>
2559 * <p>This matrix is used to correct for per-device variations in the
2560 * sensor colorspace, and is used for processing raw buffer data.</p>
2561 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2562 * contains a per-device calibration transform that maps colors
2563 * from reference sensor color space (i.e. the "golden module"
2564 * colorspace) into this camera device's native sensor color
2565 * space under the first reference illuminant
2566 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
2567 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2568 *
2569 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2570 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002571 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002572 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1 =
2573 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002574
2575 /**
2576 * <p>A per-device calibration transform matrix that maps from the
2577 * reference sensor colorspace to the actual device sensor colorspace
2578 * (this is the colorspace of the raw buffer data).</p>
2579 * <p>This matrix is used to correct for per-device variations in the
2580 * sensor colorspace, and is used for processing raw buffer data.</p>
2581 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2582 * contains a per-device calibration transform that maps colors
2583 * from reference sensor color space (i.e. the "golden module"
2584 * colorspace) into this camera device's native sensor color
2585 * space under the second reference illuminant
2586 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
2587 * <p>This matrix will only be present if the second reference
2588 * illuminant is present.</p>
2589 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2590 *
2591 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2592 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002593 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002594 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2 =
2595 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002596
2597 /**
2598 * <p>A matrix that transforms color values from CIE XYZ color space to
2599 * reference sensor color space.</p>
2600 * <p>This matrix is used to convert from the standard CIE XYZ color
2601 * space to the reference sensor colorspace, and is used when processing
2602 * raw buffer data.</p>
2603 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2604 * contains a color transform matrix that maps colors from the CIE
2605 * XYZ color space to the reference sensor color space (i.e. the
2606 * "golden module" colorspace) under the first reference illuminant
2607 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
2608 * <p>The white points chosen in both the reference sensor color space
2609 * and the CIE XYZ colorspace when calculating this transform will
2610 * match the standard white point for the first reference illuminant
2611 * (i.e. no chromatic adaptation will be applied by this transform).</p>
2612 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2613 *
2614 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2615 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002616 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002617 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1 =
2618 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002619
2620 /**
2621 * <p>A matrix that transforms color values from CIE XYZ color space to
2622 * reference sensor color space.</p>
2623 * <p>This matrix is used to convert from the standard CIE XYZ color
2624 * space to the reference sensor colorspace, and is used when processing
2625 * raw buffer data.</p>
2626 * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2627 * contains a color transform matrix that maps colors from the CIE
2628 * XYZ color space to the reference sensor color space (i.e. the
2629 * "golden module" colorspace) under the second reference illuminant
2630 * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
2631 * <p>The white points chosen in both the reference sensor color space
2632 * and the CIE XYZ colorspace when calculating this transform will
2633 * match the standard white point for the second reference illuminant
2634 * (i.e. no chromatic adaptation will be applied by this transform).</p>
2635 * <p>This matrix will only be present if the second reference
2636 * illuminant is present.</p>
2637 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2638 *
2639 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2640 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002641 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002642 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2 =
2643 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002644
2645 /**
2646 * <p>A matrix that transforms white balanced camera colors from the reference
2647 * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
2648 * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
2649 * is used when processing raw buffer data.</p>
2650 * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
2651 * a color transform matrix that maps white balanced colors from the
2652 * reference sensor color space to the CIE XYZ color space with a D50 white
2653 * point.</p>
2654 * <p>Under the first reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1})
2655 * this matrix is chosen so that the standard white point for this reference
2656 * illuminant in the reference sensor colorspace is mapped to D50 in the
2657 * CIE XYZ colorspace.</p>
2658 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2659 *
2660 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2661 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002662 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002663 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1 =
2664 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix1", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002665
2666 /**
2667 * <p>A matrix that transforms white balanced camera colors from the reference
2668 * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
2669 * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
2670 * is used when processing raw buffer data.</p>
2671 * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
2672 * a color transform matrix that maps white balanced colors from the
2673 * reference sensor color space to the CIE XYZ color space with a D50 white
2674 * point.</p>
2675 * <p>Under the second reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2})
2676 * this matrix is chosen so that the standard white point for this reference
2677 * illuminant in the reference sensor colorspace is mapped to D50 in the
2678 * CIE XYZ colorspace.</p>
2679 * <p>This matrix will only be present if the second reference
2680 * illuminant is present.</p>
2681 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2682 *
2683 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2684 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002685 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002686 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2 =
2687 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix2", android.hardware.camera2.params.ColorSpaceTransform.class);
Ruben Brunk7c062362014-04-15 23:53:53 -07002688
2689 /**
Ruben Brunk67b47022014-02-07 15:26:29 -08002690 * <p>A fixed black level offset for each of the color filter arrangement
2691 * (CFA) mosaic channels.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002692 * <p>This key specifies the zero light value for each of the CFA mosaic
Ruben Brunke60e29552014-02-18 10:44:17 -08002693 * channels in the camera sensor. The maximal value output by the
2694 * 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 -07002695 * <p>The values are given in the same order as channels listed for the CFA
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002696 * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
Ruben Brunk52842e72014-06-05 13:16:45 -07002697 * nth value given corresponds to the black level offset for the nth
2698 * color channel listed in the CFA.</p>
Zhijun Hecd950b62015-11-12 17:47:52 -08002699 * <p>The black level values of captured images may vary for different
2700 * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
2701 * represents a coarse approximation for such case. It is recommended to
2702 * use {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} or use pixels from
2703 * {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} directly for captures when
2704 * supported by the camera device, which provides more accurate black
2705 * level values. For raw capture in particular, it is recommended to use
2706 * pixels from {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} to calculate black
2707 * level values for each frame.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002708 * <p><b>Range of valid values:</b><br>
2709 * &gt;= 0 for each.</p>
Ruben Brunk1ef676f2014-02-07 16:08:38 -08002710 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunke60e29552014-02-18 10:44:17 -08002711 *
Zhijun Hecd950b62015-11-12 17:47:52 -08002712 * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
Ruben Brunk52842e72014-06-05 13:16:45 -07002713 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
Ruben Brunke60e29552014-02-18 10:44:17 -08002714 * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
Zhijun Hecd950b62015-11-12 17:47:52 -08002715 * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
2716 * @see CaptureRequest#SENSOR_SENSITIVITY
Ruben Brunk67b47022014-02-07 15:26:29 -08002717 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002718 @PublicKey
Ruben Brunk52842e72014-06-05 13:16:45 -07002719 public static final Key<android.hardware.camera2.params.BlackLevelPattern> SENSOR_BLACK_LEVEL_PATTERN =
2720 new Key<android.hardware.camera2.params.BlackLevelPattern>("android.sensor.blackLevelPattern", android.hardware.camera2.params.BlackLevelPattern.class);
Ruben Brunk67b47022014-02-07 15:26:29 -08002721
2722 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002723 * <p>Maximum sensitivity that is implemented
Zhijun He153ac102014-02-03 12:25:12 -08002724 * purely through analog gain.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002725 * <p>For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002726 * equal to this, all applied gain must be analog. For
Zhijun He153ac102014-02-03 12:25:12 -08002727 * values above this, the gain applied can be a mix of analog and
2728 * digital.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002729 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002730 * <p><b>Full capability</b> -
2731 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2732 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Alex Raye83c4eb2013-10-02 17:14:36 -07002733 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002734 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002735 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002736 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002737 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002738 public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY =
2739 new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class);
2740
2741 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002742 * <p>Clockwise angle through which the output image needs to be rotated to be
2743 * upright on the device screen in its native orientation.</p>
2744 * <p>Also defines the direction of rolling shutter readout, which is from top to bottom in
2745 * the sensor's coordinate system.</p>
2746 * <p><b>Units</b>: Degrees of clockwise rotation; always a multiple of
2747 * 90</p>
2748 * <p><b>Range of valid values:</b><br>
2749 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002750 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002751 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002752 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002753 public static final Key<Integer> SENSOR_ORIENTATION =
2754 new Key<Integer>("android.sensor.orientation", int.class);
2755
2756 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002757 * <p>List of sensor test pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}
2758 * supported by this camera device.</p>
2759 * <p>Defaults to OFF, and always includes OFF if defined.</p>
2760 * <p><b>Range of valid values:</b><br>
2761 * Any value listed in {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002762 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002763 *
2764 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
Igor Murashkinc127f052014-01-17 18:06:02 -08002765 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002766 @PublicKey
Zhijun Hea4866242014-03-27 23:51:34 -07002767 public static final Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES =
2768 new Key<int[]>("android.sensor.availableTestPatternModes", int[].class);
Igor Murashkinc127f052014-01-17 18:06:02 -08002769
2770 /**
Zhijun Hecd950b62015-11-12 17:47:52 -08002771 * <p>List of disjoint rectangles indicating the sensor
2772 * optically shielded black pixel regions.</p>
2773 * <p>In most camera sensors, the active array is surrounded by some
2774 * optically shielded pixel areas. By blocking light, these pixels
2775 * provides a reliable black reference for black level compensation
2776 * in active array region.</p>
2777 * <p>This key provides a list of disjoint rectangles specifying the
2778 * regions of optically shielded (with metal shield) black pixel
2779 * regions if the camera device is capable of reading out these black
2780 * pixels in the output raw images. In comparison to the fixed black
2781 * level values reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern}, this key
2782 * may provide a more accurate way for the application to calculate
2783 * black level of each captured raw images.</p>
2784 * <p>When this key is reported, the {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} and
2785 * {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} will also be reported.</p>
2786 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2787 *
2788 * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
2789 * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
2790 * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
2791 */
2792 @PublicKey
2793 public static final Key<android.graphics.Rect[]> SENSOR_OPTICAL_BLACK_REGIONS =
2794 new Key<android.graphics.Rect[]>("android.sensor.opticalBlackRegions", android.graphics.Rect[].class);
2795
2796 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002797 * <p>List of lens shading modes for {@link CaptureRequest#SHADING_MODE android.shading.mode} that are supported by this camera device.</p>
2798 * <p>This list contains lens shading modes that can be set for the camera device.
2799 * Camera devices that support the MANUAL_POST_PROCESSING capability will always
2800 * list OFF and FAST mode. This includes all FULL level devices.
2801 * LEGACY devices will always only support FAST mode.</p>
2802 * <p><b>Range of valid values:</b><br>
2803 * Any value listed in {@link CaptureRequest#SHADING_MODE android.shading.mode}</p>
2804 * <p>This key is available on all devices.</p>
2805 *
2806 * @see CaptureRequest#SHADING_MODE
2807 */
2808 @PublicKey
2809 public static final Key<int[]> SHADING_AVAILABLE_MODES =
2810 new Key<int[]>("android.shading.availableModes", int[].class);
2811
2812 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002813 * <p>List of face detection modes for {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} that are
2814 * supported by this camera device.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002815 * <p>OFF is always supported.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002816 * <p><b>Range of valid values:</b><br>
2817 * Any value listed in {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002818 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002819 *
2820 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002821 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002822 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002823 public static final Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES =
2824 new Key<int[]>("android.statistics.info.availableFaceDetectModes", int[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002825
2826 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002827 * <p>The maximum number of simultaneously detectable
2828 * faces.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002829 * <p><b>Range of valid values:</b><br>
2830 * 0 for cameras without available face detection; otherwise:
2831 * <code>&gt;=4</code> for LIMITED or FULL hwlevel devices or
2832 * <code>&gt;0</code> for LEGACY devices.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002833 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002834 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002835 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002836 public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT =
2837 new Key<Integer>("android.statistics.info.maxFaceCount", int.class);
2838
2839 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002840 * <p>List of hot pixel map output modes for {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode} that are
2841 * supported by this camera device.</p>
2842 * <p>If no hotpixel map output is available for this camera device, this will contain only
2843 * <code>false</code>.</p>
2844 * <p>ON is always supported on devices with the RAW capability.</p>
2845 * <p><b>Range of valid values:</b><br>
2846 * Any value listed in {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002847 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002848 *
2849 * @see CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE
2850 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002851 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002852 public static final Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES =
2853 new Key<boolean[]>("android.statistics.info.availableHotPixelMapModes", boolean[].class);
2854
2855 /**
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002856 * <p>List of lens shading map output modes for {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} that
2857 * are supported by this camera device.</p>
2858 * <p>If no lens shading map output is available for this camera device, this key will
2859 * contain only OFF.</p>
2860 * <p>ON is always supported on devices with the RAW capability.
2861 * LEGACY mode devices will always only support OFF.</p>
2862 * <p><b>Range of valid values:</b><br>
2863 * Any value listed in {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode}</p>
2864 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2865 *
2866 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2867 */
2868 @PublicKey
Yin-Chia Yeh656931d2015-05-22 16:37:27 -07002869 public static final Key<int[]> STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES =
2870 new Key<int[]>("android.statistics.info.availableLensShadingMapModes", int[].class);
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08002871
2872 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002873 * <p>Maximum number of supported points in the
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002874 * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002875 * <p>If the actual number of points provided by the application (in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}*) is
2876 * less than this maximum, the camera device will resample the curve to its internal
2877 * representation, using linear interpolation.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08002878 * <p>The output curves in the result metadata may have a different number
2879 * of points than the input curves, and will represent the actual
2880 * hardware curves used as closely as possible when linearly interpolated.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002881 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2882 * <p><b>Full capability</b> -
2883 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2884 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkine0060932014-01-17 17:24:11 -08002885 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002886 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07002887 * @see CaptureRequest#TONEMAP_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002888 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002889 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002890 public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS =
2891 new Key<Integer>("android.tonemap.maxCurvePoints", int.class);
2892
2893 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002894 * <p>List of tonemapping modes for {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} that are supported by this camera
2895 * device.</p>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08002896 * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always contain
2897 * at least one of below mode combinations:</p>
2898 * <ul>
Yin-Chia Yehfba08dd2015-04-02 14:05:14 -07002899 * <li>CONTRAST_CURVE, FAST and HIGH_QUALITY</li>
2900 * <li>GAMMA_VALUE, PRESET_CURVE, FAST and HIGH_QUALITY</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08002901 * </ul>
2902 * <p>This includes all FULL level devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002903 * <p><b>Range of valid values:</b><br>
2904 * Any value listed in {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002905 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2906 * <p><b>Full capability</b> -
2907 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2908 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002909 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002910 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002911 * @see CaptureRequest#TONEMAP_MODE
2912 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002913 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -07002914 public static final Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES =
2915 new Key<int[]>("android.tonemap.availableToneMapModes", int[].class);
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002916
2917 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002918 * <p>A list of camera LEDs that are available on this system.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002919 * <p><b>Possible values:</b>
2920 * <ul>
2921 * <li>{@link #LED_AVAILABLE_LEDS_TRANSMIT TRANSMIT}</li>
2922 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002923 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002924 * @see #LED_AVAILABLE_LEDS_TRANSMIT
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002925 * @hide
2926 */
2927 public static final Key<int[]> LED_AVAILABLE_LEDS =
2928 new Key<int[]>("android.led.availableLeds", int[].class);
2929
2930 /**
Igor Murashkine46c0da2014-02-07 18:34:37 -08002931 * <p>Generally classifies the overall set of the camera device functionality.</p>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08002932 * <p>The supported hardware level is a high-level description of the camera device's
2933 * capabilities, summarizing several capabilities into one field. Each level adds additional
2934 * features to the previous one, and is always a strict superset of the previous level.
2935 * The ordering is <code>LEGACY &lt; LIMITED &lt; FULL &lt; LEVEL_3</code>.</p>
2936 * <p>Starting from <code>LEVEL_3</code>, the level enumerations are guaranteed to be in increasing
2937 * numerical value as well. To check if a given device is at least at a given hardware level,
2938 * the following code snippet can be used:</p>
2939 * <pre><code>// Returns true if the device supports the required hardware level, or better.
2940 * boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) {
2941 * int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
2942 * if (deviceLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY) {
2943 * return requiredLevel == deviceLevel;
2944 * }
2945 * // deviceLevel is not LEGACY, can use numerical sort
2946 * return requiredLevel &lt;= deviceLevel;
2947 * }
2948 * </code></pre>
2949 * <p>At a high level, the levels are:</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002950 * <ul>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08002951 * <li><code>LEGACY</code> devices operate in a backwards-compatibility mode for older
2952 * Android devices, and have very limited capabilities.</li>
2953 * <li><code>LIMITED</code> devices represent the
2954 * baseline feature set, and may also include additional capabilities that are
2955 * subsets of <code>FULL</code>.</li>
2956 * <li><code>FULL</code> devices additionally support per-frame manual control of sensor, flash, lens and
2957 * post-processing settings, and image capture at a high rate.</li>
2958 * <li><code>LEVEL_3</code> devices additionally support YUV reprocessing and RAW image capture, along
2959 * with additional output stream configurations.</li>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002960 * </ul>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08002961 * <p>See the individual level enums for full descriptions of the supported capabilities. The
2962 * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} entry describes the device's capabilities at a
2963 * finer-grain level, if needed. In addition, many controls have their available settings or
Eino-Ville Talvala9dc7ec12017-11-10 15:23:00 -08002964 * ranges defined in individual entries from {@link android.hardware.camera2.CameraCharacteristics }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002965 * <p>Some features are not part of any particular hardware level or capability and must be
2966 * queried separately. These include:</p>
2967 * <ul>
2968 * <li>Calibrated timestamps ({@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME)</li>
2969 * <li>Precision lens control ({@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} <code>==</code> CALIBRATED)</li>
2970 * <li>Face detection ({@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes})</li>
2971 * <li>Optical or electrical image stabilization
2972 * ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization},
2973 * {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes})</li>
2974 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002975 * <p><b>Possible values:</b>
2976 * <ul>
2977 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED}</li>
2978 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}</li>
2979 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}</li>
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08002980 * <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_3 3}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002981 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002982 * <p>This key is available on all devices.</p>
Igor Murashkine46c0da2014-02-07 18:34:37 -08002983 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002984 * @see CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES
2985 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
2986 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Igor Murashkine46c0da2014-02-07 18:34:37 -08002987 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002988 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
2989 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002990 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
2991 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
Ruben Brunk4a61a862014-07-01 16:00:26 -07002992 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
Eino-Ville Talvala7c6d73f2016-01-21 13:55:11 -08002993 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_3
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002994 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002995 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002996 public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
2997 new Key<Integer>("android.info.supportedHardwareLevel", int.class);
2998
Igor Murashkin3865a842014-01-17 18:18:39 -08002999 /**
Chien-Yu Chena1d1d5b2018-01-03 12:14:53 -08003000 * <p>A short string for manufacturer version information about the camera device, such as
3001 * ISP hardware, sensors, etc.</p>
3002 * <p>This can be used in {@link android.media.ExifInterface#TAG_IMAGE_DESCRIPTION TAG_IMAGE_DESCRIPTION}
3003 * in jpeg EXIF. This key may be absent if no version information is available on the
3004 * device.</p>
3005 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3006 */
3007 @PublicKey
3008 public static final Key<String> INFO_VERSION =
3009 new Key<String>("android.info.version", String.class);
3010
3011 /**
Igor Murashkin3865a842014-01-17 18:18:39 -08003012 * <p>The maximum number of frames that can occur after a request
3013 * (different than the previous) has been submitted, and before the
Chien-Yu Chen161a76c2015-06-26 11:23:55 -07003014 * result's state becomes synchronized.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003015 * <p>This defines the maximum distance (in number of metadata results),
Chien-Yu Chen161a76c2015-06-26 11:23:55 -07003016 * between the frame number of the request that has new controls to apply
3017 * and the frame number of the result that has all the controls applied.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003018 * <p>In other words this acts as an upper boundary for how many frames
3019 * must occur before the camera device knows for a fact that the new
3020 * submitted camera settings have been applied in outgoing frames.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003021 * <p><b>Units</b>: Frame counts</p>
3022 * <p><b>Possible values:</b>
3023 * <ul>
3024 * <li>{@link #SYNC_MAX_LATENCY_PER_FRAME_CONTROL PER_FRAME_CONTROL}</li>
3025 * <li>{@link #SYNC_MAX_LATENCY_UNKNOWN UNKNOWN}</li>
3026 * </ul></p>
3027 * <p><b>Available values for this device:</b><br>
3028 * A positive value, PER_FRAME_CONTROL, or UNKNOWN.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003029 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003030 * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL
3031 * @see #SYNC_MAX_LATENCY_UNKNOWN
3032 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003033 @PublicKey
Igor Murashkin3865a842014-01-17 18:18:39 -08003034 public static final Key<Integer> SYNC_MAX_LATENCY =
3035 new Key<Integer>("android.sync.maxLatency", int.class);
3036
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003037 /**
Zhijun He513f7c32015-04-24 18:23:54 -07003038 * <p>The maximal camera capture pipeline stall (in unit of frame count) introduced by a
3039 * reprocess capture request.</p>
3040 * <p>The key describes the maximal interference that one reprocess (input) request
3041 * can introduce to the camera simultaneous streaming of regular (output) capture
3042 * requests, including repeating requests.</p>
3043 * <p>When a reprocessing capture request is submitted while a camera output repeating request
3044 * (e.g. preview) is being served by the camera device, it may preempt the camera capture
3045 * pipeline for at least one frame duration so that the camera device is unable to process
3046 * the following capture request in time for the next sensor start of exposure boundary.
3047 * When this happens, the application may observe a capture time gap (longer than one frame
3048 * duration) between adjacent capture output frames, which usually exhibits as preview
3049 * glitch if the repeating request output targets include a preview surface. This key gives
3050 * the worst-case number of frame stall introduced by one reprocess request with any kind of
3051 * formats/sizes combination.</p>
3052 * <p>If this key reports 0, it means a reprocess request doesn't introduce any glitch to the
3053 * ongoing camera repeating request outputs, as if this reprocess request is never issued.</p>
Chien-Yu Chen8062d312015-05-12 14:24:10 -07003054 * <p>This key is supported if the camera device supports PRIVATE or YUV reprocessing (
3055 * i.e. {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains PRIVATE_REPROCESSING or
Zhijun He513f7c32015-04-24 18:23:54 -07003056 * YUV_REPROCESSING).</p>
3057 * <p><b>Units</b>: Number of frames.</p>
3058 * <p><b>Range of valid values:</b><br>
3059 * &lt;= 4</p>
3060 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3061 * <p><b>Limited capability</b> -
3062 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3063 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3064 *
3065 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3066 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3067 */
3068 @PublicKey
3069 public static final Key<Integer> REPROCESS_MAX_CAPTURE_STALL =
3070 new Key<Integer>("android.reprocess.maxCaptureStall", int.class);
3071
3072 /**
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003073 * <p>The available depth dataspace stream
3074 * configurations that this camera device supports
3075 * (i.e. format, width, height, output/input stream).</p>
3076 * <p>These are output stream configurations for use with
3077 * dataSpace HAL_DATASPACE_DEPTH. The configurations are
3078 * listed as <code>(format, width, height, input?)</code> tuples.</p>
3079 * <p>Only devices that support depth output for at least
3080 * the HAL_PIXEL_FORMAT_Y16 dense depth map may include
3081 * this entry.</p>
3082 * <p>A device that also supports the HAL_PIXEL_FORMAT_BLOB
3083 * sparse depth point cloud must report a single entry for
3084 * the format in this list as <code>(HAL_PIXEL_FORMAT_BLOB,
3085 * android.depth.maxDepthSamples, 1, OUTPUT)</code> in addition to
3086 * the entries for HAL_PIXEL_FORMAT_Y16.</p>
3087 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3088 * <p><b>Limited capability</b> -
3089 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3090 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3091 *
3092 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3093 * @hide
3094 */
3095 public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS =
3096 new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
3097
3098 /**
3099 * <p>This lists the minimum frame duration for each
3100 * format/size combination for depth output formats.</p>
3101 * <p>This should correspond to the frame duration when only that
3102 * stream is active, with all processing (typically in android.*.mode)
3103 * set to either OFF or FAST.</p>
3104 * <p>When multiple streams are used in a request, the minimum frame
3105 * duration will be max(individual stream min durations).</p>
3106 * <p>The minimum frame duration of a stream (of a particular format, size)
3107 * is the same regardless of whether the stream is input or output.</p>
3108 * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
3109 * android.scaler.availableStallDurations for more details about
3110 * calculating the max frame rate.</p>
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003111 * <p><b>Units</b>: (format, width, height, ns) x n</p>
3112 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3113 * <p><b>Limited capability</b> -
3114 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3115 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3116 *
3117 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3118 * @see CaptureRequest#SENSOR_FRAME_DURATION
3119 * @hide
3120 */
3121 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS =
3122 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3123
3124 /**
3125 * <p>This lists the maximum stall duration for each
Zhijun He513f7c32015-04-24 18:23:54 -07003126 * output format/size combination for depth streams.</p>
Eino-Ville Talvala24c369e2015-02-23 15:55:55 -08003127 * <p>A stall duration is how much extra time would get added
3128 * to the normal minimum frame duration for a repeating request
3129 * that has streams with non-zero stall.</p>
3130 * <p>This functions similarly to
3131 * android.scaler.availableStallDurations for depth
3132 * streams.</p>
3133 * <p>All depth output stream formats may have a nonzero stall
3134 * duration.</p>
3135 * <p><b>Units</b>: (format, width, height, ns) x n</p>
3136 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3137 * <p><b>Limited capability</b> -
3138 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3139 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3140 *
3141 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3142 * @hide
3143 */
3144 public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS =
3145 new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3146
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07003147 /**
3148 * <p>Indicates whether a capture request may target both a
3149 * DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as
3150 * YUV_420_888, JPEG, or RAW) simultaneously.</p>
3151 * <p>If TRUE, including both depth and color outputs in a single
3152 * capture request is not supported. An application must interleave color
3153 * and depth requests. If FALSE, a single request can target both types
3154 * of output.</p>
3155 * <p>Typically, this restriction exists on camera devices that
3156 * need to emit a specific pattern or wavelength of light to
3157 * measure depth values, which causes the color image to be
3158 * corrupted during depth measurement.</p>
3159 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3160 * <p><b>Limited capability</b> -
3161 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3162 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3163 *
3164 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3165 */
3166 @PublicKey
3167 public static final Key<Boolean> DEPTH_DEPTH_IS_EXCLUSIVE =
3168 new Key<Boolean>("android.depth.depthIsExclusive", boolean.class);
3169
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003170 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3171 * End generated code
3172 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07003173
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003174
3175
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08003176}