blob: a122b309fdcd28e75ec76427a7b521c50335ece6 [file] [log] [blame]
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001/*
2 * Copyright (C) 2012 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 Talvala70c22072013-08-27 12:09:04 -070019import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkind6d65152014-05-19 16:31:02 -070020import android.hardware.camera2.utils.TypeReference;
21import android.util.Log;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070022import android.util.Rational;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080023
Igor Murashkind6d65152014-05-19 16:31:02 -070024import java.util.List;
25
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080026/**
Igor Murashkindb075af2014-05-21 10:07:08 -070027 * <p>The subset of the results of a single image capture from the image sensor.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080028 *
Igor Murashkindb075af2014-05-21 10:07:08 -070029 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080030 * flash), the processing pipeline, the control algorithms, and the output
31 * buffers.</p>
32 *
33 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
34 * {@link CaptureRequest}. All properties listed for capture requests can also
35 * be queried on the capture result, to determine the final values used for
36 * capture. The result also includes additional metadata about the state of the
37 * camera device during the capture.</p>
38 *
Igor Murashkindb075af2014-05-21 10:07:08 -070039 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
40 * are necessarily available. Some results are {@link CaptureResult partial} and will
41 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
42 * every key available that was enabled by the request.</p>
43 *
44 * <p>{@link CaptureResult} objects are immutable.</p>
Ruben Brunkf967a542014-04-28 16:31:11 -070045 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080046 */
Igor Murashkindb075af2014-05-21 10:07:08 -070047public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
Igor Murashkind6d65152014-05-19 16:31:02 -070048
49 private static final String TAG = "CaptureResult";
50 private static final boolean VERBOSE = false;
51
52 /**
53 * A {@code Key} is used to do capture result field lookups with
54 * {@link CaptureResult#get}.
55 *
56 * <p>For example, to get the timestamp corresponding to the exposure of the first row:
57 * <code><pre>
58 * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
59 * </pre></code>
60 * </p>
61 *
62 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
63 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
64 *
65 * @see CaptureResult#get
66 * @see CameraCharacteristics#getAvailableCaptureResultKeys
67 */
68 public final static class Key<T> {
69 private final CameraMetadataNative.Key<T> mKey;
70
71 /**
72 * Visible for testing and vendor extensions only.
73 *
74 * @hide
75 */
76 public Key(String name, Class<T> type) {
77 mKey = new CameraMetadataNative.Key<T>(name, type);
78 }
79
80 /**
81 * Visible for testing and vendor extensions only.
82 *
83 * @hide
84 */
85 public Key(String name, TypeReference<T> typeReference) {
86 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
87 }
88
89 /**
90 * Return a camelCase, period separated name formatted like:
91 * {@code "root.section[.subsections].name"}.
92 *
93 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
94 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
95 *
96 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
97 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
98 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
99 *
100 * @return String representation of the key name
101 */
102 public String getName() {
103 return mKey.getName();
104 }
105
106 /**
107 * {@inheritDoc}
108 */
109 @Override
110 public final int hashCode() {
111 return mKey.hashCode();
112 }
113
114 /**
115 * {@inheritDoc}
116 */
117 @SuppressWarnings("unchecked")
118 @Override
119 public final boolean equals(Object o) {
120 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
121 }
122
123 /**
124 * Visible for CameraMetadataNative implementation only; do not use.
125 *
126 * TODO: Make this private or remove it altogether.
127 *
128 * @hide
129 */
130 public CameraMetadataNative.Key<T> getNativeKey() {
131 return mKey;
132 }
133
134 @SuppressWarnings({ "unchecked" })
135 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
136 mKey = (CameraMetadataNative.Key<T>) nativeKey;
137 }
138 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700139
140 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700141 private final CaptureRequest mRequest;
142 private final int mSequenceId;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700143
Igor Murashkin70725502013-06-25 20:27:06 +0000144 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700145 * Takes ownership of the passed-in properties object
Igor Murashkin70725502013-06-25 20:27:06 +0000146 * @hide
147 */
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700148 public CaptureResult(CameraMetadataNative results, CaptureRequest parent, int sequenceId) {
149 if (results == null) {
150 throw new IllegalArgumentException("results was null");
151 }
152
153 if (parent == null) {
154 throw new IllegalArgumentException("parent was null");
155 }
156
Igor Murashkind6d65152014-05-19 16:31:02 -0700157 mResults = CameraMetadataNative.move(results);
158 if (mResults.isEmpty()) {
159 throw new AssertionError("Results must not be empty");
160 }
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700161 mRequest = parent;
162 mSequenceId = sequenceId;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700163 }
164
Ruben Brunkf967a542014-04-28 16:31:11 -0700165 /**
166 * Returns a copy of the underlying {@link CameraMetadataNative}.
167 * @hide
168 */
169 public CameraMetadataNative getNativeCopy() {
170 return new CameraMetadataNative(mResults);
171 }
172
Igor Murashkind6d65152014-05-19 16:31:02 -0700173 /**
174 * Creates a request-less result.
175 *
176 * <p><strong>For testing only.</strong></p>
177 * @hide
178 */
179 public CaptureResult(CameraMetadataNative results, int sequenceId) {
180 if (results == null) {
181 throw new IllegalArgumentException("results was null");
182 }
183
184 mResults = CameraMetadataNative.move(results);
185 if (mResults.isEmpty()) {
186 throw new AssertionError("Results must not be empty");
187 }
188
189 mRequest = null;
190 mSequenceId = sequenceId;
191 }
192
193 /**
194 * Get a capture result field value.
195 *
196 * <p>The field definitions can be found in {@link CaptureResult}.</p>
197 *
198 * <p>Querying the value for the same key more than once will return a value
199 * which is equal to the previous queried value.</p>
200 *
201 * @throws IllegalArgumentException if the key was not valid
202 *
203 * @param key The result field to read.
204 * @return The value of that key, or {@code null} if the field is not set.
205 */
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700206 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700207 T value = mResults.get(key);
208 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
209 return value;
210 }
211
212 /**
213 * {@inheritDoc}
214 * @hide
215 */
216 @SuppressWarnings("unchecked")
217 @Override
218 protected <T> T getProtected(Key<?> key) {
219 return (T) mResults.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 * Dumps the native metadata contents to logcat.
235 *
236 * <p>Visibility for testing/debugging only. The results will not
237 * include any synthesized keys, as they are invisible to the native layer.</p>
238 *
239 * @hide
240 */
241 public void dumpToLog() {
242 mResults.dumpToLog();
243 }
244
245 /**
246 * {@inheritDoc}
247 */
248 @Override
249 public List<Key<?>> getKeys() {
250 // Force the javadoc for this function to show up on the CaptureResult page
251 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800252 }
253
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700254 /**
255 * Get the request associated with this result.
256 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700257 * <p>Whenever a request has been fully or partially captured, with
258 * {@link CameraDevice.CaptureListener#onCaptureCompleted} or
259 * {@link CameraDevice.CaptureListener#onCaptureProgressed}, the {@code result}'s
260 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700261 * </p>
262 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700263 * <p>For example,
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700264 * <code><pre>cameraDevice.capture(someRequest, new CaptureListener() {
265 * {@literal @}Override
266 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
267 * assert(myResult.getRequest.equals(myRequest) == true);
268 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700269 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700270 * </code></pre>
271 * </p>
272 *
273 * @return The request associated with this result. Never {@code null}.
274 */
275 public CaptureRequest getRequest() {
276 return mRequest;
277 }
278
279 /**
280 * Get the frame number associated with this result.
281 *
282 * <p>Whenever a request has been processed, regardless of failure or success,
283 * it gets a unique frame number assigned to its future result/failure.</p>
284 *
285 * <p>This value monotonically increments, starting with 0,
286 * for every new result or failure; and the scope is the lifetime of the
287 * {@link CameraDevice}.</p>
288 *
289 * @return int frame number
290 */
291 public int getFrameNumber() {
Igor Murashkind6d65152014-05-19 16:31:02 -0700292 // TODO: @hide REQUEST_FRAME_COUNT
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700293 return get(REQUEST_FRAME_COUNT);
294 }
295
296 /**
297 * The sequence ID for this failure that was returned by the
298 * {@link CameraDevice#capture} family of functions.
299 *
300 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
301 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
302 *
303 * @return int The ID for the sequence of requests that this capture result is a part of
304 *
305 * @see CameraDevice.CaptureListener#onCaptureSequenceCompleted
Igor Murashkindb075af2014-05-21 10:07:08 -0700306 * @see CameraDevice.CaptureListener#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700307 */
308 public int getSequenceId() {
309 return mSequenceId;
310 }
311
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700312 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
313 * The key entries below this point are generated from metadata
314 * definitions in /system/media/camera/docs. Do not modify by hand or
315 * modify the comment blocks at the start or end.
316 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
317
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800318
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700319 /**
Zhijun He379af012014-05-06 11:54:54 -0700320 * <p>The mode control selects how the image data is converted from the
321 * sensor's native color into linear sRGB color.</p>
322 * <p>When auto-white balance is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this
323 * control is overridden by the AWB routine. When AWB is disabled, the
324 * application controls how the color mapping is performed.</p>
325 * <p>We define the expected processing pipeline below. For consistency
326 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
327 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
328 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
329 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
330 * camera device (in the results) and be roughly correct.</p>
331 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
332 * FAST or HIGH_QUALITY will yield a picture with the same white point
333 * as what was produced by the camera device in the earlier frame.</p>
334 * <p>The expected processing pipeline is as follows:</p>
335 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
336 * <p>The white balance is encoded by two values, a 4-channel white-balance
337 * gain vector (applied in the Bayer domain), and a 3x3 color transform
338 * matrix (applied after demosaic).</p>
339 * <p>The 4-channel white-balance gains are defined as:</p>
340 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
341 * </code></pre>
342 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
343 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
344 * These may be identical for a given camera device implementation; if
345 * the camera device does not support a separate gain for even/odd green
346 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
347 * <code>G_even</code> in the output result metadata.</p>
348 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
349 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
350 * </code></pre>
351 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
352 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
353 * <p>with colors as follows:</p>
354 * <pre><code>r' = I0r + I1g + I2b
355 * g' = I3r + I4g + I5b
356 * b' = I6r + I7g + I8b
357 * </code></pre>
358 * <p>Both the input and output value ranges must match. Overflow/underflow
359 * values are clipped to fit within the range.</p>
360 *
361 * @see CaptureRequest#COLOR_CORRECTION_GAINS
362 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
363 * @see CaptureRequest#CONTROL_AWB_MODE
364 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
365 * @see #COLOR_CORRECTION_MODE_FAST
366 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
367 */
368 public static final Key<Integer> COLOR_CORRECTION_MODE =
369 new Key<Integer>("android.colorCorrection.mode", int.class);
370
371 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800372 * <p>A color transform matrix to use to transform
373 * from sensor RGB color space to output linear sRGB color space</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800374 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800375 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700376 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800377 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800378 * <p>In the latter case, the camera device may round the matrix to account
379 * for precision issues; the final rounded matrix should be reported back
380 * in this matrix result metadata. The transform should keep the magnitude
381 * of the output color values within <code>[0, 1.0]</code> (assuming input color
382 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800383 *
384 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700385 */
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700386 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
387 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700388
389 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800390 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800391 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700392 * <p>These per-channel gains are either set by the camera device
393 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
394 * TRANSFORM_MATRIX, or directly by the application in the
395 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
396 * TRANSFORM_MATRIX.</p>
397 * <p>The gains in the result metadata are the gains actually
398 * applied by the camera device to the current frame.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800399 *
400 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700401 */
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700402 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
403 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700404
405 /**
Zhijun He379af012014-05-06 11:54:54 -0700406 * <p>The desired setting for the camera device's auto-exposure
407 * algorithm's antibanding compensation.</p>
408 * <p>Some kinds of lighting fixtures, such as some fluorescent
409 * lights, flicker at the rate of the power supply frequency
410 * (60Hz or 50Hz, depending on country). While this is
411 * typically not noticeable to a person, it can be visible to
412 * a camera device. If a camera sets its exposure time to the
413 * wrong value, the flicker may become visible in the
414 * viewfinder as flicker or in a final captured image, as a
415 * set of variable-brightness bands across the image.</p>
416 * <p>Therefore, the auto-exposure routines of camera devices
417 * include antibanding routines that ensure that the chosen
418 * exposure value will not cause such banding. The choice of
419 * exposure time depends on the rate of flicker, which the
420 * camera device can detect automatically, or the expected
421 * rate can be selected by the application using this
422 * control.</p>
423 * <p>A given camera device may not support all of the possible
424 * options for the antibanding mode. The
425 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
426 * the available modes for a given camera device.</p>
427 * <p>The default mode is AUTO, which must be supported by all
428 * camera devices.</p>
429 * <p>If manual exposure control is enabled (by setting
430 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
431 * then this setting has no effect, and the application must
432 * ensure it selects exposure times that do not cause banding
433 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
434 * the application in this.</p>
435 *
436 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
437 * @see CaptureRequest#CONTROL_AE_MODE
438 * @see CaptureRequest#CONTROL_MODE
439 * @see CaptureResult#STATISTICS_SCENE_FLICKER
440 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
441 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
442 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
443 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
444 */
445 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
446 new Key<Integer>("android.control.aeAntibandingMode", int.class);
447
448 /**
449 * <p>Adjustment to AE target image
450 * brightness</p>
451 * <p>For example, if EV step is 0.333, '6' will mean an
452 * exposure compensation of +2 EV; -3 will mean an exposure
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700453 * compensation of -1 EV. Note that this control will only be effective
454 * if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control will take effect even when
455 * {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p>
456 * <p>In the event of exposure compensation value being changed, camera device
457 * may take several frames to reach the newly requested exposure target.
458 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
459 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
460 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
461 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
462 *
463 * @see CaptureRequest#CONTROL_AE_LOCK
464 * @see CaptureRequest#CONTROL_AE_MODE
465 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700466 */
467 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
468 new Key<Integer>("android.control.aeExposureCompensation", int.class);
469
470 /**
471 * <p>Whether AE is currently locked to its latest
472 * calculated values.</p>
473 * <p>Note that even when AE is locked, the flash may be
474 * fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / ON_ALWAYS_FLASH /
475 * ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700476 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
477 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700478 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
479 * when AE is already locked, the camera device will not change the exposure time
480 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
481 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
482 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
483 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
484 * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
485 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700486 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700487 * @see CaptureRequest#CONTROL_AE_MODE
488 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
489 * @see CaptureResult#CONTROL_AE_STATE
490 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
491 * @see CaptureRequest#SENSOR_SENSITIVITY
492 */
493 public static final Key<Boolean> CONTROL_AE_LOCK =
494 new Key<Boolean>("android.control.aeLock", boolean.class);
495
496 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800497 * <p>The desired mode for the camera device's
498 * auto-exposure routine.</p>
499 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
500 * AUTO.</p>
501 * <p>When set to any of the ON modes, the camera device's
502 * auto-exposure routine is enabled, overriding the
503 * application's selected exposure time, sensor sensitivity,
504 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
505 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
506 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
507 * is selected, the camera device's flash unit controls are
508 * also overridden.</p>
509 * <p>The FLASH modes are only available if the camera device
510 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
511 * <p>If flash TORCH mode is desired, this field must be set to
512 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
513 * <p>When set to any of the ON modes, the values chosen by the
514 * camera device auto-exposure routine for the overridden
515 * fields for a given capture will be available in its
516 * CaptureResult.</p>
517 *
Zhijun He5f2a47f2014-01-16 15:44:41 -0800518 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800519 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
520 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800521 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
522 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800523 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800524 * @see #CONTROL_AE_MODE_OFF
525 * @see #CONTROL_AE_MODE_ON
526 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
527 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
528 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
529 */
530 public static final Key<Integer> CONTROL_AE_MODE =
531 new Key<Integer>("android.control.aeMode", int.class);
532
533 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800534 * <p>List of areas to use for
Ruben Brunkf59521d2014-02-03 17:14:33 -0800535 * metering.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800536 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700537 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800538 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
539 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Timothy Knight2629f272013-09-03 17:23:23 -0700540 * bottom-right pixel in the active pixel array. The weight
Igor Murashkinace5bf02013-12-10 17:36:40 -0800541 * should be nonnegative.</p>
542 * <p>If all regions have 0 weight, then no specific metering area
Zhijun Hecc28a412014-02-24 15:11:23 -0800543 * needs to be used by the camera device. If the metering region is
Zhijun He14986152014-05-22 21:17:37 -0700544 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
545 * the camera device will ignore the sections outside the region and output the
546 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800547 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800548 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800549 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700550 */
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700551 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
552 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700553
554 /**
Zhijun He379af012014-05-06 11:54:54 -0700555 * <p>Range over which fps can be adjusted to
556 * maintain exposure</p>
557 * <p>Only constrains AE algorithm, not manual control
558 * of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p>
559 *
560 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
561 */
Igor Murashkin78712a82014-05-27 18:32:18 -0700562 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
563 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700564
565 /**
566 * <p>Whether the camera device will trigger a precapture
567 * metering sequence when it processes this request.</p>
568 * <p>This entry is normally set to IDLE, or is not
569 * included at all in the request settings. When included and
570 * set to START, the camera device will trigger the autoexposure
571 * precapture metering sequence.</p>
572 * <p>The effect of AE precapture trigger depends on the current
573 * AE mode and state; see {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture
574 * state transition details.</p>
575 *
576 * @see CaptureResult#CONTROL_AE_STATE
577 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
578 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
579 */
580 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
581 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
582
583 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800584 * <p>Current state of AE algorithm</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800585 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
586 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
587 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
588 * the algorithm states to INACTIVE.</p>
589 * <p>The camera device can do several state transitions between two results, if it is
590 * allowed by the state transition table. For example: INACTIVE may never actually be
591 * seen in a result.</p>
592 * <p>The state in the result is the state for this image (in sync with this image): if
593 * AE state becomes CONVERGED, then the image data associated with this result should
594 * be good to use.</p>
595 * <p>Below are state transition tables for different AE modes.</p>
596 * <table>
597 * <thead>
598 * <tr>
599 * <th align="center">State</th>
600 * <th align="center">Transition Cause</th>
601 * <th align="center">New State</th>
602 * <th align="center">Notes</th>
603 * </tr>
604 * </thead>
605 * <tbody>
606 * <tr>
607 * <td align="center">INACTIVE</td>
608 * <td align="center"></td>
609 * <td align="center">INACTIVE</td>
610 * <td align="center">Camera device auto exposure algorithm is disabled</td>
611 * </tr>
612 * </tbody>
613 * </table>
614 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
615 * <table>
616 * <thead>
617 * <tr>
618 * <th align="center">State</th>
619 * <th align="center">Transition Cause</th>
620 * <th align="center">New State</th>
621 * <th align="center">Notes</th>
622 * </tr>
623 * </thead>
624 * <tbody>
625 * <tr>
626 * <td align="center">INACTIVE</td>
627 * <td align="center">Camera device initiates AE scan</td>
628 * <td align="center">SEARCHING</td>
629 * <td align="center">Values changing</td>
630 * </tr>
631 * <tr>
632 * <td align="center">INACTIVE</td>
633 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
634 * <td align="center">LOCKED</td>
635 * <td align="center">Values locked</td>
636 * </tr>
637 * <tr>
638 * <td align="center">SEARCHING</td>
639 * <td align="center">Camera device finishes AE scan</td>
640 * <td align="center">CONVERGED</td>
641 * <td align="center">Good values, not changing</td>
642 * </tr>
643 * <tr>
644 * <td align="center">SEARCHING</td>
645 * <td align="center">Camera device finishes AE scan</td>
646 * <td align="center">FLASH_REQUIRED</td>
647 * <td align="center">Converged but too dark w/o flash</td>
648 * </tr>
649 * <tr>
650 * <td align="center">SEARCHING</td>
651 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
652 * <td align="center">LOCKED</td>
653 * <td align="center">Values locked</td>
654 * </tr>
655 * <tr>
656 * <td align="center">CONVERGED</td>
657 * <td align="center">Camera device initiates AE scan</td>
658 * <td align="center">SEARCHING</td>
659 * <td align="center">Values changing</td>
660 * </tr>
661 * <tr>
662 * <td align="center">CONVERGED</td>
663 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
664 * <td align="center">LOCKED</td>
665 * <td align="center">Values locked</td>
666 * </tr>
667 * <tr>
668 * <td align="center">FLASH_REQUIRED</td>
669 * <td align="center">Camera device initiates AE scan</td>
670 * <td align="center">SEARCHING</td>
671 * <td align="center">Values changing</td>
672 * </tr>
673 * <tr>
674 * <td align="center">FLASH_REQUIRED</td>
675 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
676 * <td align="center">LOCKED</td>
677 * <td align="center">Values locked</td>
678 * </tr>
679 * <tr>
680 * <td align="center">LOCKED</td>
681 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
682 * <td align="center">SEARCHING</td>
683 * <td align="center">Values not good after unlock</td>
684 * </tr>
685 * <tr>
686 * <td align="center">LOCKED</td>
687 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
688 * <td align="center">CONVERGED</td>
689 * <td align="center">Values good after unlock</td>
690 * </tr>
691 * <tr>
692 * <td align="center">LOCKED</td>
693 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
694 * <td align="center">FLASH_REQUIRED</td>
695 * <td align="center">Exposure good, but too dark</td>
696 * </tr>
697 * <tr>
698 * <td align="center">PRECAPTURE</td>
699 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
700 * <td align="center">CONVERGED</td>
701 * <td align="center">Ready for high-quality capture</td>
702 * </tr>
703 * <tr>
704 * <td align="center">PRECAPTURE</td>
705 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
706 * <td align="center">LOCKED</td>
707 * <td align="center">Ready for high-quality capture</td>
708 * </tr>
709 * <tr>
710 * <td align="center">Any state</td>
711 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
712 * <td align="center">PRECAPTURE</td>
713 * <td align="center">Start AE precapture metering sequence</td>
714 * </tr>
715 * </tbody>
716 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800717 * <p>For the above table, the camera device may skip reporting any state changes that happen
718 * without application intervention (i.e. mode switch, trigger, locking). Any state that
719 * can be skipped in that manner is called a transient state.</p>
720 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
721 * listed in above table, it is also legal for the camera device to skip one or more
722 * transient states between two results. See below table for examples:</p>
723 * <table>
724 * <thead>
725 * <tr>
726 * <th align="center">State</th>
727 * <th align="center">Transition Cause</th>
728 * <th align="center">New State</th>
729 * <th align="center">Notes</th>
730 * </tr>
731 * </thead>
732 * <tbody>
733 * <tr>
734 * <td align="center">INACTIVE</td>
735 * <td align="center">Camera device finished AE scan</td>
736 * <td align="center">CONVERGED</td>
737 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
738 * </tr>
739 * <tr>
740 * <td align="center">Any state</td>
741 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
742 * <td align="center">FLASH_REQUIRED</td>
743 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
744 * </tr>
745 * <tr>
746 * <td align="center">Any state</td>
747 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
748 * <td align="center">CONVERGED</td>
749 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
750 * </tr>
751 * <tr>
752 * <td align="center">CONVERGED</td>
753 * <td align="center">Camera device finished AE scan</td>
754 * <td align="center">FLASH_REQUIRED</td>
755 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
756 * </tr>
757 * <tr>
758 * <td align="center">FLASH_REQUIRED</td>
759 * <td align="center">Camera device finished AE scan</td>
760 * <td align="center">CONVERGED</td>
761 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
762 * </tr>
763 * </tbody>
764 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -0800765 *
766 * @see CaptureRequest#CONTROL_AE_LOCK
767 * @see CaptureRequest#CONTROL_AE_MODE
768 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
769 * @see CaptureRequest#CONTROL_MODE
770 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700771 * @see #CONTROL_AE_STATE_INACTIVE
772 * @see #CONTROL_AE_STATE_SEARCHING
773 * @see #CONTROL_AE_STATE_CONVERGED
774 * @see #CONTROL_AE_STATE_LOCKED
775 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
776 * @see #CONTROL_AE_STATE_PRECAPTURE
777 */
778 public static final Key<Integer> CONTROL_AE_STATE =
779 new Key<Integer>("android.control.aeState", int.class);
780
781 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800782 * <p>Whether AF is currently enabled, and what
783 * mode it is set to</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800784 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
785 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>).</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800786 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800787 * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
Zhijun He78146ec2014-01-14 18:12:13 -0800788 * in result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800789 *
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800790 * @see CaptureResult#CONTROL_AF_STATE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800791 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -0800792 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700793 * @see #CONTROL_AF_MODE_OFF
794 * @see #CONTROL_AF_MODE_AUTO
795 * @see #CONTROL_AF_MODE_MACRO
796 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
797 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
798 * @see #CONTROL_AF_MODE_EDOF
799 */
800 public static final Key<Integer> CONTROL_AF_MODE =
801 new Key<Integer>("android.control.afMode", int.class);
802
803 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800804 * <p>List of areas to use for focus
Ruben Brunkf59521d2014-02-03 17:14:33 -0800805 * estimation.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800806 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700807 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800808 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
809 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Timothy Knight2629f272013-09-03 17:23:23 -0700810 * bottom-right pixel in the active pixel array. The weight
Igor Murashkinace5bf02013-12-10 17:36:40 -0800811 * should be nonnegative.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700812 * <p>If all regions have 0 weight, then no specific metering area
813 * needs to be used by the camera device. If the metering region is
814 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
815 * the camera device will ignore the sections outside the region and output the
816 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800817 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800818 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800819 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700820 */
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700821 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
822 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700823
824 /**
Zhijun He379af012014-05-06 11:54:54 -0700825 * <p>Whether the camera device will trigger autofocus for this request.</p>
826 * <p>This entry is normally set to IDLE, or is not
827 * included at all in the request settings.</p>
828 * <p>When included and set to START, the camera device will trigger the
829 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
830 * <p>When set to CANCEL, the camera device will cancel any active trigger,
831 * and return to its initial AF state.</p>
832 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what that means for each AF mode.</p>
833 *
834 * @see CaptureResult#CONTROL_AF_STATE
835 * @see #CONTROL_AF_TRIGGER_IDLE
836 * @see #CONTROL_AF_TRIGGER_START
837 * @see #CONTROL_AF_TRIGGER_CANCEL
838 */
839 public static final Key<Integer> CONTROL_AF_TRIGGER =
840 new Key<Integer>("android.control.afTrigger", int.class);
841
842 /**
Zhijun He60b19dc2014-02-24 10:19:20 -0800843 * <p>Current state of AF algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800844 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
845 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
846 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
847 * the algorithm states to INACTIVE.</p>
848 * <p>The camera device can do several state transitions between two results, if it is
849 * allowed by the state transition table. For example: INACTIVE may never actually be
850 * seen in a result.</p>
851 * <p>The state in the result is the state for this image (in sync with this image): if
852 * AF state becomes FOCUSED, then the image data associated with this result should
853 * be sharp.</p>
854 * <p>Below are state transition tables for different AF modes.</p>
855 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
856 * <table>
857 * <thead>
858 * <tr>
859 * <th align="center">State</th>
860 * <th align="center">Transition Cause</th>
861 * <th align="center">New State</th>
862 * <th align="center">Notes</th>
863 * </tr>
864 * </thead>
865 * <tbody>
866 * <tr>
867 * <td align="center">INACTIVE</td>
868 * <td align="center"></td>
869 * <td align="center">INACTIVE</td>
870 * <td align="center">Never changes</td>
871 * </tr>
872 * </tbody>
873 * </table>
874 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
875 * <table>
876 * <thead>
877 * <tr>
878 * <th align="center">State</th>
879 * <th align="center">Transition Cause</th>
880 * <th align="center">New State</th>
881 * <th align="center">Notes</th>
882 * </tr>
883 * </thead>
884 * <tbody>
885 * <tr>
886 * <td align="center">INACTIVE</td>
887 * <td align="center">AF_TRIGGER</td>
888 * <td align="center">ACTIVE_SCAN</td>
889 * <td align="center">Start AF sweep, Lens now moving</td>
890 * </tr>
891 * <tr>
892 * <td align="center">ACTIVE_SCAN</td>
893 * <td align="center">AF sweep done</td>
894 * <td align="center">FOCUSED_LOCKED</td>
895 * <td align="center">Focused, Lens now locked</td>
896 * </tr>
897 * <tr>
898 * <td align="center">ACTIVE_SCAN</td>
899 * <td align="center">AF sweep done</td>
900 * <td align="center">NOT_FOCUSED_LOCKED</td>
901 * <td align="center">Not focused, Lens now locked</td>
902 * </tr>
903 * <tr>
904 * <td align="center">ACTIVE_SCAN</td>
905 * <td align="center">AF_CANCEL</td>
906 * <td align="center">INACTIVE</td>
907 * <td align="center">Cancel/reset AF, Lens now locked</td>
908 * </tr>
909 * <tr>
910 * <td align="center">FOCUSED_LOCKED</td>
911 * <td align="center">AF_CANCEL</td>
912 * <td align="center">INACTIVE</td>
913 * <td align="center">Cancel/reset AF</td>
914 * </tr>
915 * <tr>
916 * <td align="center">FOCUSED_LOCKED</td>
917 * <td align="center">AF_TRIGGER</td>
918 * <td align="center">ACTIVE_SCAN</td>
919 * <td align="center">Start new sweep, Lens now moving</td>
920 * </tr>
921 * <tr>
922 * <td align="center">NOT_FOCUSED_LOCKED</td>
923 * <td align="center">AF_CANCEL</td>
924 * <td align="center">INACTIVE</td>
925 * <td align="center">Cancel/reset AF</td>
926 * </tr>
927 * <tr>
928 * <td align="center">NOT_FOCUSED_LOCKED</td>
929 * <td align="center">AF_TRIGGER</td>
930 * <td align="center">ACTIVE_SCAN</td>
931 * <td align="center">Start new sweep, Lens now moving</td>
932 * </tr>
933 * <tr>
934 * <td align="center">Any state</td>
935 * <td align="center">Mode change</td>
936 * <td align="center">INACTIVE</td>
937 * <td align="center"></td>
938 * </tr>
939 * </tbody>
940 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800941 * <p>For the above table, the camera device may skip reporting any state changes that happen
942 * without application intervention (i.e. mode switch, trigger, locking). Any state that
943 * can be skipped in that manner is called a transient state.</p>
944 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
945 * state transitions listed in above table, it is also legal for the camera device to skip
946 * one or more transient states between two results. See below table for examples:</p>
947 * <table>
948 * <thead>
949 * <tr>
950 * <th align="center">State</th>
951 * <th align="center">Transition Cause</th>
952 * <th align="center">New State</th>
953 * <th align="center">Notes</th>
954 * </tr>
955 * </thead>
956 * <tbody>
957 * <tr>
958 * <td align="center">INACTIVE</td>
959 * <td align="center">AF_TRIGGER</td>
960 * <td align="center">FOCUSED_LOCKED</td>
961 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
962 * </tr>
963 * <tr>
964 * <td align="center">INACTIVE</td>
965 * <td align="center">AF_TRIGGER</td>
966 * <td align="center">NOT_FOCUSED_LOCKED</td>
967 * <td align="center">Focus failed after a scan, lens is now locked.</td>
968 * </tr>
969 * <tr>
970 * <td align="center">FOCUSED_LOCKED</td>
971 * <td align="center">AF_TRIGGER</td>
972 * <td align="center">FOCUSED_LOCKED</td>
973 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
974 * </tr>
975 * <tr>
976 * <td align="center">NOT_FOCUSED_LOCKED</td>
977 * <td align="center">AF_TRIGGER</td>
978 * <td align="center">FOCUSED_LOCKED</td>
979 * <td align="center">Focus is good after a scan, lens is not locked.</td>
980 * </tr>
981 * </tbody>
982 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -0800983 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
984 * <table>
985 * <thead>
986 * <tr>
987 * <th align="center">State</th>
988 * <th align="center">Transition Cause</th>
989 * <th align="center">New State</th>
990 * <th align="center">Notes</th>
991 * </tr>
992 * </thead>
993 * <tbody>
994 * <tr>
995 * <td align="center">INACTIVE</td>
996 * <td align="center">Camera device initiates new scan</td>
997 * <td align="center">PASSIVE_SCAN</td>
998 * <td align="center">Start AF scan, Lens now moving</td>
999 * </tr>
1000 * <tr>
1001 * <td align="center">INACTIVE</td>
1002 * <td align="center">AF_TRIGGER</td>
1003 * <td align="center">NOT_FOCUSED_LOCKED</td>
1004 * <td align="center">AF state query, Lens now locked</td>
1005 * </tr>
1006 * <tr>
1007 * <td align="center">PASSIVE_SCAN</td>
1008 * <td align="center">Camera device completes current scan</td>
1009 * <td align="center">PASSIVE_FOCUSED</td>
1010 * <td align="center">End AF scan, Lens now locked</td>
1011 * </tr>
1012 * <tr>
1013 * <td align="center">PASSIVE_SCAN</td>
1014 * <td align="center">Camera device fails current scan</td>
1015 * <td align="center">PASSIVE_UNFOCUSED</td>
1016 * <td align="center">End AF scan, Lens now locked</td>
1017 * </tr>
1018 * <tr>
1019 * <td align="center">PASSIVE_SCAN</td>
1020 * <td align="center">AF_TRIGGER</td>
1021 * <td align="center">FOCUSED_LOCKED</td>
1022 * <td align="center">Immediate trans. If focus is good, Lens now locked</td>
1023 * </tr>
1024 * <tr>
1025 * <td align="center">PASSIVE_SCAN</td>
1026 * <td align="center">AF_TRIGGER</td>
1027 * <td align="center">NOT_FOCUSED_LOCKED</td>
1028 * <td align="center">Immediate trans. if focus is bad, Lens now locked</td>
1029 * </tr>
1030 * <tr>
1031 * <td align="center">PASSIVE_SCAN</td>
1032 * <td align="center">AF_CANCEL</td>
1033 * <td align="center">INACTIVE</td>
1034 * <td align="center">Reset lens position, Lens now locked</td>
1035 * </tr>
1036 * <tr>
1037 * <td align="center">PASSIVE_FOCUSED</td>
1038 * <td align="center">Camera device initiates new scan</td>
1039 * <td align="center">PASSIVE_SCAN</td>
1040 * <td align="center">Start AF scan, Lens now moving</td>
1041 * </tr>
1042 * <tr>
1043 * <td align="center">PASSIVE_UNFOCUSED</td>
1044 * <td align="center">Camera device initiates new scan</td>
1045 * <td align="center">PASSIVE_SCAN</td>
1046 * <td align="center">Start AF scan, Lens now moving</td>
1047 * </tr>
1048 * <tr>
1049 * <td align="center">PASSIVE_FOCUSED</td>
1050 * <td align="center">AF_TRIGGER</td>
1051 * <td align="center">FOCUSED_LOCKED</td>
1052 * <td align="center">Immediate trans. Lens now locked</td>
1053 * </tr>
1054 * <tr>
1055 * <td align="center">PASSIVE_UNFOCUSED</td>
1056 * <td align="center">AF_TRIGGER</td>
1057 * <td align="center">NOT_FOCUSED_LOCKED</td>
1058 * <td align="center">Immediate trans. Lens now locked</td>
1059 * </tr>
1060 * <tr>
1061 * <td align="center">FOCUSED_LOCKED</td>
1062 * <td align="center">AF_TRIGGER</td>
1063 * <td align="center">FOCUSED_LOCKED</td>
1064 * <td align="center">No effect</td>
1065 * </tr>
1066 * <tr>
1067 * <td align="center">FOCUSED_LOCKED</td>
1068 * <td align="center">AF_CANCEL</td>
1069 * <td align="center">INACTIVE</td>
1070 * <td align="center">Restart AF scan</td>
1071 * </tr>
1072 * <tr>
1073 * <td align="center">NOT_FOCUSED_LOCKED</td>
1074 * <td align="center">AF_TRIGGER</td>
1075 * <td align="center">NOT_FOCUSED_LOCKED</td>
1076 * <td align="center">No effect</td>
1077 * </tr>
1078 * <tr>
1079 * <td align="center">NOT_FOCUSED_LOCKED</td>
1080 * <td align="center">AF_CANCEL</td>
1081 * <td align="center">INACTIVE</td>
1082 * <td align="center">Restart AF scan</td>
1083 * </tr>
1084 * </tbody>
1085 * </table>
1086 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1087 * <table>
1088 * <thead>
1089 * <tr>
1090 * <th align="center">State</th>
1091 * <th align="center">Transition Cause</th>
1092 * <th align="center">New State</th>
1093 * <th align="center">Notes</th>
1094 * </tr>
1095 * </thead>
1096 * <tbody>
1097 * <tr>
1098 * <td align="center">INACTIVE</td>
1099 * <td align="center">Camera device initiates new scan</td>
1100 * <td align="center">PASSIVE_SCAN</td>
1101 * <td align="center">Start AF scan, Lens now moving</td>
1102 * </tr>
1103 * <tr>
1104 * <td align="center">INACTIVE</td>
1105 * <td align="center">AF_TRIGGER</td>
1106 * <td align="center">NOT_FOCUSED_LOCKED</td>
1107 * <td align="center">AF state query, Lens now locked</td>
1108 * </tr>
1109 * <tr>
1110 * <td align="center">PASSIVE_SCAN</td>
1111 * <td align="center">Camera device completes current scan</td>
1112 * <td align="center">PASSIVE_FOCUSED</td>
1113 * <td align="center">End AF scan, Lens now locked</td>
1114 * </tr>
1115 * <tr>
1116 * <td align="center">PASSIVE_SCAN</td>
1117 * <td align="center">Camera device fails current scan</td>
1118 * <td align="center">PASSIVE_UNFOCUSED</td>
1119 * <td align="center">End AF scan, Lens now locked</td>
1120 * </tr>
1121 * <tr>
1122 * <td align="center">PASSIVE_SCAN</td>
1123 * <td align="center">AF_TRIGGER</td>
1124 * <td align="center">FOCUSED_LOCKED</td>
1125 * <td align="center">Eventual trans. once focus good, Lens now locked</td>
1126 * </tr>
1127 * <tr>
1128 * <td align="center">PASSIVE_SCAN</td>
1129 * <td align="center">AF_TRIGGER</td>
1130 * <td align="center">NOT_FOCUSED_LOCKED</td>
1131 * <td align="center">Eventual trans. if cannot focus, Lens now locked</td>
1132 * </tr>
1133 * <tr>
1134 * <td align="center">PASSIVE_SCAN</td>
1135 * <td align="center">AF_CANCEL</td>
1136 * <td align="center">INACTIVE</td>
1137 * <td align="center">Reset lens position, Lens now locked</td>
1138 * </tr>
1139 * <tr>
1140 * <td align="center">PASSIVE_FOCUSED</td>
1141 * <td align="center">Camera device initiates new scan</td>
1142 * <td align="center">PASSIVE_SCAN</td>
1143 * <td align="center">Start AF scan, Lens now moving</td>
1144 * </tr>
1145 * <tr>
1146 * <td align="center">PASSIVE_UNFOCUSED</td>
1147 * <td align="center">Camera device initiates new scan</td>
1148 * <td align="center">PASSIVE_SCAN</td>
1149 * <td align="center">Start AF scan, Lens now moving</td>
1150 * </tr>
1151 * <tr>
1152 * <td align="center">PASSIVE_FOCUSED</td>
1153 * <td align="center">AF_TRIGGER</td>
1154 * <td align="center">FOCUSED_LOCKED</td>
1155 * <td align="center">Immediate trans. Lens now locked</td>
1156 * </tr>
1157 * <tr>
1158 * <td align="center">PASSIVE_UNFOCUSED</td>
1159 * <td align="center">AF_TRIGGER</td>
1160 * <td align="center">NOT_FOCUSED_LOCKED</td>
1161 * <td align="center">Immediate trans. Lens now locked</td>
1162 * </tr>
1163 * <tr>
1164 * <td align="center">FOCUSED_LOCKED</td>
1165 * <td align="center">AF_TRIGGER</td>
1166 * <td align="center">FOCUSED_LOCKED</td>
1167 * <td align="center">No effect</td>
1168 * </tr>
1169 * <tr>
1170 * <td align="center">FOCUSED_LOCKED</td>
1171 * <td align="center">AF_CANCEL</td>
1172 * <td align="center">INACTIVE</td>
1173 * <td align="center">Restart AF scan</td>
1174 * </tr>
1175 * <tr>
1176 * <td align="center">NOT_FOCUSED_LOCKED</td>
1177 * <td align="center">AF_TRIGGER</td>
1178 * <td align="center">NOT_FOCUSED_LOCKED</td>
1179 * <td align="center">No effect</td>
1180 * </tr>
1181 * <tr>
1182 * <td align="center">NOT_FOCUSED_LOCKED</td>
1183 * <td align="center">AF_CANCEL</td>
1184 * <td align="center">INACTIVE</td>
1185 * <td align="center">Restart AF scan</td>
1186 * </tr>
1187 * </tbody>
1188 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001189 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1190 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1191 * camera device. When a trigger is included in a mode switch request, the trigger
1192 * will be evaluated in the context of the new mode in the request.
1193 * See below table for examples:</p>
1194 * <table>
1195 * <thead>
1196 * <tr>
1197 * <th align="center">State</th>
1198 * <th align="center">Transition Cause</th>
1199 * <th align="center">New State</th>
1200 * <th align="center">Notes</th>
1201 * </tr>
1202 * </thead>
1203 * <tbody>
1204 * <tr>
1205 * <td align="center">any state</td>
1206 * <td align="center">CAF--&gt;AUTO mode switch</td>
1207 * <td align="center">INACTIVE</td>
1208 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1209 * </tr>
1210 * <tr>
1211 * <td align="center">any state</td>
1212 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1213 * <td align="center">trigger-reachable states from INACTIVE</td>
1214 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1215 * </tr>
1216 * <tr>
1217 * <td align="center">any state</td>
1218 * <td align="center">AUTO--&gt;CAF mode switch</td>
1219 * <td align="center">passively reachable states from INACTIVE</td>
1220 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1221 * </tr>
1222 * </tbody>
1223 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001224 *
1225 * @see CaptureRequest#CONTROL_AF_MODE
1226 * @see CaptureRequest#CONTROL_MODE
1227 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001228 * @see #CONTROL_AF_STATE_INACTIVE
1229 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1230 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1231 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1232 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1233 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001234 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001235 */
1236 public static final Key<Integer> CONTROL_AF_STATE =
1237 new Key<Integer>("android.control.afState", int.class);
1238
1239 /**
Zhijun He379af012014-05-06 11:54:54 -07001240 * <p>Whether AWB is currently locked to its
1241 * latest calculated values.</p>
1242 * <p>Note that AWB lock is only meaningful for AUTO
1243 * mode; in other modes, AWB is already fixed to a specific
1244 * setting.</p>
1245 */
1246 public static final Key<Boolean> CONTROL_AWB_LOCK =
1247 new Key<Boolean>("android.control.awbLock", boolean.class);
1248
1249 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001250 * <p>Whether AWB is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001251 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001252 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001253 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
1254 * <p>When set to the ON mode, the camera device's auto white balance
1255 * routine is enabled, overriding the application's selected
1256 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1257 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
1258 * <p>When set to the OFF mode, the camera device's auto white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001259 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001260 * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}
Zhijun He399f05d2014-01-15 11:31:30 -08001261 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
1262 * <p>When set to any other modes, the camera device's auto white balance
1263 * routine is disabled. The camera device uses each particular illumination
1264 * target for white balance adjustment.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001265 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001266 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001267 * @see CaptureRequest#COLOR_CORRECTION_MODE
1268 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001269 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001270 * @see #CONTROL_AWB_MODE_OFF
1271 * @see #CONTROL_AWB_MODE_AUTO
1272 * @see #CONTROL_AWB_MODE_INCANDESCENT
1273 * @see #CONTROL_AWB_MODE_FLUORESCENT
1274 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1275 * @see #CONTROL_AWB_MODE_DAYLIGHT
1276 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1277 * @see #CONTROL_AWB_MODE_TWILIGHT
1278 * @see #CONTROL_AWB_MODE_SHADE
1279 */
1280 public static final Key<Integer> CONTROL_AWB_MODE =
1281 new Key<Integer>("android.control.awbMode", int.class);
1282
1283 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001284 * <p>List of areas to use for illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001285 * estimation.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001286 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001287 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001288 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1289 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Timothy Knight2629f272013-09-03 17:23:23 -07001290 * bottom-right pixel in the active pixel array. The weight
Igor Murashkinace5bf02013-12-10 17:36:40 -08001291 * should be nonnegative.</p>
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001292 * <p>If all regions have 0 weight, then no specific metering area
1293 * needs to be used by the camera device. If the metering region is
1294 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
Zhijun He14986152014-05-22 21:17:37 -07001295 * the camera device will ignore the sections outside the region and output the
1296 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001297 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001298 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001299 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001300 */
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001301 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1302 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001303
1304 /**
Zhijun He379af012014-05-06 11:54:54 -07001305 * <p>Information to the camera device 3A (auto-exposure,
1306 * auto-focus, auto-white balance) routines about the purpose
1307 * of this capture, to help the camera device to decide optimal 3A
1308 * strategy.</p>
1309 * <p>This control (except for MANUAL) is only effective if
1310 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
1311 * <p>ZERO_SHUTTER_LAG must be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1312 * contains ZSL. MANUAL must be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1313 * contains MANUAL_SENSOR.</p>
1314 *
1315 * @see CaptureRequest#CONTROL_MODE
1316 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1317 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1318 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1319 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1320 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1321 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1322 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1323 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1324 */
1325 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1326 new Key<Integer>("android.control.captureIntent", int.class);
1327
1328 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001329 * <p>Current state of AWB algorithm</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001330 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1331 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1332 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1333 * the algorithm states to INACTIVE.</p>
1334 * <p>The camera device can do several state transitions between two results, if it is
1335 * allowed by the state transition table. So INACTIVE may never actually be seen in
1336 * a result.</p>
1337 * <p>The state in the result is the state for this image (in sync with this image): if
1338 * AWB state becomes CONVERGED, then the image data associated with this result should
1339 * be good to use.</p>
1340 * <p>Below are state transition tables for different AWB modes.</p>
1341 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1342 * <table>
1343 * <thead>
1344 * <tr>
1345 * <th align="center">State</th>
1346 * <th align="center">Transition Cause</th>
1347 * <th align="center">New State</th>
1348 * <th align="center">Notes</th>
1349 * </tr>
1350 * </thead>
1351 * <tbody>
1352 * <tr>
1353 * <td align="center">INACTIVE</td>
1354 * <td align="center"></td>
1355 * <td align="center">INACTIVE</td>
1356 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1357 * </tr>
1358 * </tbody>
1359 * </table>
1360 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1361 * <table>
1362 * <thead>
1363 * <tr>
1364 * <th align="center">State</th>
1365 * <th align="center">Transition Cause</th>
1366 * <th align="center">New State</th>
1367 * <th align="center">Notes</th>
1368 * </tr>
1369 * </thead>
1370 * <tbody>
1371 * <tr>
1372 * <td align="center">INACTIVE</td>
1373 * <td align="center">Camera device initiates AWB scan</td>
1374 * <td align="center">SEARCHING</td>
1375 * <td align="center">Values changing</td>
1376 * </tr>
1377 * <tr>
1378 * <td align="center">INACTIVE</td>
1379 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1380 * <td align="center">LOCKED</td>
1381 * <td align="center">Values locked</td>
1382 * </tr>
1383 * <tr>
1384 * <td align="center">SEARCHING</td>
1385 * <td align="center">Camera device finishes AWB scan</td>
1386 * <td align="center">CONVERGED</td>
1387 * <td align="center">Good values, not changing</td>
1388 * </tr>
1389 * <tr>
1390 * <td align="center">SEARCHING</td>
1391 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1392 * <td align="center">LOCKED</td>
1393 * <td align="center">Values locked</td>
1394 * </tr>
1395 * <tr>
1396 * <td align="center">CONVERGED</td>
1397 * <td align="center">Camera device initiates AWB scan</td>
1398 * <td align="center">SEARCHING</td>
1399 * <td align="center">Values changing</td>
1400 * </tr>
1401 * <tr>
1402 * <td align="center">CONVERGED</td>
1403 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1404 * <td align="center">LOCKED</td>
1405 * <td align="center">Values locked</td>
1406 * </tr>
1407 * <tr>
1408 * <td align="center">LOCKED</td>
1409 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1410 * <td align="center">SEARCHING</td>
1411 * <td align="center">Values not good after unlock</td>
1412 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001413 * </tbody>
1414 * </table>
1415 * <p>For the above table, the camera device may skip reporting any state changes that happen
1416 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1417 * can be skipped in that manner is called a transient state.</p>
1418 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1419 * listed in above table, it is also legal for the camera device to skip one or more
1420 * transient states between two results. See below table for examples:</p>
1421 * <table>
1422 * <thead>
1423 * <tr>
1424 * <th align="center">State</th>
1425 * <th align="center">Transition Cause</th>
1426 * <th align="center">New State</th>
1427 * <th align="center">Notes</th>
1428 * </tr>
1429 * </thead>
1430 * <tbody>
1431 * <tr>
1432 * <td align="center">INACTIVE</td>
1433 * <td align="center">Camera device finished AWB scan</td>
1434 * <td align="center">CONVERGED</td>
1435 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1436 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001437 * <tr>
1438 * <td align="center">LOCKED</td>
1439 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1440 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001441 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001442 * </tr>
1443 * </tbody>
1444 * </table>
1445 *
1446 * @see CaptureRequest#CONTROL_AWB_LOCK
1447 * @see CaptureRequest#CONTROL_AWB_MODE
1448 * @see CaptureRequest#CONTROL_MODE
1449 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001450 * @see #CONTROL_AWB_STATE_INACTIVE
1451 * @see #CONTROL_AWB_STATE_SEARCHING
1452 * @see #CONTROL_AWB_STATE_CONVERGED
1453 * @see #CONTROL_AWB_STATE_LOCKED
1454 */
1455 public static final Key<Integer> CONTROL_AWB_STATE =
1456 new Key<Integer>("android.control.awbState", int.class);
1457
1458 /**
Zhijun He379af012014-05-06 11:54:54 -07001459 * <p>A special color effect to apply.</p>
1460 * <p>When this mode is set, a color effect will be applied
1461 * to images produced by the camera device. The interpretation
1462 * and implementation of these color effects is left to the
1463 * implementor of the camera device, and should not be
1464 * depended on to be consistent (or present) across all
1465 * devices.</p>
1466 * <p>A color effect will only be applied if
1467 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p>
1468 *
1469 * @see CaptureRequest#CONTROL_MODE
1470 * @see #CONTROL_EFFECT_MODE_OFF
1471 * @see #CONTROL_EFFECT_MODE_MONO
1472 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1473 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1474 * @see #CONTROL_EFFECT_MODE_SEPIA
1475 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1476 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1477 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1478 * @see #CONTROL_EFFECT_MODE_AQUA
1479 */
1480 public static final Key<Integer> CONTROL_EFFECT_MODE =
1481 new Key<Integer>("android.control.effectMode", int.class);
1482
1483 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001484 * <p>Overall mode of 3A control
Zhijun Hecc28a412014-02-24 15:11:23 -08001485 * routines.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001486 * <p>High-level 3A control. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001487 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001488 * capture parameters itself.</p>
1489 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001490 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001491 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001492 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001493 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001494 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001495 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001496 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1497 * is that this frame will not be used by camera device background 3A statistics
1498 * update, as if this frame is never captured. This mode can be used in the scenario
1499 * where the application doesn't want a 3A manual control capture to affect
1500 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001501 *
1502 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001503 * @see #CONTROL_MODE_OFF
1504 * @see #CONTROL_MODE_AUTO
1505 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001506 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001507 */
1508 public static final Key<Integer> CONTROL_MODE =
1509 new Key<Integer>("android.control.mode", int.class);
1510
1511 /**
Zhijun He379af012014-05-06 11:54:54 -07001512 * <p>A camera mode optimized for conditions typical in a particular
1513 * capture setting.</p>
1514 * <p>This is the mode that that is active when
1515 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1516 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
1517 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p>
1518 * <p>The interpretation and implementation of these scene modes is left
1519 * to the implementor of the camera device. Their behavior will not be
1520 * consistent across all devices, and any given device may only implement
1521 * a subset of these modes.</p>
1522 *
1523 * @see CaptureRequest#CONTROL_AE_MODE
1524 * @see CaptureRequest#CONTROL_AF_MODE
1525 * @see CaptureRequest#CONTROL_AWB_MODE
1526 * @see CaptureRequest#CONTROL_MODE
1527 * @see #CONTROL_SCENE_MODE_DISABLED
1528 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1529 * @see #CONTROL_SCENE_MODE_ACTION
1530 * @see #CONTROL_SCENE_MODE_PORTRAIT
1531 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1532 * @see #CONTROL_SCENE_MODE_NIGHT
1533 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1534 * @see #CONTROL_SCENE_MODE_THEATRE
1535 * @see #CONTROL_SCENE_MODE_BEACH
1536 * @see #CONTROL_SCENE_MODE_SNOW
1537 * @see #CONTROL_SCENE_MODE_SUNSET
1538 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1539 * @see #CONTROL_SCENE_MODE_FIREWORKS
1540 * @see #CONTROL_SCENE_MODE_SPORTS
1541 * @see #CONTROL_SCENE_MODE_PARTY
1542 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1543 * @see #CONTROL_SCENE_MODE_BARCODE
1544 */
1545 public static final Key<Integer> CONTROL_SCENE_MODE =
1546 new Key<Integer>("android.control.sceneMode", int.class);
1547
1548 /**
1549 * <p>Whether video stabilization is
1550 * active</p>
1551 * <p>If enabled, video stabilization can modify the
1552 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream
1553 * stabilized</p>
1554 *
1555 * @see CaptureRequest#SCALER_CROP_REGION
1556 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1557 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1558 */
1559 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1560 new Key<Integer>("android.control.videoStabilizationMode", int.class);
1561
1562 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001563 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001564 * enhancement.</p>
Zhijun He28079362013-12-17 10:35:40 -08001565 * <p>Edge/sharpness/detail enhancement. OFF means no
Zhijun Hecc28a412014-02-24 15:11:23 -08001566 * enhancement will be applied by the camera device.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001567 * <p>This must be set to one of the modes listed in {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001568 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001569 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001570 * camera device will use the highest-quality enhancement algorithms,
1571 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08001572 * not slow down capture rate when applying edge enhancement.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001573 *
1574 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001575 * @see #EDGE_MODE_OFF
1576 * @see #EDGE_MODE_FAST
1577 * @see #EDGE_MODE_HIGH_QUALITY
1578 */
1579 public static final Key<Integer> EDGE_MODE =
1580 new Key<Integer>("android.edge.mode", int.class);
1581
1582 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001583 * <p>The desired mode for for the camera device's flash control.</p>
1584 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08001585 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001586 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
1587 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
1588 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
1589 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
1590 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
1591 * device's auto-exposure routine's result. When used in still capture case, this
1592 * control should be used along with AE precapture metering sequence
1593 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
1594 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
1595 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001596 * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001597 *
1598 * @see CaptureRequest#CONTROL_AE_MODE
1599 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1600 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08001601 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001602 * @see #FLASH_MODE_OFF
1603 * @see #FLASH_MODE_SINGLE
1604 * @see #FLASH_MODE_TORCH
1605 */
1606 public static final Key<Integer> FLASH_MODE =
1607 new Key<Integer>("android.flash.mode", int.class);
1608
1609 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001610 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08001611 * unit.</p>
1612 * <p>When the camera device doesn't have flash unit
1613 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
1614 * Other states indicate the current flash status.</p>
1615 *
1616 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001617 * @see #FLASH_STATE_UNAVAILABLE
1618 * @see #FLASH_STATE_CHARGING
1619 * @see #FLASH_STATE_READY
1620 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07001621 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001622 */
1623 public static final Key<Integer> FLASH_STATE =
1624 new Key<Integer>("android.flash.state", int.class);
1625
1626 /**
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001627 * <p>Set operational mode for hot pixel correction.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001628 * <p>Valid modes for this camera device are listed in
1629 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001630 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
1631 * that do not accurately encode the incoming light (i.e. pixels that
1632 * are stuck at an arbitrary value).</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001633 *
1634 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001635 * @see #HOT_PIXEL_MODE_OFF
1636 * @see #HOT_PIXEL_MODE_FAST
1637 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
1638 */
1639 public static final Key<Integer> HOT_PIXEL_MODE =
1640 new Key<Integer>("android.hotPixel.mode", int.class);
1641
1642 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001643 * <p>GPS coordinates to include in output JPEG
1644 * EXIF</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001645 */
1646 public static final Key<double[]> JPEG_GPS_COORDINATES =
1647 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
1648
1649 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001650 * <p>32 characters describing GPS algorithm to
1651 * include in EXIF</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001652 */
1653 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
1654 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
1655
1656 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001657 * <p>Time GPS fix was made to include in
1658 * EXIF</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001659 */
1660 public static final Key<Long> JPEG_GPS_TIMESTAMP =
1661 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
1662
1663 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001664 * <p>Orientation of JPEG image to
1665 * write</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001666 */
1667 public static final Key<Integer> JPEG_ORIENTATION =
1668 new Key<Integer>("android.jpeg.orientation", int.class);
1669
1670 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001671 * <p>Compression quality of the final JPEG
1672 * image</p>
1673 * <p>85-95 is typical usage range</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001674 */
1675 public static final Key<Byte> JPEG_QUALITY =
1676 new Key<Byte>("android.jpeg.quality", byte.class);
1677
1678 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001679 * <p>Compression quality of JPEG
1680 * thumbnail</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001681 */
1682 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
1683 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
1684
1685 /**
Zhijun He5a9ff372013-12-26 11:49:09 -08001686 * <p>Resolution of embedded JPEG thumbnail</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001687 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
1688 * but the captured JPEG will still be a valid image.</p>
Zhijun He5a9ff372013-12-26 11:49:09 -08001689 * <p>When a jpeg image capture is issued, the thumbnail size selected should have
1690 * the same aspect ratio as the jpeg image.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001691 */
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001692 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
1693 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001694
1695 /**
Zhijun Hefb46c642014-01-14 17:57:23 -08001696 * <p>The ratio of lens focal length to the effective
1697 * aperture diameter.</p>
1698 * <p>This will only be supported on the camera devices that
1699 * have variable aperture lens. The aperture value can only be
1700 * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p>
1701 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
1702 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001703 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08001704 * to achieve manual exposure control.</p>
1705 * <p>The requested aperture value may take several frames to reach the
1706 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08001707 * aperture size in capture result metadata while the aperture is changing.
1708 * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08001709 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1710 * the ON modes, this will be overridden by the camera device
1711 * auto-exposure algorithm, the overridden values are then provided
1712 * back to the user in the corresponding result.</p>
1713 *
Zhijun He399f05d2014-01-15 11:31:30 -08001714 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001715 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001716 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001717 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001718 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001719 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001720 */
1721 public static final Key<Float> LENS_APERTURE =
1722 new Key<Float>("android.lens.aperture", float.class);
1723
1724 /**
Ruben Brunk855bae42014-01-17 10:30:32 -08001725 * <p>State of lens neutral density filter(s).</p>
1726 * <p>This will not be supported on most camera devices. On devices
1727 * where this is supported, this may only be set to one of the
1728 * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p>
1729 * <p>Lens filters are typically used to lower the amount of light the
1730 * sensor is exposed to (measured in steps of EV). As used here, an EV
1731 * step is the standard logarithmic representation, which are
1732 * non-negative, and inversely proportional to the amount of light
1733 * hitting the sensor. For example, setting this to 0 would result
1734 * in no reduction of the incoming light, and setting this to 2 would
1735 * mean that the filter is set to reduce incoming light by two stops
1736 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001737 * <p>It may take several frames before the lens filter density changes
1738 * to the requested value. While the filter density is still changing,
1739 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001740 *
1741 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001742 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001743 */
1744 public static final Key<Float> LENS_FILTER_DENSITY =
1745 new Key<Float>("android.lens.filterDensity", float.class);
1746
1747 /**
Ruben Brunka20f4c22014-01-17 15:21:13 -08001748 * <p>The current lens focal length; used for optical zoom.</p>
1749 * <p>This setting controls the physical focal length of the camera
1750 * device's lens. Changing the focal length changes the field of
1751 * view of the camera device, and is usually used for optical zoom.</p>
1752 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1753 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08001754 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08001755 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
1756 * be set to MOVING.</p>
1757 * <p>This is expected not to be supported on most devices.</p>
1758 *
1759 * @see CaptureRequest#LENS_APERTURE
1760 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1761 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001762 */
1763 public static final Key<Float> LENS_FOCAL_LENGTH =
1764 new Key<Float>("android.lens.focalLength", float.class);
1765
1766 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001767 * <p>Distance to plane of sharpest focus,
1768 * measured from frontmost surface of the lens</p>
1769 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001770 */
1771 public static final Key<Float> LENS_FOCUS_DISTANCE =
1772 new Key<Float>("android.lens.focusDistance", float.class);
1773
1774 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001775 * <p>The range of scene distances that are in
1776 * sharp focus (depth of field)</p>
1777 * <p>If variable focus not supported, can still report
1778 * fixed depth of field range</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001779 */
Igor Murashkin78712a82014-05-27 18:32:18 -07001780 public static final Key<android.util.Range<Float>> LENS_FOCUS_RANGE =
1781 new Key<android.util.Range<Float>>("android.lens.focusRange", new TypeReference<android.util.Range<Float>>() {{ }});
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001782
1783 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08001784 * <p>Sets whether the camera device uses optical image stabilization (OIS)
1785 * when capturing images.</p>
1786 * <p>OIS is used to compensate for motion blur due to small movements of
1787 * the camera during capture. Unlike digital image stabilization, OIS makes
1788 * use of mechanical elements to stabilize the camera sensor, and thus
1789 * allows for longer exposure times before camera shake becomes
1790 * apparent.</p>
1791 * <p>This is not expected to be supported on most devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001792 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
1793 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
1794 */
1795 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
1796 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
1797
1798 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08001799 * <p>Current lens status.</p>
1800 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1801 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
1802 * they may take several frames to reach the requested values. This state indicates
1803 * the current status of the lens parameters.</p>
1804 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
1805 * either because the parameters are all fixed, or because the lens has had enough
1806 * time to reach the most recently-requested values.
1807 * If all these lens parameters are not changable for a camera device, as listed below:</p>
1808 * <ul>
1809 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
1810 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
1811 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
1812 * which means the optical zoom is not supported.</li>
1813 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
1814 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
1815 * </ul>
1816 * <p>Then this state will always be STATIONARY.</p>
1817 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
1818 * is changing.</p>
1819 *
1820 * @see CaptureRequest#LENS_APERTURE
1821 * @see CaptureRequest#LENS_FILTER_DENSITY
1822 * @see CaptureRequest#LENS_FOCAL_LENGTH
1823 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1824 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
1825 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
1826 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
1827 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001828 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07001829 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001830 */
1831 public static final Key<Integer> LENS_STATE =
1832 new Key<Integer>("android.lens.state", int.class);
1833
1834 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001835 * <p>Mode of operation for the noise reduction
1836 * algorithm</p>
Zhijun He28079362013-12-17 10:35:40 -08001837 * <p>Noise filtering control. OFF means no noise reduction
Zhijun Hecc28a412014-02-24 15:11:23 -08001838 * will be applied by the camera device.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001839 * <p>This must be set to a valid mode in
1840 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001841 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
1842 * will be applied. HIGH_QUALITY mode indicates that the camera device
1843 * will use the highest-quality noise filtering algorithms,
1844 * even if it slows down capture rate. FAST means the camera device should not
Zhijun He28079362013-12-17 10:35:40 -08001845 * slow down capture rate when applying noise filtering.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001846 *
1847 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001848 * @see #NOISE_REDUCTION_MODE_OFF
1849 * @see #NOISE_REDUCTION_MODE_FAST
1850 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
1851 */
1852 public static final Key<Integer> NOISE_REDUCTION_MODE =
1853 new Key<Integer>("android.noiseReduction.mode", int.class);
1854
1855 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001856 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001857 * final one for the capture, or only a partial that contains a
1858 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08001859 * values.</p>
1860 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001861 * single capture may not overlap, except for this entry. The
1862 * FINAL buffers must retain FIFO ordering relative to the
1863 * requests that generate them, so the FINAL buffer for frame 3 must
1864 * always be sent to the framework after the FINAL buffer for frame 2, and
1865 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
1866 * in any order relative to other frames, but all PARTIAL buffers for a given
1867 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08001868 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08001869 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001870 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001871 * @hide
1872 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001873 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001874 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
1875 new Key<Boolean>("android.quirks.partialResult", boolean.class);
1876
1877 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001878 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07001879 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08001880 * frameCount value).</p>
1881 * <p>Reset on release()</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001882 */
1883 public static final Key<Integer> REQUEST_FRAME_COUNT =
1884 new Key<Integer>("android.request.frameCount", int.class);
1885
1886 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001887 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001888 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08001889 * frame</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001890 * @hide
1891 */
1892 public static final Key<Integer> REQUEST_ID =
1893 new Key<Integer>("android.request.id", int.class);
1894
1895 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08001896 * <p>Specifies the number of pipeline stages the frame went
1897 * through from when it was exposed to when the final completed result
1898 * was available to the framework.</p>
1899 * <p>Depending on what settings are used in the request, and
1900 * what streams are configured, the data may undergo less processing,
1901 * and some pipeline stages skipped.</p>
1902 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
1903 *
1904 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
1905 */
1906 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
1907 new Key<Byte>("android.request.pipelineDepth", byte.class);
1908
1909 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001910 * <p>(x, y, width, height).</p>
1911 * <p>A rectangle with the top-level corner of (x,y) and size
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001912 * (width, height). The region of the sensor that is used for
1913 * output. Each stream must use this rectangle to produce its
1914 * output, cropping to a smaller region if necessary to
Igor Murashkinace5bf02013-12-10 17:36:40 -08001915 * maintain the stream's aspect ratio.</p>
1916 * <p>HAL2.x uses only (x, y, width)</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07001917 * <p>The crop region is applied after the RAW to other color space (e.g. YUV)
1918 * conversion. Since raw streams (e.g. RAW16) don't have the conversion stage,
1919 * it is not croppable. The crop region will be ignored by raw streams.</p>
1920 * <p>For non-raw streams, any additional per-stream cropping will
1921 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001922 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001923 * ratio, then 4:3 streams should use the exact crop
1924 * region. 16:9 streams should further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08001925 * (letterbox).</p>
1926 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001927 * outputs should crop horizontally (pillarbox), and 16:9
1928 * streams should match exactly. These additional crops must
Igor Murashkinace5bf02013-12-10 17:36:40 -08001929 * be centered within the crop region.</p>
1930 * <p>The output streams must maintain square pixels at all
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001931 * times, no matter what the relative aspect ratios of the
1932 * crop region and the stream are. Negative values for
1933 * corner are allowed for raw output if full pixel array is
1934 * larger than active pixel array. Width and height may be
1935 * rounded to nearest larger supportable width, especially
1936 * for raw output, where only a few fixed scales may be
1937 * possible. The width and height of the crop region cannot
1938 * be set to be smaller than floor( activeArraySize.width /
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001939 * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} ) and floor(
1940 * activeArraySize.height /
1941 * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom}), respectively.</p>
1942 *
1943 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001944 */
1945 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
1946 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
1947
1948 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001949 * <p>Duration each pixel is exposed to
1950 * light.</p>
1951 * <p>If the sensor can't expose this exact duration, it should shorten the
1952 * duration exposed to the nearest possible value (rather than expose longer).</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001953 */
1954 public static final Key<Long> SENSOR_EXPOSURE_TIME =
1955 new Key<Long>("android.sensor.exposureTime", long.class);
1956
1957 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001958 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08001959 * start of next frame exposure.</p>
1960 * <p>The maximum frame rate that can be supported by a camera subsystem is
1961 * a function of many factors:</p>
1962 * <ul>
1963 * <li>Requested resolutions of output image streams</li>
1964 * <li>Availability of binning / skipping modes on the imager</li>
1965 * <li>The bandwidth of the imager interface</li>
1966 * <li>The bandwidth of the various ISP processing blocks</li>
1967 * </ul>
1968 * <p>Since these factors can vary greatly between different ISPs and
1969 * sensors, the camera abstraction tries to represent the bandwidth
1970 * restrictions with as simple a model as possible.</p>
1971 * <p>The model presented has the following characteristics:</p>
1972 * <ul>
1973 * <li>The image sensor is always configured to output the smallest
1974 * resolution possible given the application's requested output stream
1975 * sizes. The smallest resolution is defined as being at least as large
1976 * as the largest requested output stream size; the camera pipeline must
1977 * never digitally upsample sensor data when the crop region covers the
1978 * whole sensor. In general, this means that if only small output stream
1979 * resolutions are configured, the sensor can provide a higher frame
1980 * rate.</li>
1981 * <li>Since any request may use any or all the currently configured
1982 * output streams, the sensor and ISP must be configured to support
1983 * scaling a single capture to all the streams at the same time. This
1984 * means the camera pipeline must be ready to produce the largest
1985 * requested output size without any delay. Therefore, the overall
1986 * frame rate of a given configured stream set is governed only by the
1987 * largest requested stream resolution.</li>
1988 * <li>Using more than one output stream in a request does not affect the
1989 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08001990 * <li>Certain format-streams may need to do additional background processing
1991 * before data is consumed/produced by that stream. These processors
1992 * can run concurrently to the rest of the camera pipeline, but
1993 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08001994 * </ul>
1995 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07001996 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
1997 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08001998 * These are used to determine the maximum frame rate / minimum frame
1999 * duration that is possible for a given stream configuration.</p>
2000 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002001 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002002 * device:</p>
2003 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002004 * <li>Let the set of currently configured input/output streams
2005 * be called <code>S</code>.</li>
2006 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002007 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2008 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002009 * its respective size/format). Let this set of frame durations be called
2010 * <code>F</code>.</li>
2011 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2012 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2013 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002014 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002015 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002016 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2017 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002018 * <code>F</code> determines the steady state frame rate that the application will
2019 * get if it uses <code>R</code> as a repeating request. Let this special kind
2020 * of request be called <code>Rsimple</code>.</p>
2021 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2022 * by a single capture of a new request <code>Rstall</code> (which has at least
2023 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2024 * same minimum frame duration this will not cause a frame rate loss
2025 * if all buffers from the previous <code>Rstall</code> have already been
2026 * delivered.</p>
2027 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002028 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002029 *
Igor Murashkin9c595172014-05-12 13:56:20 -07002030 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002031 */
2032 public static final Key<Long> SENSOR_FRAME_DURATION =
2033 new Key<Long>("android.sensor.frameDuration", long.class);
2034
2035 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002036 * <p>Gain applied to image data. Must be
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002037 * implemented through analog gain only if set to values
Igor Murashkinace5bf02013-12-10 17:36:40 -08002038 * below 'maximum analog sensitivity'.</p>
2039 * <p>If the sensor can't apply this exact gain, it should lessen the
2040 * gain to the nearest possible value (rather than gain more).</p>
2041 * <p>ISO 12232:2006 REI method</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002042 */
2043 public static final Key<Integer> SENSOR_SENSITIVITY =
2044 new Key<Integer>("android.sensor.sensitivity", int.class);
2045
2046 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002047 * <p>Time at start of exposure of first
2048 * row</p>
2049 * <p>Monotonic, should be synced to other timestamps in
2050 * system</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002051 */
2052 public static final Key<Long> SENSOR_TIMESTAMP =
2053 new Key<Long>("android.sensor.timestamp", long.class);
2054
2055 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002056 * <p>The estimated camera neutral color in the native sensor colorspace at
2057 * the time of capture.</p>
2058 * <p>This value gives the neutral color point encoded as an RGB value in the
2059 * native sensor color space. The neutral color point indicates the
2060 * currently estimated white point of the scene illumination. It can be
2061 * used to interpolate between the provided color transforms when
2062 * processing raw sensor data.</p>
2063 * <p>The order of the values is R, G, B; where R is in the lowest index.</p>
Ruben Brunk20c76f62014-02-07 15:47:10 -08002064 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2065 */
2066 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2067 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2068
2069 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08002070 * <p>The worst-case divergence between Bayer green channels.</p>
2071 * <p>This value is an estimate of the worst case split between the
2072 * Bayer green channels in the red and blue rows in the sensor color
2073 * filter array.</p>
2074 * <p>The green split is calculated as follows:</p>
2075 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07002076 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2077 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2078 * mosaic channels (R, Gr, Gb, B). The location and size of the window
2079 * chosen is implementation defined, and should be chosen to provide a
2080 * green split estimate that is both representative of the entire image
2081 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002082 * <li>The arithmetic mean of the green channels from the red
2083 * rows (mean_Gr) within W is computed.</li>
2084 * <li>The arithmetic mean of the green channels from the blue
2085 * rows (mean_Gb) within W is computed.</li>
2086 * <li>The maximum ratio R of the two means is computed as follows:
2087 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2088 * </ol>
2089 * <p>The ratio R is the green split divergence reported for this property,
2090 * which represents how much the green channels differ in the mosaic
2091 * pattern. This value is typically used to determine the treatment of
2092 * the green mosaic channels when demosaicing.</p>
2093 * <p>The green split value can be roughly interpreted as follows:</p>
2094 * <ul>
2095 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2096 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2097 * correction to avoid demosaic errors (3-20% divergence).</li>
2098 * <li>R &gt; 1.20 will require strong software correction to produce
2099 * a usuable image (&gt;20% divergence).</li>
2100 * </ul>
2101 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2102 */
2103 public static final Key<Float> SENSOR_GREEN_SPLIT =
2104 new Key<Float>("android.sensor.greenSplit", float.class);
2105
2106 /**
Zhijun He379af012014-05-06 11:54:54 -07002107 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2108 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2109 * <p>Each color channel is treated as an unsigned 32-bit integer.
2110 * The camera device then uses the most significant X bits
2111 * that correspond to how many bits are in its Bayer raw sensor
2112 * output.</p>
2113 * <p>For example, a sensor with RAW10 Bayer output would use the
2114 * 10 most significant bits from each color channel.</p>
2115 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2116 *
2117 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2118 */
2119 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2120 new Key<int[]>("android.sensor.testPatternData", int[].class);
2121
2122 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002123 * <p>When enabled, the sensor sends a test pattern instead of
2124 * doing a real exposure from the camera.</p>
2125 * <p>When a test pattern is enabled, all manual sensor controls specified
2126 * by android.sensor.* should be ignored. All other controls should
2127 * work as normal.</p>
2128 * <p>For example, if manual flash is enabled, flash firing should still
2129 * occur (and that the test pattern remain unmodified, since the flash
2130 * would not actually affect it).</p>
2131 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2132 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2133 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2134 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2135 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2136 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2137 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2138 */
2139 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2140 new Key<Integer>("android.sensor.testPatternMode", int.class);
2141
2142 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002143 * <p>Quality of lens shading correction applied
2144 * to the image data.</p>
2145 * <p>When set to OFF mode, no lens shading correction will be applied by the
2146 * camera device, and an identity lens shading map data will be provided
2147 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
2148 * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>,
2149 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map
2150 * shown below:</p>
2151 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2152 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2153 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2154 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2155 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2156 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
2157 * </code></pre>
2158 * <p>When set to other modes, lens shading correction will be applied by the
2159 * camera device. Applications can request lens shading map data by setting
2160 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide
2161 * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified
Zhijun Hefa7c7552014-05-22 16:36:02 -07002162 * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}; the returned shading map data will be the one
2163 * applied by the camera device for this capture request.</p>
2164 * <p>The shading map data may depend on the AE and AWB statistics, therefore the reliability
2165 * of the map data may be affected by the AE and AWB algorithms. When AE and AWB are in
2166 * AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code> OFF),
2167 * to get best results, it is recommended that the applications wait for the AE and AWB to
2168 * be converged before using the returned shading map data.</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002169 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002170 * @see CaptureRequest#CONTROL_AE_MODE
2171 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun Heba93fe62014-01-17 16:43:05 -08002172 * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
2173 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
2174 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2175 * @see #SHADING_MODE_OFF
2176 * @see #SHADING_MODE_FAST
2177 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08002178 */
2179 public static final Key<Integer> SHADING_MODE =
2180 new Key<Integer>("android.shading.mode", int.class);
2181
2182 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002183 * <p>State of the face detector
2184 * unit</p>
2185 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002186 * should output just the basic fields or the full set of
2187 * fields. Value must be one of the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002188 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p>
2189 *
2190 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002191 * @see #STATISTICS_FACE_DETECT_MODE_OFF
2192 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
2193 * @see #STATISTICS_FACE_DETECT_MODE_FULL
2194 */
2195 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
2196 new Key<Integer>("android.statistics.faceDetectMode", int.class);
2197
2198 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002199 * <p>List of unique IDs for detected
2200 * faces</p>
2201 * <p>Only available if faceDetectMode == FULL</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -08002202 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002203 */
2204 public static final Key<int[]> STATISTICS_FACE_IDS =
2205 new Key<int[]>("android.statistics.faceIds", int[].class);
2206
2207 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002208 * <p>List of landmarks for detected
2209 * faces</p>
2210 * <p>Only available if faceDetectMode == FULL</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -08002211 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002212 */
2213 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
2214 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
2215
2216 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002217 * <p>List of the bounding rectangles for detected
2218 * faces</p>
2219 * <p>Only available if faceDetectMode != OFF</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -08002220 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002221 */
2222 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
2223 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
2224
2225 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002226 * <p>List of the face confidence scores for
2227 * detected faces</p>
2228 * <p>Only available if faceDetectMode != OFF. The value should be
2229 * meaningful (for example, setting 100 at all times is illegal).</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -08002230 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002231 */
2232 public static final Key<byte[]> STATISTICS_FACE_SCORES =
2233 new Key<byte[]>("android.statistics.faceScores", byte[].class);
2234
2235 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002236 * <p>List of the faces detected through camera face detection
2237 * in this result.</p>
2238 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
2239 *
2240 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
2241 */
2242 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
2243 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
2244
2245 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002246 * <p>The shading map is a low-resolution floating-point map
2247 * that lists the coefficients used to correct for vignetting, for each
2248 * Bayer color channel.</p>
2249 * <p>The least shaded section of the image should have a gain factor
2250 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002251 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08002252 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002253 * <p>The shading map is for the entire active pixel array, and is not
2254 * affected by the crop region specified in the request. Each shading map
2255 * entry is the value of the shading compensation map over a specific
2256 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2257 * map, and an active pixel array size (W x H), shading map entry
2258 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2259 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2260 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2261 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2262 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
2263 * The shading map is stored in a fully interleaved format, and its size
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002264 * is provided in the camera static metadata by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002265 * <p>The shading map should have on the order of 30-40 rows and columns,
2266 * and must be smaller than 64x64.</p>
2267 * <p>As an example, given a very small map defined as:</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002268 * <pre><code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]
2269 * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002270 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002271 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2272 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2273 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2274 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2275 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002276 * </code></pre>
2277 * <p>The low-resolution scaling map images for each channel are
2278 * (displayed using nearest-neighbor interpolation):</p>
2279 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2280 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2281 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2282 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2283 * <p>As a visualization only, inverting the full-color map to recover an
2284 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2285 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002286 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002287 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002288 * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002289 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002290 */
2291 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
2292 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
2293
2294 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002295 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08002296 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002297 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002298 * since statistics processing on data from a new frame
2299 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08002300 * applied to that frame.</p>
2301 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002302 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002303 * <p>This value should always be calculated by the AWB block,
2304 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002305 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002306 *
2307 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07002308 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002309 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002310 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002311 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002312 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
2313 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
2314
2315 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002316 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08002317 * calculated by the camera device's statistics units for the current
2318 * output frame.</p>
2319 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002320 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08002321 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002322 * are the best fit for the current output frame. This may
2323 * be different than the transform used for this frame, since
2324 * statistics processing on data from a new frame typically
2325 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002326 * that frame.</p>
2327 * <p>These estimates must be provided for all frames, even if
2328 * capture settings and color transforms are set by the application.</p>
2329 * <p>This value should always be calculated by the AWB block,
2330 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002331 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002332 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002333 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002334 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002335 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002336 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
2337 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
2338
2339 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08002340 * <p>The camera device estimated scene illumination lighting
2341 * frequency.</p>
2342 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
2343 * that depends on the local utility power standards. This flicker must be
2344 * accounted for by auto-exposure routines to avoid artifacts in captured images.
2345 * The camera device uses this entry to tell the application what the scene
2346 * illuminant frequency is.</p>
2347 * <p>When manual exposure control is enabled
2348 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == OFF</code>),
2349 * the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't do the antibanding, and the
2350 * application can ensure it selects exposure times that do not cause banding
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002351 * issues by looking into this metadata field. See {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}
Zhijun He208fb6c2014-02-03 13:09:06 -08002352 * for more details.</p>
2353 * <p>Report NONE if there doesn't appear to be flickering illumination.</p>
2354 *
2355 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
2356 * @see CaptureRequest#CONTROL_AE_MODE
2357 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002358 * @see #STATISTICS_SCENE_FLICKER_NONE
2359 * @see #STATISTICS_SCENE_FLICKER_50HZ
2360 * @see #STATISTICS_SCENE_FLICKER_60HZ
2361 */
2362 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
2363 new Key<Integer>("android.statistics.sceneFlicker", int.class);
2364
2365 /**
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002366 * <p>Operating mode for hotpixel map generation.</p>
2367 * <p>If set to ON, a hotpixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
2368 * If set to OFF, no hotpixel map should be returned.</p>
2369 * <p>This must be set to a valid mode from {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}.</p>
2370 *
2371 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
2372 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
2373 */
2374 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
2375 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
2376
2377 /**
2378 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
2379 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
2380 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
2381 * bottom-right of the pixel array, respectively. The width and
2382 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
2383 * This may include hot pixels that lie outside of the active array
2384 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2385 *
2386 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2387 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2388 */
2389 public static final Key<int[]> STATISTICS_HOT_PIXEL_MAP =
2390 new Key<int[]>("android.statistics.hotPixelMap", int[].class);
2391
2392 /**
Zhijun He379af012014-05-06 11:54:54 -07002393 * <p>Whether the camera device will output the lens
2394 * shading map in output result metadata.</p>
2395 * <p>When set to ON,
2396 * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} must be provided in
2397 * the output result metadata.</p>
2398 *
2399 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
2400 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2401 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2402 */
2403 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2404 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2405
2406 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002407 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08002408 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2409 * CONTRAST_CURVE.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002410 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
2411 *
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002412 * @see CaptureRequest#TONEMAP_CURVE_RED
Zhijun He5f2a47f2014-01-16 15:44:41 -08002413 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002414 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002415 public static final Key<float[]> TONEMAP_CURVE_BLUE =
2416 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002417
2418 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002419 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08002420 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2421 * CONTRAST_CURVE.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002422 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
2423 *
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002424 * @see CaptureRequest#TONEMAP_CURVE_RED
Zhijun He5f2a47f2014-01-16 15:44:41 -08002425 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002426 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002427 public static final Key<float[]> TONEMAP_CURVE_GREEN =
2428 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002429
2430 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002431 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08002432 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2433 * CONTRAST_CURVE.</p>
2434 * <p>Each channel's curve is defined by an array of control points:</p>
2435 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} =
2436 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08002437 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Igor Murashkine0060932014-01-17 17:24:11 -08002438 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2439 * guaranteed that input values 0.0 and 1.0 are included in the list to
2440 * define a complete mapping. For input values between control points,
2441 * the camera device must linearly interpolate between the control
2442 * points.</p>
2443 * <p>Each curve can have an independent number of points, and the number
2444 * of points can be less than max (that is, the request doesn't have to
2445 * always provide a curve with number of points equivalent to
2446 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2447 * <p>A few examples, and their corresponding graphical mappings; these
2448 * only specify the red channel and the precision is limited to 4
2449 * digits, for conciseness.</p>
2450 * <p>Linear mapping:</p>
2451 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 0, 1.0, 1.0 ]
2452 * </code></pre>
2453 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2454 * <p>Invert mapping:</p>
2455 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 1.0, 1.0, 0 ]
2456 * </code></pre>
2457 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2458 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
2459 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [
2460 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2461 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2462 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2463 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
2464 * </code></pre>
2465 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2466 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
2467 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [
2468 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2469 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2470 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2471 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
2472 * </code></pre>
2473 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002474 *
Igor Murashkine0060932014-01-17 17:24:11 -08002475 * @see CaptureRequest#TONEMAP_CURVE_RED
2476 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002477 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002478 */
2479 public static final Key<float[]> TONEMAP_CURVE_RED =
2480 new Key<float[]>("android.tonemap.curveRed", float[].class);
2481
2482 /**
Igor Murashkine0060932014-01-17 17:24:11 -08002483 * <p>High-level global contrast/gamma/tonemapping control.</p>
2484 * <p>When switching to an application-defined contrast curve by setting
2485 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
2486 * per-channel with a set of <code>(in, out)</code> points that specify the
2487 * mapping from input high-bit-depth pixel value to the output
2488 * low-bit-depth value. Since the actual pixel ranges of both input
2489 * and output may change depending on the camera pipeline, the values
2490 * are specified by normalized floating-point numbers.</p>
2491 * <p>More-complex color mapping operations such as 3D color look-up
2492 * tables, selective chroma enhancement, or other non-linear color
2493 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2494 * CONTRAST_CURVE.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002495 * <p>This must be set to a valid mode in
2496 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08002497 * <p>When using either FAST or HIGH_QUALITY, the camera device will
2498 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed},
2499 * {@link CaptureRequest#TONEMAP_CURVE_GREEN android.tonemap.curveGreen}, and {@link CaptureRequest#TONEMAP_CURVE_BLUE android.tonemap.curveBlue}.
2500 * These values are always available, and as close as possible to the
2501 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07002502 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08002503 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
2504 * roughly the same.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002505 *
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002506 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Igor Murashkine0060932014-01-17 17:24:11 -08002507 * @see CaptureRequest#TONEMAP_CURVE_BLUE
2508 * @see CaptureRequest#TONEMAP_CURVE_GREEN
2509 * @see CaptureRequest#TONEMAP_CURVE_RED
2510 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002511 * @see #TONEMAP_MODE_CONTRAST_CURVE
2512 * @see #TONEMAP_MODE_FAST
2513 * @see #TONEMAP_MODE_HIGH_QUALITY
2514 */
2515 public static final Key<Integer> TONEMAP_MODE =
2516 new Key<Integer>("android.tonemap.mode", int.class);
2517
2518 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002519 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002520 * that the camera is powered on and may be streaming images back to the
2521 * Application Processor. In certain rare circumstances, the OS may
2522 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002523 * any untrusted applications.</p>
2524 * <p>In particular, the LED <em>must</em> always be on when the data could be
2525 * transmitted off the device. The LED <em>should</em> always be on whenever
2526 * data is stored locally on the device.</p>
2527 * <p>The LED <em>may</em> be off if a trusted application is using the data that
2528 * doesn't violate the above rules.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002529 * @hide
2530 */
2531 public static final Key<Boolean> LED_TRANSMIT =
2532 new Key<Boolean>("android.led.transmit", boolean.class);
2533
2534 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002535 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002536 * to its current values, or is free to vary.</p>
2537 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002538 * ON if {@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock} was ON in the capture request, unless
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002539 * a change in other capture settings forced the camera device to
2540 * perform a black level reset.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002541 *
2542 * @see CaptureRequest#BLACK_LEVEL_LOCK
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002543 */
2544 public static final Key<Boolean> BLACK_LEVEL_LOCK =
2545 new Key<Boolean>("android.blackLevel.lock", boolean.class);
2546
Igor Murashkin3865a842014-01-17 18:18:39 -08002547 /**
2548 * <p>The frame number corresponding to the last request
2549 * with which the output result (metadata + buffers) has been fully
2550 * synchronized.</p>
2551 * <p>When a request is submitted to the camera device, there is usually a
2552 * delay of several frames before the controls get applied. A camera
2553 * device may either choose to account for this delay by implementing a
2554 * pipeline and carefully submit well-timed atomic control updates, or
2555 * it may start streaming control changes that span over several frame
2556 * boundaries.</p>
2557 * <p>In the latter case, whenever a request's settings change relative to
2558 * the previous submitted request, the full set of changes may take
2559 * multiple frame durations to fully take effect. Some settings may
2560 * take effect sooner (in less frame durations) than others.</p>
2561 * <p>While a set of control changes are being propagated, this value
2562 * will be CONVERGING.</p>
2563 * <p>Once it is fully known that a set of control changes have been
2564 * finished propagating, and the resulting updated control settings
2565 * have been read back by the camera device, this value will be set
2566 * to a non-negative frame number (corresponding to the request to
2567 * which the results have synchronized to).</p>
2568 * <p>Older camera device implementations may not have a way to detect
2569 * when all camera controls have been applied, and will always set this
2570 * value to UNKNOWN.</p>
2571 * <p>FULL capability devices will always have this value set to the
2572 * frame number of the request corresponding to this result.</p>
2573 * <p><em>Further details</em>:</p>
2574 * <ul>
2575 * <li>Whenever a request differs from the last request, any future
2576 * results not yet returned may have this value set to CONVERGING (this
2577 * could include any in-progress captures not yet returned by the camera
2578 * device, for more details see pipeline considerations below).</li>
2579 * <li>Submitting a series of multiple requests that differ from the
2580 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
2581 * moves the new synchronization frame to the last non-repeating
2582 * request (using the smallest frame number from the contiguous list of
2583 * repeating requests).</li>
2584 * <li>Submitting the same request repeatedly will not change this value
2585 * to CONVERGING, if it was already a non-negative value.</li>
2586 * <li>When this value changes to non-negative, that means that all of the
2587 * metadata controls from the request have been applied, all of the
2588 * metadata controls from the camera device have been read to the
2589 * updated values (into the result), and all of the graphics buffers
2590 * corresponding to this result are also synchronized to the request.</li>
2591 * </ul>
2592 * <p><em>Pipeline considerations</em>:</p>
2593 * <p>Submitting a request with updated controls relative to the previously
2594 * submitted requests may also invalidate the synchronization state
2595 * of all the results corresponding to currently in-flight requests.</p>
2596 * <p>In other words, results for this current request and up to
2597 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
2598 * android.sync.frameNumber change to CONVERGING.</p>
2599 *
2600 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2601 * @see #SYNC_FRAME_NUMBER_CONVERGING
2602 * @see #SYNC_FRAME_NUMBER_UNKNOWN
2603 * @hide
2604 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07002605 public static final Key<Long> SYNC_FRAME_NUMBER =
2606 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08002607
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002608 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2609 * End generated code
2610 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002611}