blob: 9aa56cf6636e4b1a3bb6c845d8422106bbeef151 [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 */
386 public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM =
387 new Key<Rational[]>("android.colorCorrection.transform", Rational[].class);
388
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>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800392 * <p>The 4-channel white-balance gains are defined in
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800393 * the order of <code>[R G_even G_odd B]</code>, where <code>G_even</code> is the gain
394 * for green pixels on even rows of the output, and <code>G_odd</code>
395 * is the gain for green pixels on the odd rows. if a HAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700396 * does not support a separate gain for even/odd green channels,
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800397 * it should use the <code>G_even</code> value, and write <code>G_odd</code> equal to
398 * <code>G_even</code> in the output result metadata.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800399 * <p>This array is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800400 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Igor Murashkind5ff06a2013-08-20 15:15:06 -0700401 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800402 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800403 * <p>The output should be the gains actually applied by the camera device to
Igor Murashkinace5bf02013-12-10 17:36:40 -0800404 * the current frame.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800405 *
406 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700407 */
408 public static final Key<float[]> COLOR_CORRECTION_GAINS =
409 new Key<float[]>("android.colorCorrection.gains", float[].class);
410
411 /**
Zhijun He379af012014-05-06 11:54:54 -0700412 * <p>The desired setting for the camera device's auto-exposure
413 * algorithm's antibanding compensation.</p>
414 * <p>Some kinds of lighting fixtures, such as some fluorescent
415 * lights, flicker at the rate of the power supply frequency
416 * (60Hz or 50Hz, depending on country). While this is
417 * typically not noticeable to a person, it can be visible to
418 * a camera device. If a camera sets its exposure time to the
419 * wrong value, the flicker may become visible in the
420 * viewfinder as flicker or in a final captured image, as a
421 * set of variable-brightness bands across the image.</p>
422 * <p>Therefore, the auto-exposure routines of camera devices
423 * include antibanding routines that ensure that the chosen
424 * exposure value will not cause such banding. The choice of
425 * exposure time depends on the rate of flicker, which the
426 * camera device can detect automatically, or the expected
427 * rate can be selected by the application using this
428 * control.</p>
429 * <p>A given camera device may not support all of the possible
430 * options for the antibanding mode. The
431 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
432 * the available modes for a given camera device.</p>
433 * <p>The default mode is AUTO, which must be supported by all
434 * camera devices.</p>
435 * <p>If manual exposure control is enabled (by setting
436 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
437 * then this setting has no effect, and the application must
438 * ensure it selects exposure times that do not cause banding
439 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
440 * the application in this.</p>
441 *
442 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
443 * @see CaptureRequest#CONTROL_AE_MODE
444 * @see CaptureRequest#CONTROL_MODE
445 * @see CaptureResult#STATISTICS_SCENE_FLICKER
446 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
447 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
448 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
449 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
450 */
451 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
452 new Key<Integer>("android.control.aeAntibandingMode", int.class);
453
454 /**
455 * <p>Adjustment to AE target image
456 * brightness</p>
457 * <p>For example, if EV step is 0.333, '6' will mean an
458 * exposure compensation of +2 EV; -3 will mean an exposure
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700459 * compensation of -1 EV. Note that this control will only be effective
460 * if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control will take effect even when
461 * {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p>
462 * <p>In the event of exposure compensation value being changed, camera device
463 * may take several frames to reach the newly requested exposure target.
464 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
465 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
466 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
467 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
468 *
469 * @see CaptureRequest#CONTROL_AE_LOCK
470 * @see CaptureRequest#CONTROL_AE_MODE
471 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700472 */
473 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
474 new Key<Integer>("android.control.aeExposureCompensation", int.class);
475
476 /**
477 * <p>Whether AE is currently locked to its latest
478 * calculated values.</p>
479 * <p>Note that even when AE is locked, the flash may be
480 * fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / ON_ALWAYS_FLASH /
481 * ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700482 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
483 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700484 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
485 * when AE is already locked, the camera device will not change the exposure time
486 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
487 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
488 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
489 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
490 * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
491 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700492 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700493 * @see CaptureRequest#CONTROL_AE_MODE
494 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
495 * @see CaptureResult#CONTROL_AE_STATE
496 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
497 * @see CaptureRequest#SENSOR_SENSITIVITY
498 */
499 public static final Key<Boolean> CONTROL_AE_LOCK =
500 new Key<Boolean>("android.control.aeLock", boolean.class);
501
502 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800503 * <p>The desired mode for the camera device's
504 * auto-exposure routine.</p>
505 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
506 * AUTO.</p>
507 * <p>When set to any of the ON modes, the camera device's
508 * auto-exposure routine is enabled, overriding the
509 * application's selected exposure time, sensor sensitivity,
510 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
511 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
512 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
513 * is selected, the camera device's flash unit controls are
514 * also overridden.</p>
515 * <p>The FLASH modes are only available if the camera device
516 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
517 * <p>If flash TORCH mode is desired, this field must be set to
518 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
519 * <p>When set to any of the ON modes, the values chosen by the
520 * camera device auto-exposure routine for the overridden
521 * fields for a given capture will be available in its
522 * CaptureResult.</p>
523 *
Zhijun He5f2a47f2014-01-16 15:44:41 -0800524 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800525 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
526 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800527 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
528 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800529 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800530 * @see #CONTROL_AE_MODE_OFF
531 * @see #CONTROL_AE_MODE_ON
532 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
533 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
534 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
535 */
536 public static final Key<Integer> CONTROL_AE_MODE =
537 new Key<Integer>("android.control.aeMode", int.class);
538
539 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800540 * <p>List of areas to use for
Ruben Brunkf59521d2014-02-03 17:14:33 -0800541 * metering.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800542 * <p>Each area is a rectangle plus weight: xmin, ymin,
Ruben Brunkf59521d2014-02-03 17:14:33 -0800543 * xmax, ymax, weight. The rectangle is defined to be inclusive of the
Igor Murashkinace5bf02013-12-10 17:36:40 -0800544 * specified coordinates.</p>
545 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700546 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800547 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
548 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Timothy Knight2629f272013-09-03 17:23:23 -0700549 * bottom-right pixel in the active pixel array. The weight
Igor Murashkinace5bf02013-12-10 17:36:40 -0800550 * should be nonnegative.</p>
551 * <p>If all regions have 0 weight, then no specific metering area
Zhijun Hecc28a412014-02-24 15:11:23 -0800552 * needs to be used by the camera device. If the metering region is
Zhijun He14986152014-05-22 21:17:37 -0700553 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
554 * the camera device will ignore the sections outside the region and output the
555 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800556 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800557 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800558 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700559 */
560 public static final Key<int[]> CONTROL_AE_REGIONS =
561 new Key<int[]>("android.control.aeRegions", int[].class);
562
563 /**
Zhijun He379af012014-05-06 11:54:54 -0700564 * <p>Range over which fps can be adjusted to
565 * maintain exposure</p>
566 * <p>Only constrains AE algorithm, not manual control
567 * of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p>
568 *
569 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
570 */
571 public static final Key<int[]> CONTROL_AE_TARGET_FPS_RANGE =
572 new Key<int[]>("android.control.aeTargetFpsRange", int[].class);
573
574 /**
575 * <p>Whether the camera device will trigger a precapture
576 * metering sequence when it processes this request.</p>
577 * <p>This entry is normally set to IDLE, or is not
578 * included at all in the request settings. When included and
579 * set to START, the camera device will trigger the autoexposure
580 * precapture metering sequence.</p>
581 * <p>The effect of AE precapture trigger depends on the current
582 * AE mode and state; see {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture
583 * state transition details.</p>
584 *
585 * @see CaptureResult#CONTROL_AE_STATE
586 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
587 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
588 */
589 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
590 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
591
592 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800593 * <p>Current state of AE algorithm</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800594 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
595 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
596 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
597 * the algorithm states to INACTIVE.</p>
598 * <p>The camera device can do several state transitions between two results, if it is
599 * allowed by the state transition table. For example: INACTIVE may never actually be
600 * seen in a result.</p>
601 * <p>The state in the result is the state for this image (in sync with this image): if
602 * AE state becomes CONVERGED, then the image data associated with this result should
603 * be good to use.</p>
604 * <p>Below are state transition tables for different AE modes.</p>
605 * <table>
606 * <thead>
607 * <tr>
608 * <th align="center">State</th>
609 * <th align="center">Transition Cause</th>
610 * <th align="center">New State</th>
611 * <th align="center">Notes</th>
612 * </tr>
613 * </thead>
614 * <tbody>
615 * <tr>
616 * <td align="center">INACTIVE</td>
617 * <td align="center"></td>
618 * <td align="center">INACTIVE</td>
619 * <td align="center">Camera device auto exposure algorithm is disabled</td>
620 * </tr>
621 * </tbody>
622 * </table>
623 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
624 * <table>
625 * <thead>
626 * <tr>
627 * <th align="center">State</th>
628 * <th align="center">Transition Cause</th>
629 * <th align="center">New State</th>
630 * <th align="center">Notes</th>
631 * </tr>
632 * </thead>
633 * <tbody>
634 * <tr>
635 * <td align="center">INACTIVE</td>
636 * <td align="center">Camera device initiates AE scan</td>
637 * <td align="center">SEARCHING</td>
638 * <td align="center">Values changing</td>
639 * </tr>
640 * <tr>
641 * <td align="center">INACTIVE</td>
642 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
643 * <td align="center">LOCKED</td>
644 * <td align="center">Values locked</td>
645 * </tr>
646 * <tr>
647 * <td align="center">SEARCHING</td>
648 * <td align="center">Camera device finishes AE scan</td>
649 * <td align="center">CONVERGED</td>
650 * <td align="center">Good values, not changing</td>
651 * </tr>
652 * <tr>
653 * <td align="center">SEARCHING</td>
654 * <td align="center">Camera device finishes AE scan</td>
655 * <td align="center">FLASH_REQUIRED</td>
656 * <td align="center">Converged but too dark w/o flash</td>
657 * </tr>
658 * <tr>
659 * <td align="center">SEARCHING</td>
660 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
661 * <td align="center">LOCKED</td>
662 * <td align="center">Values locked</td>
663 * </tr>
664 * <tr>
665 * <td align="center">CONVERGED</td>
666 * <td align="center">Camera device initiates AE scan</td>
667 * <td align="center">SEARCHING</td>
668 * <td align="center">Values changing</td>
669 * </tr>
670 * <tr>
671 * <td align="center">CONVERGED</td>
672 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
673 * <td align="center">LOCKED</td>
674 * <td align="center">Values locked</td>
675 * </tr>
676 * <tr>
677 * <td align="center">FLASH_REQUIRED</td>
678 * <td align="center">Camera device initiates AE scan</td>
679 * <td align="center">SEARCHING</td>
680 * <td align="center">Values changing</td>
681 * </tr>
682 * <tr>
683 * <td align="center">FLASH_REQUIRED</td>
684 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
685 * <td align="center">LOCKED</td>
686 * <td align="center">Values locked</td>
687 * </tr>
688 * <tr>
689 * <td align="center">LOCKED</td>
690 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
691 * <td align="center">SEARCHING</td>
692 * <td align="center">Values not good after unlock</td>
693 * </tr>
694 * <tr>
695 * <td align="center">LOCKED</td>
696 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
697 * <td align="center">CONVERGED</td>
698 * <td align="center">Values good after unlock</td>
699 * </tr>
700 * <tr>
701 * <td align="center">LOCKED</td>
702 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
703 * <td align="center">FLASH_REQUIRED</td>
704 * <td align="center">Exposure good, but too dark</td>
705 * </tr>
706 * <tr>
707 * <td align="center">PRECAPTURE</td>
708 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
709 * <td align="center">CONVERGED</td>
710 * <td align="center">Ready for high-quality capture</td>
711 * </tr>
712 * <tr>
713 * <td align="center">PRECAPTURE</td>
714 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
715 * <td align="center">LOCKED</td>
716 * <td align="center">Ready for high-quality capture</td>
717 * </tr>
718 * <tr>
719 * <td align="center">Any state</td>
720 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
721 * <td align="center">PRECAPTURE</td>
722 * <td align="center">Start AE precapture metering sequence</td>
723 * </tr>
724 * </tbody>
725 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800726 * <p>For the above table, the camera device may skip reporting any state changes that happen
727 * without application intervention (i.e. mode switch, trigger, locking). Any state that
728 * can be skipped in that manner is called a transient state.</p>
729 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
730 * listed in above table, it is also legal for the camera device to skip one or more
731 * transient states between two results. See below table for examples:</p>
732 * <table>
733 * <thead>
734 * <tr>
735 * <th align="center">State</th>
736 * <th align="center">Transition Cause</th>
737 * <th align="center">New State</th>
738 * <th align="center">Notes</th>
739 * </tr>
740 * </thead>
741 * <tbody>
742 * <tr>
743 * <td align="center">INACTIVE</td>
744 * <td align="center">Camera device finished AE scan</td>
745 * <td align="center">CONVERGED</td>
746 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
747 * </tr>
748 * <tr>
749 * <td align="center">Any state</td>
750 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
751 * <td align="center">FLASH_REQUIRED</td>
752 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
753 * </tr>
754 * <tr>
755 * <td align="center">Any state</td>
756 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
757 * <td align="center">CONVERGED</td>
758 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
759 * </tr>
760 * <tr>
761 * <td align="center">CONVERGED</td>
762 * <td align="center">Camera device finished AE scan</td>
763 * <td align="center">FLASH_REQUIRED</td>
764 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
765 * </tr>
766 * <tr>
767 * <td align="center">FLASH_REQUIRED</td>
768 * <td align="center">Camera device finished AE scan</td>
769 * <td align="center">CONVERGED</td>
770 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
771 * </tr>
772 * </tbody>
773 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -0800774 *
775 * @see CaptureRequest#CONTROL_AE_LOCK
776 * @see CaptureRequest#CONTROL_AE_MODE
777 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
778 * @see CaptureRequest#CONTROL_MODE
779 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700780 * @see #CONTROL_AE_STATE_INACTIVE
781 * @see #CONTROL_AE_STATE_SEARCHING
782 * @see #CONTROL_AE_STATE_CONVERGED
783 * @see #CONTROL_AE_STATE_LOCKED
784 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
785 * @see #CONTROL_AE_STATE_PRECAPTURE
786 */
787 public static final Key<Integer> CONTROL_AE_STATE =
788 new Key<Integer>("android.control.aeState", int.class);
789
790 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800791 * <p>Whether AF is currently enabled, and what
792 * mode it is set to</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800793 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
794 * (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 -0800795 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800796 * 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 -0800797 * in result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800798 *
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800799 * @see CaptureResult#CONTROL_AF_STATE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800800 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -0800801 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700802 * @see #CONTROL_AF_MODE_OFF
803 * @see #CONTROL_AF_MODE_AUTO
804 * @see #CONTROL_AF_MODE_MACRO
805 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
806 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
807 * @see #CONTROL_AF_MODE_EDOF
808 */
809 public static final Key<Integer> CONTROL_AF_MODE =
810 new Key<Integer>("android.control.afMode", int.class);
811
812 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800813 * <p>List of areas to use for focus
Ruben Brunkf59521d2014-02-03 17:14:33 -0800814 * estimation.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800815 * <p>Each area is a rectangle plus weight: xmin, ymin,
Ruben Brunkf59521d2014-02-03 17:14:33 -0800816 * xmax, ymax, weight. The rectangle is defined to be inclusive of the
Igor Murashkinace5bf02013-12-10 17:36:40 -0800817 * specified coordinates.</p>
818 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700819 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800820 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
821 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Timothy Knight2629f272013-09-03 17:23:23 -0700822 * bottom-right pixel in the active pixel array. The weight
Igor Murashkinace5bf02013-12-10 17:36:40 -0800823 * should be nonnegative.</p>
824 * <p>If all regions have 0 weight, then no specific focus area
Zhijun Hecc28a412014-02-24 15:11:23 -0800825 * needs to be used by the camera device. If the focusing region is
Zhijun He14986152014-05-22 21:17:37 -0700826 * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture
827 * result metadata, the camera device will ignore the sections outside
828 * the region and output the used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800829 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800830 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800831 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700832 */
833 public static final Key<int[]> CONTROL_AF_REGIONS =
834 new Key<int[]>("android.control.afRegions", int[].class);
835
836 /**
Zhijun He379af012014-05-06 11:54:54 -0700837 * <p>Whether the camera device will trigger autofocus for this request.</p>
838 * <p>This entry is normally set to IDLE, or is not
839 * included at all in the request settings.</p>
840 * <p>When included and set to START, the camera device will trigger the
841 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
842 * <p>When set to CANCEL, the camera device will cancel any active trigger,
843 * and return to its initial AF state.</p>
844 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what that means for each AF mode.</p>
845 *
846 * @see CaptureResult#CONTROL_AF_STATE
847 * @see #CONTROL_AF_TRIGGER_IDLE
848 * @see #CONTROL_AF_TRIGGER_START
849 * @see #CONTROL_AF_TRIGGER_CANCEL
850 */
851 public static final Key<Integer> CONTROL_AF_TRIGGER =
852 new Key<Integer>("android.control.afTrigger", int.class);
853
854 /**
Zhijun He60b19dc2014-02-24 10:19:20 -0800855 * <p>Current state of AF algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800856 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
857 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
858 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
859 * the algorithm states to INACTIVE.</p>
860 * <p>The camera device can do several state transitions between two results, if it is
861 * allowed by the state transition table. For example: INACTIVE may never actually be
862 * seen in a result.</p>
863 * <p>The state in the result is the state for this image (in sync with this image): if
864 * AF state becomes FOCUSED, then the image data associated with this result should
865 * be sharp.</p>
866 * <p>Below are state transition tables for different AF modes.</p>
867 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
868 * <table>
869 * <thead>
870 * <tr>
871 * <th align="center">State</th>
872 * <th align="center">Transition Cause</th>
873 * <th align="center">New State</th>
874 * <th align="center">Notes</th>
875 * </tr>
876 * </thead>
877 * <tbody>
878 * <tr>
879 * <td align="center">INACTIVE</td>
880 * <td align="center"></td>
881 * <td align="center">INACTIVE</td>
882 * <td align="center">Never changes</td>
883 * </tr>
884 * </tbody>
885 * </table>
886 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
887 * <table>
888 * <thead>
889 * <tr>
890 * <th align="center">State</th>
891 * <th align="center">Transition Cause</th>
892 * <th align="center">New State</th>
893 * <th align="center">Notes</th>
894 * </tr>
895 * </thead>
896 * <tbody>
897 * <tr>
898 * <td align="center">INACTIVE</td>
899 * <td align="center">AF_TRIGGER</td>
900 * <td align="center">ACTIVE_SCAN</td>
901 * <td align="center">Start AF sweep, Lens now moving</td>
902 * </tr>
903 * <tr>
904 * <td align="center">ACTIVE_SCAN</td>
905 * <td align="center">AF sweep done</td>
906 * <td align="center">FOCUSED_LOCKED</td>
907 * <td align="center">Focused, Lens now locked</td>
908 * </tr>
909 * <tr>
910 * <td align="center">ACTIVE_SCAN</td>
911 * <td align="center">AF sweep done</td>
912 * <td align="center">NOT_FOCUSED_LOCKED</td>
913 * <td align="center">Not focused, Lens now locked</td>
914 * </tr>
915 * <tr>
916 * <td align="center">ACTIVE_SCAN</td>
917 * <td align="center">AF_CANCEL</td>
918 * <td align="center">INACTIVE</td>
919 * <td align="center">Cancel/reset AF, Lens now locked</td>
920 * </tr>
921 * <tr>
922 * <td align="center">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">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">NOT_FOCUSED_LOCKED</td>
935 * <td align="center">AF_CANCEL</td>
936 * <td align="center">INACTIVE</td>
937 * <td align="center">Cancel/reset AF</td>
938 * </tr>
939 * <tr>
940 * <td align="center">NOT_FOCUSED_LOCKED</td>
941 * <td align="center">AF_TRIGGER</td>
942 * <td align="center">ACTIVE_SCAN</td>
943 * <td align="center">Start new sweep, Lens now moving</td>
944 * </tr>
945 * <tr>
946 * <td align="center">Any state</td>
947 * <td align="center">Mode change</td>
948 * <td align="center">INACTIVE</td>
949 * <td align="center"></td>
950 * </tr>
951 * </tbody>
952 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800953 * <p>For the above table, the camera device may skip reporting any state changes that happen
954 * without application intervention (i.e. mode switch, trigger, locking). Any state that
955 * can be skipped in that manner is called a transient state.</p>
956 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
957 * state transitions listed in above table, it is also legal for the camera device to skip
958 * one or more transient states between two results. See below table for examples:</p>
959 * <table>
960 * <thead>
961 * <tr>
962 * <th align="center">State</th>
963 * <th align="center">Transition Cause</th>
964 * <th align="center">New State</th>
965 * <th align="center">Notes</th>
966 * </tr>
967 * </thead>
968 * <tbody>
969 * <tr>
970 * <td align="center">INACTIVE</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">INACTIVE</td>
977 * <td align="center">AF_TRIGGER</td>
978 * <td align="center">NOT_FOCUSED_LOCKED</td>
979 * <td align="center">Focus failed after a scan, lens is now locked.</td>
980 * </tr>
981 * <tr>
982 * <td align="center">FOCUSED_LOCKED</td>
983 * <td align="center">AF_TRIGGER</td>
984 * <td align="center">FOCUSED_LOCKED</td>
985 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
986 * </tr>
987 * <tr>
988 * <td align="center">NOT_FOCUSED_LOCKED</td>
989 * <td align="center">AF_TRIGGER</td>
990 * <td align="center">FOCUSED_LOCKED</td>
991 * <td align="center">Focus is good after a scan, lens is not locked.</td>
992 * </tr>
993 * </tbody>
994 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -0800995 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
996 * <table>
997 * <thead>
998 * <tr>
999 * <th align="center">State</th>
1000 * <th align="center">Transition Cause</th>
1001 * <th align="center">New State</th>
1002 * <th align="center">Notes</th>
1003 * </tr>
1004 * </thead>
1005 * <tbody>
1006 * <tr>
1007 * <td align="center">INACTIVE</td>
1008 * <td align="center">Camera device initiates new scan</td>
1009 * <td align="center">PASSIVE_SCAN</td>
1010 * <td align="center">Start AF scan, Lens now moving</td>
1011 * </tr>
1012 * <tr>
1013 * <td align="center">INACTIVE</td>
1014 * <td align="center">AF_TRIGGER</td>
1015 * <td align="center">NOT_FOCUSED_LOCKED</td>
1016 * <td align="center">AF state query, Lens now locked</td>
1017 * </tr>
1018 * <tr>
1019 * <td align="center">PASSIVE_SCAN</td>
1020 * <td align="center">Camera device completes current scan</td>
1021 * <td align="center">PASSIVE_FOCUSED</td>
1022 * <td align="center">End AF scan, Lens now locked</td>
1023 * </tr>
1024 * <tr>
1025 * <td align="center">PASSIVE_SCAN</td>
1026 * <td align="center">Camera device fails current scan</td>
1027 * <td align="center">PASSIVE_UNFOCUSED</td>
1028 * <td align="center">End AF scan, Lens now locked</td>
1029 * </tr>
1030 * <tr>
1031 * <td align="center">PASSIVE_SCAN</td>
1032 * <td align="center">AF_TRIGGER</td>
1033 * <td align="center">FOCUSED_LOCKED</td>
1034 * <td align="center">Immediate trans. If focus is good, Lens now locked</td>
1035 * </tr>
1036 * <tr>
1037 * <td align="center">PASSIVE_SCAN</td>
1038 * <td align="center">AF_TRIGGER</td>
1039 * <td align="center">NOT_FOCUSED_LOCKED</td>
1040 * <td align="center">Immediate trans. if focus is bad, Lens now locked</td>
1041 * </tr>
1042 * <tr>
1043 * <td align="center">PASSIVE_SCAN</td>
1044 * <td align="center">AF_CANCEL</td>
1045 * <td align="center">INACTIVE</td>
1046 * <td align="center">Reset lens position, Lens now locked</td>
1047 * </tr>
1048 * <tr>
1049 * <td align="center">PASSIVE_FOCUSED</td>
1050 * <td align="center">Camera device initiates new scan</td>
1051 * <td align="center">PASSIVE_SCAN</td>
1052 * <td align="center">Start AF scan, Lens now moving</td>
1053 * </tr>
1054 * <tr>
1055 * <td align="center">PASSIVE_UNFOCUSED</td>
1056 * <td align="center">Camera device initiates new scan</td>
1057 * <td align="center">PASSIVE_SCAN</td>
1058 * <td align="center">Start AF scan, Lens now moving</td>
1059 * </tr>
1060 * <tr>
1061 * <td align="center">PASSIVE_FOCUSED</td>
1062 * <td align="center">AF_TRIGGER</td>
1063 * <td align="center">FOCUSED_LOCKED</td>
1064 * <td align="center">Immediate trans. Lens now locked</td>
1065 * </tr>
1066 * <tr>
1067 * <td align="center">PASSIVE_UNFOCUSED</td>
1068 * <td align="center">AF_TRIGGER</td>
1069 * <td align="center">NOT_FOCUSED_LOCKED</td>
1070 * <td align="center">Immediate trans. Lens now locked</td>
1071 * </tr>
1072 * <tr>
1073 * <td align="center">FOCUSED_LOCKED</td>
1074 * <td align="center">AF_TRIGGER</td>
1075 * <td align="center">FOCUSED_LOCKED</td>
1076 * <td align="center">No effect</td>
1077 * </tr>
1078 * <tr>
1079 * <td align="center">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 * <tr>
1085 * <td align="center">NOT_FOCUSED_LOCKED</td>
1086 * <td align="center">AF_TRIGGER</td>
1087 * <td align="center">NOT_FOCUSED_LOCKED</td>
1088 * <td align="center">No effect</td>
1089 * </tr>
1090 * <tr>
1091 * <td align="center">NOT_FOCUSED_LOCKED</td>
1092 * <td align="center">AF_CANCEL</td>
1093 * <td align="center">INACTIVE</td>
1094 * <td align="center">Restart AF scan</td>
1095 * </tr>
1096 * </tbody>
1097 * </table>
1098 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1099 * <table>
1100 * <thead>
1101 * <tr>
1102 * <th align="center">State</th>
1103 * <th align="center">Transition Cause</th>
1104 * <th align="center">New State</th>
1105 * <th align="center">Notes</th>
1106 * </tr>
1107 * </thead>
1108 * <tbody>
1109 * <tr>
1110 * <td align="center">INACTIVE</td>
1111 * <td align="center">Camera device initiates new scan</td>
1112 * <td align="center">PASSIVE_SCAN</td>
1113 * <td align="center">Start AF scan, Lens now moving</td>
1114 * </tr>
1115 * <tr>
1116 * <td align="center">INACTIVE</td>
1117 * <td align="center">AF_TRIGGER</td>
1118 * <td align="center">NOT_FOCUSED_LOCKED</td>
1119 * <td align="center">AF state query, Lens now locked</td>
1120 * </tr>
1121 * <tr>
1122 * <td align="center">PASSIVE_SCAN</td>
1123 * <td align="center">Camera device completes current scan</td>
1124 * <td align="center">PASSIVE_FOCUSED</td>
1125 * <td align="center">End AF scan, Lens now locked</td>
1126 * </tr>
1127 * <tr>
1128 * <td align="center">PASSIVE_SCAN</td>
1129 * <td align="center">Camera device fails current scan</td>
1130 * <td align="center">PASSIVE_UNFOCUSED</td>
1131 * <td align="center">End AF scan, Lens now locked</td>
1132 * </tr>
1133 * <tr>
1134 * <td align="center">PASSIVE_SCAN</td>
1135 * <td align="center">AF_TRIGGER</td>
1136 * <td align="center">FOCUSED_LOCKED</td>
1137 * <td align="center">Eventual trans. once focus good, Lens now locked</td>
1138 * </tr>
1139 * <tr>
1140 * <td align="center">PASSIVE_SCAN</td>
1141 * <td align="center">AF_TRIGGER</td>
1142 * <td align="center">NOT_FOCUSED_LOCKED</td>
1143 * <td align="center">Eventual trans. if cannot focus, Lens now locked</td>
1144 * </tr>
1145 * <tr>
1146 * <td align="center">PASSIVE_SCAN</td>
1147 * <td align="center">AF_CANCEL</td>
1148 * <td align="center">INACTIVE</td>
1149 * <td align="center">Reset lens position, Lens now locked</td>
1150 * </tr>
1151 * <tr>
1152 * <td align="center">PASSIVE_FOCUSED</td>
1153 * <td align="center">Camera device initiates new scan</td>
1154 * <td align="center">PASSIVE_SCAN</td>
1155 * <td align="center">Start AF scan, Lens now moving</td>
1156 * </tr>
1157 * <tr>
1158 * <td align="center">PASSIVE_UNFOCUSED</td>
1159 * <td align="center">Camera device initiates new scan</td>
1160 * <td align="center">PASSIVE_SCAN</td>
1161 * <td align="center">Start AF scan, Lens now moving</td>
1162 * </tr>
1163 * <tr>
1164 * <td align="center">PASSIVE_FOCUSED</td>
1165 * <td align="center">AF_TRIGGER</td>
1166 * <td align="center">FOCUSED_LOCKED</td>
1167 * <td align="center">Immediate trans. Lens now locked</td>
1168 * </tr>
1169 * <tr>
1170 * <td align="center">PASSIVE_UNFOCUSED</td>
1171 * <td align="center">AF_TRIGGER</td>
1172 * <td align="center">NOT_FOCUSED_LOCKED</td>
1173 * <td align="center">Immediate trans. Lens now locked</td>
1174 * </tr>
1175 * <tr>
1176 * <td align="center">FOCUSED_LOCKED</td>
1177 * <td align="center">AF_TRIGGER</td>
1178 * <td align="center">FOCUSED_LOCKED</td>
1179 * <td align="center">No effect</td>
1180 * </tr>
1181 * <tr>
1182 * <td align="center">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 * <tr>
1188 * <td align="center">NOT_FOCUSED_LOCKED</td>
1189 * <td align="center">AF_TRIGGER</td>
1190 * <td align="center">NOT_FOCUSED_LOCKED</td>
1191 * <td align="center">No effect</td>
1192 * </tr>
1193 * <tr>
1194 * <td align="center">NOT_FOCUSED_LOCKED</td>
1195 * <td align="center">AF_CANCEL</td>
1196 * <td align="center">INACTIVE</td>
1197 * <td align="center">Restart AF scan</td>
1198 * </tr>
1199 * </tbody>
1200 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001201 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1202 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1203 * camera device. When a trigger is included in a mode switch request, the trigger
1204 * will be evaluated in the context of the new mode in the request.
1205 * See below table for examples:</p>
1206 * <table>
1207 * <thead>
1208 * <tr>
1209 * <th align="center">State</th>
1210 * <th align="center">Transition Cause</th>
1211 * <th align="center">New State</th>
1212 * <th align="center">Notes</th>
1213 * </tr>
1214 * </thead>
1215 * <tbody>
1216 * <tr>
1217 * <td align="center">any state</td>
1218 * <td align="center">CAF--&gt;AUTO mode switch</td>
1219 * <td align="center">INACTIVE</td>
1220 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1221 * </tr>
1222 * <tr>
1223 * <td align="center">any state</td>
1224 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1225 * <td align="center">trigger-reachable states from INACTIVE</td>
1226 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1227 * </tr>
1228 * <tr>
1229 * <td align="center">any state</td>
1230 * <td align="center">AUTO--&gt;CAF mode switch</td>
1231 * <td align="center">passively reachable states from INACTIVE</td>
1232 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1233 * </tr>
1234 * </tbody>
1235 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001236 *
1237 * @see CaptureRequest#CONTROL_AF_MODE
1238 * @see CaptureRequest#CONTROL_MODE
1239 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001240 * @see #CONTROL_AF_STATE_INACTIVE
1241 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1242 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1243 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1244 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1245 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001246 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001247 */
1248 public static final Key<Integer> CONTROL_AF_STATE =
1249 new Key<Integer>("android.control.afState", int.class);
1250
1251 /**
Zhijun He379af012014-05-06 11:54:54 -07001252 * <p>Whether AWB is currently locked to its
1253 * latest calculated values.</p>
1254 * <p>Note that AWB lock is only meaningful for AUTO
1255 * mode; in other modes, AWB is already fixed to a specific
1256 * setting.</p>
1257 */
1258 public static final Key<Boolean> CONTROL_AWB_LOCK =
1259 new Key<Boolean>("android.control.awbLock", boolean.class);
1260
1261 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001262 * <p>Whether AWB is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001263 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001264 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001265 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
1266 * <p>When set to the ON mode, the camera device's auto white balance
1267 * routine is enabled, overriding the application's selected
1268 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1269 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
1270 * <p>When set to the OFF mode, the camera device's auto white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001271 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001272 * 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 -08001273 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
1274 * <p>When set to any other modes, the camera device's auto white balance
1275 * routine is disabled. The camera device uses each particular illumination
1276 * target for white balance adjustment.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001277 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001278 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001279 * @see CaptureRequest#COLOR_CORRECTION_MODE
1280 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001281 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001282 * @see #CONTROL_AWB_MODE_OFF
1283 * @see #CONTROL_AWB_MODE_AUTO
1284 * @see #CONTROL_AWB_MODE_INCANDESCENT
1285 * @see #CONTROL_AWB_MODE_FLUORESCENT
1286 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1287 * @see #CONTROL_AWB_MODE_DAYLIGHT
1288 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1289 * @see #CONTROL_AWB_MODE_TWILIGHT
1290 * @see #CONTROL_AWB_MODE_SHADE
1291 */
1292 public static final Key<Integer> CONTROL_AWB_MODE =
1293 new Key<Integer>("android.control.awbMode", int.class);
1294
1295 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001296 * <p>List of areas to use for illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001297 * estimation.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001298 * <p>Only used in AUTO mode.</p>
1299 * <p>Each area is a rectangle plus weight: xmin, ymin,
Ruben Brunkf59521d2014-02-03 17:14:33 -08001300 * xmax, ymax, weight. The rectangle is defined to be inclusive of the
Igor Murashkinace5bf02013-12-10 17:36:40 -08001301 * specified coordinates.</p>
1302 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001303 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001304 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1305 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Timothy Knight2629f272013-09-03 17:23:23 -07001306 * bottom-right pixel in the active pixel array. The weight
Igor Murashkinace5bf02013-12-10 17:36:40 -08001307 * should be nonnegative.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001308 * <p>If all regions have 0 weight, then no specific auto-white balance (AWB) area
1309 * needs to be used by the camera device. If the AWB region is
Zhijun He14986152014-05-22 21:17:37 -07001310 * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
1311 * the camera device will ignore the sections outside the region and output the
1312 * used sections in the result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001313 *
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001314 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001315 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001316 */
1317 public static final Key<int[]> CONTROL_AWB_REGIONS =
1318 new Key<int[]>("android.control.awbRegions", int[].class);
1319
1320 /**
Zhijun He379af012014-05-06 11:54:54 -07001321 * <p>Information to the camera device 3A (auto-exposure,
1322 * auto-focus, auto-white balance) routines about the purpose
1323 * of this capture, to help the camera device to decide optimal 3A
1324 * strategy.</p>
1325 * <p>This control (except for MANUAL) is only effective if
1326 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
1327 * <p>ZERO_SHUTTER_LAG must be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1328 * contains ZSL. MANUAL must be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1329 * contains MANUAL_SENSOR.</p>
1330 *
1331 * @see CaptureRequest#CONTROL_MODE
1332 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1333 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1334 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1335 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1336 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1337 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1338 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1339 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1340 */
1341 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1342 new Key<Integer>("android.control.captureIntent", int.class);
1343
1344 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001345 * <p>Current state of AWB algorithm</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001346 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1347 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1348 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1349 * the algorithm states to INACTIVE.</p>
1350 * <p>The camera device can do several state transitions between two results, if it is
1351 * allowed by the state transition table. So INACTIVE may never actually be seen in
1352 * a result.</p>
1353 * <p>The state in the result is the state for this image (in sync with this image): if
1354 * AWB state becomes CONVERGED, then the image data associated with this result should
1355 * be good to use.</p>
1356 * <p>Below are state transition tables for different AWB modes.</p>
1357 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1358 * <table>
1359 * <thead>
1360 * <tr>
1361 * <th align="center">State</th>
1362 * <th align="center">Transition Cause</th>
1363 * <th align="center">New State</th>
1364 * <th align="center">Notes</th>
1365 * </tr>
1366 * </thead>
1367 * <tbody>
1368 * <tr>
1369 * <td align="center">INACTIVE</td>
1370 * <td align="center"></td>
1371 * <td align="center">INACTIVE</td>
1372 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1373 * </tr>
1374 * </tbody>
1375 * </table>
1376 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1377 * <table>
1378 * <thead>
1379 * <tr>
1380 * <th align="center">State</th>
1381 * <th align="center">Transition Cause</th>
1382 * <th align="center">New State</th>
1383 * <th align="center">Notes</th>
1384 * </tr>
1385 * </thead>
1386 * <tbody>
1387 * <tr>
1388 * <td align="center">INACTIVE</td>
1389 * <td align="center">Camera device initiates AWB scan</td>
1390 * <td align="center">SEARCHING</td>
1391 * <td align="center">Values changing</td>
1392 * </tr>
1393 * <tr>
1394 * <td align="center">INACTIVE</td>
1395 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1396 * <td align="center">LOCKED</td>
1397 * <td align="center">Values locked</td>
1398 * </tr>
1399 * <tr>
1400 * <td align="center">SEARCHING</td>
1401 * <td align="center">Camera device finishes AWB scan</td>
1402 * <td align="center">CONVERGED</td>
1403 * <td align="center">Good values, not changing</td>
1404 * </tr>
1405 * <tr>
1406 * <td align="center">SEARCHING</td>
1407 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1408 * <td align="center">LOCKED</td>
1409 * <td align="center">Values locked</td>
1410 * </tr>
1411 * <tr>
1412 * <td align="center">CONVERGED</td>
1413 * <td align="center">Camera device initiates AWB scan</td>
1414 * <td align="center">SEARCHING</td>
1415 * <td align="center">Values changing</td>
1416 * </tr>
1417 * <tr>
1418 * <td align="center">CONVERGED</td>
1419 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1420 * <td align="center">LOCKED</td>
1421 * <td align="center">Values locked</td>
1422 * </tr>
1423 * <tr>
1424 * <td align="center">LOCKED</td>
1425 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1426 * <td align="center">SEARCHING</td>
1427 * <td align="center">Values not good after unlock</td>
1428 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001429 * </tbody>
1430 * </table>
1431 * <p>For the above table, the camera device may skip reporting any state changes that happen
1432 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1433 * can be skipped in that manner is called a transient state.</p>
1434 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1435 * listed in above table, it is also legal for the camera device to skip one or more
1436 * transient states between two results. See below table for examples:</p>
1437 * <table>
1438 * <thead>
1439 * <tr>
1440 * <th align="center">State</th>
1441 * <th align="center">Transition Cause</th>
1442 * <th align="center">New State</th>
1443 * <th align="center">Notes</th>
1444 * </tr>
1445 * </thead>
1446 * <tbody>
1447 * <tr>
1448 * <td align="center">INACTIVE</td>
1449 * <td align="center">Camera device finished AWB scan</td>
1450 * <td align="center">CONVERGED</td>
1451 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1452 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001453 * <tr>
1454 * <td align="center">LOCKED</td>
1455 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1456 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001457 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001458 * </tr>
1459 * </tbody>
1460 * </table>
1461 *
1462 * @see CaptureRequest#CONTROL_AWB_LOCK
1463 * @see CaptureRequest#CONTROL_AWB_MODE
1464 * @see CaptureRequest#CONTROL_MODE
1465 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001466 * @see #CONTROL_AWB_STATE_INACTIVE
1467 * @see #CONTROL_AWB_STATE_SEARCHING
1468 * @see #CONTROL_AWB_STATE_CONVERGED
1469 * @see #CONTROL_AWB_STATE_LOCKED
1470 */
1471 public static final Key<Integer> CONTROL_AWB_STATE =
1472 new Key<Integer>("android.control.awbState", int.class);
1473
1474 /**
Zhijun He379af012014-05-06 11:54:54 -07001475 * <p>A special color effect to apply.</p>
1476 * <p>When this mode is set, a color effect will be applied
1477 * to images produced by the camera device. The interpretation
1478 * and implementation of these color effects is left to the
1479 * implementor of the camera device, and should not be
1480 * depended on to be consistent (or present) across all
1481 * devices.</p>
1482 * <p>A color effect will only be applied if
1483 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p>
1484 *
1485 * @see CaptureRequest#CONTROL_MODE
1486 * @see #CONTROL_EFFECT_MODE_OFF
1487 * @see #CONTROL_EFFECT_MODE_MONO
1488 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1489 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1490 * @see #CONTROL_EFFECT_MODE_SEPIA
1491 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1492 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1493 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1494 * @see #CONTROL_EFFECT_MODE_AQUA
1495 */
1496 public static final Key<Integer> CONTROL_EFFECT_MODE =
1497 new Key<Integer>("android.control.effectMode", int.class);
1498
1499 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001500 * <p>Overall mode of 3A control
Zhijun Hecc28a412014-02-24 15:11:23 -08001501 * routines.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001502 * <p>High-level 3A control. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001503 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001504 * capture parameters itself.</p>
1505 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001506 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001507 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001508 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001509 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001510 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001511 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001512 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1513 * is that this frame will not be used by camera device background 3A statistics
1514 * update, as if this frame is never captured. This mode can be used in the scenario
1515 * where the application doesn't want a 3A manual control capture to affect
1516 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001517 *
1518 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001519 * @see #CONTROL_MODE_OFF
1520 * @see #CONTROL_MODE_AUTO
1521 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001522 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001523 */
1524 public static final Key<Integer> CONTROL_MODE =
1525 new Key<Integer>("android.control.mode", int.class);
1526
1527 /**
Zhijun He379af012014-05-06 11:54:54 -07001528 * <p>A camera mode optimized for conditions typical in a particular
1529 * capture setting.</p>
1530 * <p>This is the mode that that is active when
1531 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1532 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
1533 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p>
1534 * <p>The interpretation and implementation of these scene modes is left
1535 * to the implementor of the camera device. Their behavior will not be
1536 * consistent across all devices, and any given device may only implement
1537 * a subset of these modes.</p>
1538 *
1539 * @see CaptureRequest#CONTROL_AE_MODE
1540 * @see CaptureRequest#CONTROL_AF_MODE
1541 * @see CaptureRequest#CONTROL_AWB_MODE
1542 * @see CaptureRequest#CONTROL_MODE
1543 * @see #CONTROL_SCENE_MODE_DISABLED
1544 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1545 * @see #CONTROL_SCENE_MODE_ACTION
1546 * @see #CONTROL_SCENE_MODE_PORTRAIT
1547 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1548 * @see #CONTROL_SCENE_MODE_NIGHT
1549 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1550 * @see #CONTROL_SCENE_MODE_THEATRE
1551 * @see #CONTROL_SCENE_MODE_BEACH
1552 * @see #CONTROL_SCENE_MODE_SNOW
1553 * @see #CONTROL_SCENE_MODE_SUNSET
1554 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1555 * @see #CONTROL_SCENE_MODE_FIREWORKS
1556 * @see #CONTROL_SCENE_MODE_SPORTS
1557 * @see #CONTROL_SCENE_MODE_PARTY
1558 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1559 * @see #CONTROL_SCENE_MODE_BARCODE
1560 */
1561 public static final Key<Integer> CONTROL_SCENE_MODE =
1562 new Key<Integer>("android.control.sceneMode", int.class);
1563
1564 /**
1565 * <p>Whether video stabilization is
1566 * active</p>
1567 * <p>If enabled, video stabilization can modify the
1568 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream
1569 * stabilized</p>
1570 *
1571 * @see CaptureRequest#SCALER_CROP_REGION
1572 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1573 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1574 */
1575 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1576 new Key<Integer>("android.control.videoStabilizationMode", int.class);
1577
1578 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001579 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001580 * enhancement.</p>
Zhijun He28079362013-12-17 10:35:40 -08001581 * <p>Edge/sharpness/detail enhancement. OFF means no
Zhijun Hecc28a412014-02-24 15:11:23 -08001582 * enhancement will be applied by the camera device.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001583 * <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 -08001584 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001585 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001586 * camera device will use the highest-quality enhancement algorithms,
1587 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08001588 * not slow down capture rate when applying edge enhancement.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001589 *
1590 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001591 * @see #EDGE_MODE_OFF
1592 * @see #EDGE_MODE_FAST
1593 * @see #EDGE_MODE_HIGH_QUALITY
1594 */
1595 public static final Key<Integer> EDGE_MODE =
1596 new Key<Integer>("android.edge.mode", int.class);
1597
1598 /**
Zhijun He66d065a2014-01-16 18:18:50 -08001599 * <p>The desired mode for for the camera device's flash control.</p>
1600 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08001601 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08001602 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
1603 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
1604 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
1605 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
1606 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
1607 * device's auto-exposure routine's result. When used in still capture case, this
1608 * control should be used along with AE precapture metering sequence
1609 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
1610 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
1611 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001612 * <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 -08001613 *
1614 * @see CaptureRequest#CONTROL_AE_MODE
1615 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1616 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08001617 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001618 * @see #FLASH_MODE_OFF
1619 * @see #FLASH_MODE_SINGLE
1620 * @see #FLASH_MODE_TORCH
1621 */
1622 public static final Key<Integer> FLASH_MODE =
1623 new Key<Integer>("android.flash.mode", int.class);
1624
1625 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001626 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08001627 * unit.</p>
1628 * <p>When the camera device doesn't have flash unit
1629 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
1630 * Other states indicate the current flash status.</p>
1631 *
1632 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001633 * @see #FLASH_STATE_UNAVAILABLE
1634 * @see #FLASH_STATE_CHARGING
1635 * @see #FLASH_STATE_READY
1636 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07001637 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001638 */
1639 public static final Key<Integer> FLASH_STATE =
1640 new Key<Integer>("android.flash.state", int.class);
1641
1642 /**
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001643 * <p>Set operational mode for hot pixel correction.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001644 * <p>Valid modes for this camera device are listed in
1645 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001646 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
1647 * that do not accurately encode the incoming light (i.e. pixels that
1648 * are stuck at an arbitrary value).</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08001649 *
1650 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08001651 * @see #HOT_PIXEL_MODE_OFF
1652 * @see #HOT_PIXEL_MODE_FAST
1653 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
1654 */
1655 public static final Key<Integer> HOT_PIXEL_MODE =
1656 new Key<Integer>("android.hotPixel.mode", int.class);
1657
1658 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001659 * <p>GPS coordinates to include in output JPEG
1660 * EXIF</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001661 */
1662 public static final Key<double[]> JPEG_GPS_COORDINATES =
1663 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
1664
1665 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001666 * <p>32 characters describing GPS algorithm to
1667 * include in EXIF</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001668 */
1669 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
1670 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
1671
1672 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001673 * <p>Time GPS fix was made to include in
1674 * EXIF</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001675 */
1676 public static final Key<Long> JPEG_GPS_TIMESTAMP =
1677 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
1678
1679 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001680 * <p>Orientation of JPEG image to
1681 * write</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001682 */
1683 public static final Key<Integer> JPEG_ORIENTATION =
1684 new Key<Integer>("android.jpeg.orientation", int.class);
1685
1686 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001687 * <p>Compression quality of the final JPEG
1688 * image</p>
1689 * <p>85-95 is typical usage range</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001690 */
1691 public static final Key<Byte> JPEG_QUALITY =
1692 new Key<Byte>("android.jpeg.quality", byte.class);
1693
1694 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001695 * <p>Compression quality of JPEG
1696 * thumbnail</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001697 */
1698 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
1699 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
1700
1701 /**
Zhijun He5a9ff372013-12-26 11:49:09 -08001702 * <p>Resolution of embedded JPEG thumbnail</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001703 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
1704 * but the captured JPEG will still be a valid image.</p>
Zhijun He5a9ff372013-12-26 11:49:09 -08001705 * <p>When a jpeg image capture is issued, the thumbnail size selected should have
1706 * the same aspect ratio as the jpeg image.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001707 */
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07001708 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
1709 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001710
1711 /**
Zhijun Hefb46c642014-01-14 17:57:23 -08001712 * <p>The ratio of lens focal length to the effective
1713 * aperture diameter.</p>
1714 * <p>This will only be supported on the camera devices that
1715 * have variable aperture lens. The aperture value can only be
1716 * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p>
1717 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
1718 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001719 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08001720 * to achieve manual exposure control.</p>
1721 * <p>The requested aperture value may take several frames to reach the
1722 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08001723 * aperture size in capture result metadata while the aperture is changing.
1724 * 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 -08001725 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1726 * the ON modes, this will be overridden by the camera device
1727 * auto-exposure algorithm, the overridden values are then provided
1728 * back to the user in the corresponding result.</p>
1729 *
Zhijun He399f05d2014-01-15 11:31:30 -08001730 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001731 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001732 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001733 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001734 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001735 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001736 */
1737 public static final Key<Float> LENS_APERTURE =
1738 new Key<Float>("android.lens.aperture", float.class);
1739
1740 /**
Ruben Brunk855bae42014-01-17 10:30:32 -08001741 * <p>State of lens neutral density filter(s).</p>
1742 * <p>This will not be supported on most camera devices. On devices
1743 * where this is supported, this may only be set to one of the
1744 * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p>
1745 * <p>Lens filters are typically used to lower the amount of light the
1746 * sensor is exposed to (measured in steps of EV). As used here, an EV
1747 * step is the standard logarithmic representation, which are
1748 * non-negative, and inversely proportional to the amount of light
1749 * hitting the sensor. For example, setting this to 0 would result
1750 * in no reduction of the incoming light, and setting this to 2 would
1751 * mean that the filter is set to reduce incoming light by two stops
1752 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08001753 * <p>It may take several frames before the lens filter density changes
1754 * to the requested value. While the filter density is still changing,
1755 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08001756 *
1757 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08001758 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001759 */
1760 public static final Key<Float> LENS_FILTER_DENSITY =
1761 new Key<Float>("android.lens.filterDensity", float.class);
1762
1763 /**
Ruben Brunka20f4c22014-01-17 15:21:13 -08001764 * <p>The current lens focal length; used for optical zoom.</p>
1765 * <p>This setting controls the physical focal length of the camera
1766 * device's lens. Changing the focal length changes the field of
1767 * view of the camera device, and is usually used for optical zoom.</p>
1768 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1769 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08001770 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08001771 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
1772 * be set to MOVING.</p>
1773 * <p>This is expected not to be supported on most devices.</p>
1774 *
1775 * @see CaptureRequest#LENS_APERTURE
1776 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1777 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001778 */
1779 public static final Key<Float> LENS_FOCAL_LENGTH =
1780 new Key<Float>("android.lens.focalLength", float.class);
1781
1782 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001783 * <p>Distance to plane of sharpest focus,
1784 * measured from frontmost surface of the lens</p>
1785 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001786 */
1787 public static final Key<Float> LENS_FOCUS_DISTANCE =
1788 new Key<Float>("android.lens.focusDistance", float.class);
1789
1790 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001791 * <p>The range of scene distances that are in
1792 * sharp focus (depth of field)</p>
1793 * <p>If variable focus not supported, can still report
1794 * fixed depth of field range</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001795 */
Zhijun Hec59b0782013-09-26 10:39:36 -07001796 public static final Key<float[]> LENS_FOCUS_RANGE =
1797 new Key<float[]>("android.lens.focusRange", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001798
1799 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08001800 * <p>Sets whether the camera device uses optical image stabilization (OIS)
1801 * when capturing images.</p>
1802 * <p>OIS is used to compensate for motion blur due to small movements of
1803 * the camera during capture. Unlike digital image stabilization, OIS makes
1804 * use of mechanical elements to stabilize the camera sensor, and thus
1805 * allows for longer exposure times before camera shake becomes
1806 * apparent.</p>
1807 * <p>This is not expected to be supported on most devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001808 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
1809 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
1810 */
1811 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
1812 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
1813
1814 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08001815 * <p>Current lens status.</p>
1816 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1817 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
1818 * they may take several frames to reach the requested values. This state indicates
1819 * the current status of the lens parameters.</p>
1820 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
1821 * either because the parameters are all fixed, or because the lens has had enough
1822 * time to reach the most recently-requested values.
1823 * If all these lens parameters are not changable for a camera device, as listed below:</p>
1824 * <ul>
1825 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
1826 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
1827 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
1828 * which means the optical zoom is not supported.</li>
1829 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
1830 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
1831 * </ul>
1832 * <p>Then this state will always be STATIONARY.</p>
1833 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
1834 * is changing.</p>
1835 *
1836 * @see CaptureRequest#LENS_APERTURE
1837 * @see CaptureRequest#LENS_FILTER_DENSITY
1838 * @see CaptureRequest#LENS_FOCAL_LENGTH
1839 * @see CaptureRequest#LENS_FOCUS_DISTANCE
1840 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
1841 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
1842 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
1843 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001844 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07001845 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001846 */
1847 public static final Key<Integer> LENS_STATE =
1848 new Key<Integer>("android.lens.state", int.class);
1849
1850 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001851 * <p>Mode of operation for the noise reduction
1852 * algorithm</p>
Zhijun He28079362013-12-17 10:35:40 -08001853 * <p>Noise filtering control. OFF means no noise reduction
Zhijun Hecc28a412014-02-24 15:11:23 -08001854 * will be applied by the camera device.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001855 * <p>This must be set to a valid mode in
1856 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001857 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
1858 * will be applied. HIGH_QUALITY mode indicates that the camera device
1859 * will use the highest-quality noise filtering algorithms,
1860 * even if it slows down capture rate. FAST means the camera device should not
Zhijun He28079362013-12-17 10:35:40 -08001861 * slow down capture rate when applying noise filtering.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001862 *
1863 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001864 * @see #NOISE_REDUCTION_MODE_OFF
1865 * @see #NOISE_REDUCTION_MODE_FAST
1866 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
1867 */
1868 public static final Key<Integer> NOISE_REDUCTION_MODE =
1869 new Key<Integer>("android.noiseReduction.mode", int.class);
1870
1871 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001872 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001873 * final one for the capture, or only a partial that contains a
1874 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08001875 * values.</p>
1876 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001877 * single capture may not overlap, except for this entry. The
1878 * FINAL buffers must retain FIFO ordering relative to the
1879 * requests that generate them, so the FINAL buffer for frame 3 must
1880 * always be sent to the framework after the FINAL buffer for frame 2, and
1881 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
1882 * in any order relative to other frames, but all PARTIAL buffers for a given
1883 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08001884 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08001885 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07001886 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001887 * @hide
1888 */
Igor Murashkin9c595172014-05-12 13:56:20 -07001889 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08001890 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
1891 new Key<Boolean>("android.quirks.partialResult", boolean.class);
1892
1893 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001894 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07001895 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08001896 * frameCount value).</p>
1897 * <p>Reset on release()</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001898 */
1899 public static final Key<Integer> REQUEST_FRAME_COUNT =
1900 new Key<Integer>("android.request.frameCount", int.class);
1901
1902 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001903 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001904 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08001905 * frame</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001906 * @hide
1907 */
1908 public static final Key<Integer> REQUEST_ID =
1909 new Key<Integer>("android.request.id", int.class);
1910
1911 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08001912 * <p>Specifies the number of pipeline stages the frame went
1913 * through from when it was exposed to when the final completed result
1914 * was available to the framework.</p>
1915 * <p>Depending on what settings are used in the request, and
1916 * what streams are configured, the data may undergo less processing,
1917 * and some pipeline stages skipped.</p>
1918 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
1919 *
1920 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
1921 */
1922 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
1923 new Key<Byte>("android.request.pipelineDepth", byte.class);
1924
1925 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001926 * <p>(x, y, width, height).</p>
1927 * <p>A rectangle with the top-level corner of (x,y) and size
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001928 * (width, height). The region of the sensor that is used for
1929 * output. Each stream must use this rectangle to produce its
1930 * output, cropping to a smaller region if necessary to
Igor Murashkinace5bf02013-12-10 17:36:40 -08001931 * maintain the stream's aspect ratio.</p>
1932 * <p>HAL2.x uses only (x, y, width)</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07001933 * <p>The crop region is applied after the RAW to other color space (e.g. YUV)
1934 * conversion. Since raw streams (e.g. RAW16) don't have the conversion stage,
1935 * it is not croppable. The crop region will be ignored by raw streams.</p>
1936 * <p>For non-raw streams, any additional per-stream cropping will
1937 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001938 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001939 * ratio, then 4:3 streams should use the exact crop
1940 * region. 16:9 streams should further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08001941 * (letterbox).</p>
1942 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001943 * outputs should crop horizontally (pillarbox), and 16:9
1944 * streams should match exactly. These additional crops must
Igor Murashkinace5bf02013-12-10 17:36:40 -08001945 * be centered within the crop region.</p>
1946 * <p>The output streams must maintain square pixels at all
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001947 * times, no matter what the relative aspect ratios of the
1948 * crop region and the stream are. Negative values for
1949 * corner are allowed for raw output if full pixel array is
1950 * larger than active pixel array. Width and height may be
1951 * rounded to nearest larger supportable width, especially
1952 * for raw output, where only a few fixed scales may be
1953 * possible. The width and height of the crop region cannot
1954 * be set to be smaller than floor( activeArraySize.width /
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001955 * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} ) and floor(
1956 * activeArraySize.height /
1957 * {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom}), respectively.</p>
1958 *
1959 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001960 */
1961 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
1962 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
1963
1964 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001965 * <p>Duration each pixel is exposed to
1966 * light.</p>
1967 * <p>If the sensor can't expose this exact duration, it should shorten the
1968 * duration exposed to the nearest possible value (rather than expose longer).</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001969 */
1970 public static final Key<Long> SENSOR_EXPOSURE_TIME =
1971 new Key<Long>("android.sensor.exposureTime", long.class);
1972
1973 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001974 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08001975 * start of next frame exposure.</p>
1976 * <p>The maximum frame rate that can be supported by a camera subsystem is
1977 * a function of many factors:</p>
1978 * <ul>
1979 * <li>Requested resolutions of output image streams</li>
1980 * <li>Availability of binning / skipping modes on the imager</li>
1981 * <li>The bandwidth of the imager interface</li>
1982 * <li>The bandwidth of the various ISP processing blocks</li>
1983 * </ul>
1984 * <p>Since these factors can vary greatly between different ISPs and
1985 * sensors, the camera abstraction tries to represent the bandwidth
1986 * restrictions with as simple a model as possible.</p>
1987 * <p>The model presented has the following characteristics:</p>
1988 * <ul>
1989 * <li>The image sensor is always configured to output the smallest
1990 * resolution possible given the application's requested output stream
1991 * sizes. The smallest resolution is defined as being at least as large
1992 * as the largest requested output stream size; the camera pipeline must
1993 * never digitally upsample sensor data when the crop region covers the
1994 * whole sensor. In general, this means that if only small output stream
1995 * resolutions are configured, the sensor can provide a higher frame
1996 * rate.</li>
1997 * <li>Since any request may use any or all the currently configured
1998 * output streams, the sensor and ISP must be configured to support
1999 * scaling a single capture to all the streams at the same time. This
2000 * means the camera pipeline must be ready to produce the largest
2001 * requested output size without any delay. Therefore, the overall
2002 * frame rate of a given configured stream set is governed only by the
2003 * largest requested stream resolution.</li>
2004 * <li>Using more than one output stream in a request does not affect the
2005 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002006 * <li>Certain format-streams may need to do additional background processing
2007 * before data is consumed/produced by that stream. These processors
2008 * can run concurrently to the rest of the camera pipeline, but
2009 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002010 * </ul>
2011 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07002012 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2013 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002014 * These are used to determine the maximum frame rate / minimum frame
2015 * duration that is possible for a given stream configuration.</p>
2016 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002017 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002018 * device:</p>
2019 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002020 * <li>Let the set of currently configured input/output streams
2021 * be called <code>S</code>.</li>
2022 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002023 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2024 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002025 * its respective size/format). Let this set of frame durations be called
2026 * <code>F</code>.</li>
2027 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2028 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2029 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002030 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002031 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002032 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2033 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002034 * <code>F</code> determines the steady state frame rate that the application will
2035 * get if it uses <code>R</code> as a repeating request. Let this special kind
2036 * of request be called <code>Rsimple</code>.</p>
2037 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2038 * by a single capture of a new request <code>Rstall</code> (which has at least
2039 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2040 * same minimum frame duration this will not cause a frame rate loss
2041 * if all buffers from the previous <code>Rstall</code> have already been
2042 * delivered.</p>
2043 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002044 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002045 *
Igor Murashkin9c595172014-05-12 13:56:20 -07002046 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002047 */
2048 public static final Key<Long> SENSOR_FRAME_DURATION =
2049 new Key<Long>("android.sensor.frameDuration", long.class);
2050
2051 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002052 * <p>Gain applied to image data. Must be
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002053 * implemented through analog gain only if set to values
Igor Murashkinace5bf02013-12-10 17:36:40 -08002054 * below 'maximum analog sensitivity'.</p>
2055 * <p>If the sensor can't apply this exact gain, it should lessen the
2056 * gain to the nearest possible value (rather than gain more).</p>
2057 * <p>ISO 12232:2006 REI method</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002058 */
2059 public static final Key<Integer> SENSOR_SENSITIVITY =
2060 new Key<Integer>("android.sensor.sensitivity", int.class);
2061
2062 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002063 * <p>Time at start of exposure of first
2064 * row</p>
2065 * <p>Monotonic, should be synced to other timestamps in
2066 * system</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002067 */
2068 public static final Key<Long> SENSOR_TIMESTAMP =
2069 new Key<Long>("android.sensor.timestamp", long.class);
2070
2071 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002072 * <p>The estimated camera neutral color in the native sensor colorspace at
2073 * the time of capture.</p>
2074 * <p>This value gives the neutral color point encoded as an RGB value in the
2075 * native sensor color space. The neutral color point indicates the
2076 * currently estimated white point of the scene illumination. It can be
2077 * used to interpolate between the provided color transforms when
2078 * processing raw sensor data.</p>
2079 * <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 -08002080 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2081 */
2082 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2083 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2084
2085 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08002086 * <p>The worst-case divergence between Bayer green channels.</p>
2087 * <p>This value is an estimate of the worst case split between the
2088 * Bayer green channels in the red and blue rows in the sensor color
2089 * filter array.</p>
2090 * <p>The green split is calculated as follows:</p>
2091 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07002092 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2093 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2094 * mosaic channels (R, Gr, Gb, B). The location and size of the window
2095 * chosen is implementation defined, and should be chosen to provide a
2096 * green split estimate that is both representative of the entire image
2097 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002098 * <li>The arithmetic mean of the green channels from the red
2099 * rows (mean_Gr) within W is computed.</li>
2100 * <li>The arithmetic mean of the green channels from the blue
2101 * rows (mean_Gb) within W is computed.</li>
2102 * <li>The maximum ratio R of the two means is computed as follows:
2103 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2104 * </ol>
2105 * <p>The ratio R is the green split divergence reported for this property,
2106 * which represents how much the green channels differ in the mosaic
2107 * pattern. This value is typically used to determine the treatment of
2108 * the green mosaic channels when demosaicing.</p>
2109 * <p>The green split value can be roughly interpreted as follows:</p>
2110 * <ul>
2111 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2112 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2113 * correction to avoid demosaic errors (3-20% divergence).</li>
2114 * <li>R &gt; 1.20 will require strong software correction to produce
2115 * a usuable image (&gt;20% divergence).</li>
2116 * </ul>
2117 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2118 */
2119 public static final Key<Float> SENSOR_GREEN_SPLIT =
2120 new Key<Float>("android.sensor.greenSplit", float.class);
2121
2122 /**
Zhijun He379af012014-05-06 11:54:54 -07002123 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2124 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2125 * <p>Each color channel is treated as an unsigned 32-bit integer.
2126 * The camera device then uses the most significant X bits
2127 * that correspond to how many bits are in its Bayer raw sensor
2128 * output.</p>
2129 * <p>For example, a sensor with RAW10 Bayer output would use the
2130 * 10 most significant bits from each color channel.</p>
2131 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2132 *
2133 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2134 */
2135 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2136 new Key<int[]>("android.sensor.testPatternData", int[].class);
2137
2138 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002139 * <p>When enabled, the sensor sends a test pattern instead of
2140 * doing a real exposure from the camera.</p>
2141 * <p>When a test pattern is enabled, all manual sensor controls specified
2142 * by android.sensor.* should be ignored. All other controls should
2143 * work as normal.</p>
2144 * <p>For example, if manual flash is enabled, flash firing should still
2145 * occur (and that the test pattern remain unmodified, since the flash
2146 * would not actually affect it).</p>
2147 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2148 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2149 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2150 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2151 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2152 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2153 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2154 */
2155 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2156 new Key<Integer>("android.sensor.testPatternMode", int.class);
2157
2158 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002159 * <p>Quality of lens shading correction applied
2160 * to the image data.</p>
2161 * <p>When set to OFF mode, no lens shading correction will be applied by the
2162 * camera device, and an identity lens shading map data will be provided
2163 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
2164 * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>,
2165 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map
2166 * shown below:</p>
2167 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2168 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2169 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2170 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2171 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2172 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
2173 * </code></pre>
2174 * <p>When set to other modes, lens shading correction will be applied by the
2175 * camera device. Applications can request lens shading map data by setting
2176 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide
2177 * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified
Zhijun Hefa7c7552014-05-22 16:36:02 -07002178 * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}; the returned shading map data will be the one
2179 * applied by the camera device for this capture request.</p>
2180 * <p>The shading map data may depend on the AE and AWB statistics, therefore the reliability
2181 * of the map data may be affected by the AE and AWB algorithms. When AE and AWB are in
2182 * 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),
2183 * to get best results, it is recommended that the applications wait for the AE and AWB to
2184 * be converged before using the returned shading map data.</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002185 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002186 * @see CaptureRequest#CONTROL_AE_MODE
2187 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun Heba93fe62014-01-17 16:43:05 -08002188 * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
2189 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
2190 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2191 * @see #SHADING_MODE_OFF
2192 * @see #SHADING_MODE_FAST
2193 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08002194 */
2195 public static final Key<Integer> SHADING_MODE =
2196 new Key<Integer>("android.shading.mode", int.class);
2197
2198 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002199 * <p>State of the face detector
2200 * unit</p>
2201 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002202 * should output just the basic fields or the full set of
2203 * fields. Value must be one of the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002204 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p>
2205 *
2206 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002207 * @see #STATISTICS_FACE_DETECT_MODE_OFF
2208 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
2209 * @see #STATISTICS_FACE_DETECT_MODE_FULL
2210 */
2211 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
2212 new Key<Integer>("android.statistics.faceDetectMode", int.class);
2213
2214 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002215 * <p>List of unique IDs for detected
2216 * faces</p>
2217 * <p>Only available if faceDetectMode == FULL</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -08002218 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002219 */
2220 public static final Key<int[]> STATISTICS_FACE_IDS =
2221 new Key<int[]>("android.statistics.faceIds", int[].class);
2222
2223 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002224 * <p>List of landmarks for detected
2225 * faces</p>
2226 * <p>Only available if faceDetectMode == FULL</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -08002227 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002228 */
2229 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
2230 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
2231
2232 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002233 * <p>List of the bounding rectangles for detected
2234 * faces</p>
2235 * <p>Only available if faceDetectMode != OFF</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -08002236 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002237 */
2238 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
2239 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
2240
2241 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002242 * <p>List of the face confidence scores for
2243 * detected faces</p>
2244 * <p>Only available if faceDetectMode != OFF. The value should be
2245 * meaningful (for example, setting 100 at all times is illegal).</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -08002246 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002247 */
2248 public static final Key<byte[]> STATISTICS_FACE_SCORES =
2249 new Key<byte[]>("android.statistics.faceScores", byte[].class);
2250
2251 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002252 * <p>List of the faces detected through camera face detection
2253 * in this result.</p>
2254 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
2255 *
2256 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
2257 */
2258 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
2259 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
2260
2261 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002262 * <p>The shading map is a low-resolution floating-point map
2263 * that lists the coefficients used to correct for vignetting, for each
2264 * Bayer color channel.</p>
2265 * <p>The least shaded section of the image should have a gain factor
2266 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002267 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08002268 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002269 * <p>The shading map is for the entire active pixel array, and is not
2270 * affected by the crop region specified in the request. Each shading map
2271 * entry is the value of the shading compensation map over a specific
2272 * pixel on the sensor. Specifically, with a (N x M) resolution shading
2273 * map, and an active pixel array size (W x H), shading map entry
2274 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
2275 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
2276 * The map is assumed to be bilinearly interpolated between the sample points.</p>
2277 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
2278 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
2279 * The shading map is stored in a fully interleaved format, and its size
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002280 * 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 -08002281 * <p>The shading map should have on the order of 30-40 rows and columns,
2282 * and must be smaller than 64x64.</p>
2283 * <p>As an example, given a very small map defined as:</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002284 * <pre><code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]
2285 * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002286 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002287 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
2288 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
2289 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
2290 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
2291 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08002292 * </code></pre>
2293 * <p>The low-resolution scaling map images for each channel are
2294 * (displayed using nearest-neighbor interpolation):</p>
2295 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
2296 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
2297 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
2298 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
2299 * <p>As a visualization only, inverting the full-color map to recover an
2300 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
2301 * <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 -08002302 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08002303 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002304 * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002305 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002306 */
2307 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
2308 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
2309
2310 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002311 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08002312 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002313 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002314 * since statistics processing on data from a new frame
2315 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08002316 * applied to that frame.</p>
2317 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002318 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002319 * <p>This value should always be calculated by the AWB block,
2320 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002321 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002322 *
2323 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07002324 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002325 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002326 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002327 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002328 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
2329 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
2330
2331 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002332 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08002333 * calculated by the camera device's statistics units for the current
2334 * output frame.</p>
2335 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002336 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08002337 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002338 * are the best fit for the current output frame. This may
2339 * be different than the transform used for this frame, since
2340 * statistics processing on data from a new frame typically
2341 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002342 * that frame.</p>
2343 * <p>These estimates must be provided for all frames, even if
2344 * capture settings and color transforms are set by the application.</p>
2345 * <p>This value should always be calculated by the AWB block,
2346 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002347 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002348 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08002349 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002350 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002351 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002352 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
2353 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
2354
2355 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08002356 * <p>The camera device estimated scene illumination lighting
2357 * frequency.</p>
2358 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
2359 * that depends on the local utility power standards. This flicker must be
2360 * accounted for by auto-exposure routines to avoid artifacts in captured images.
2361 * The camera device uses this entry to tell the application what the scene
2362 * illuminant frequency is.</p>
2363 * <p>When manual exposure control is enabled
2364 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == OFF</code>),
2365 * the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't do the antibanding, and the
2366 * application can ensure it selects exposure times that do not cause banding
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002367 * issues by looking into this metadata field. See {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}
Zhijun He208fb6c2014-02-03 13:09:06 -08002368 * for more details.</p>
2369 * <p>Report NONE if there doesn't appear to be flickering illumination.</p>
2370 *
2371 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
2372 * @see CaptureRequest#CONTROL_AE_MODE
2373 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002374 * @see #STATISTICS_SCENE_FLICKER_NONE
2375 * @see #STATISTICS_SCENE_FLICKER_50HZ
2376 * @see #STATISTICS_SCENE_FLICKER_60HZ
2377 */
2378 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
2379 new Key<Integer>("android.statistics.sceneFlicker", int.class);
2380
2381 /**
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002382 * <p>Operating mode for hotpixel map generation.</p>
2383 * <p>If set to ON, a hotpixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
2384 * If set to OFF, no hotpixel map should be returned.</p>
2385 * <p>This must be set to a valid mode from {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}.</p>
2386 *
2387 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
2388 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
2389 */
2390 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
2391 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
2392
2393 /**
2394 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
2395 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
2396 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
2397 * bottom-right of the pixel array, respectively. The width and
2398 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
2399 * This may include hot pixels that lie outside of the active array
2400 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2401 *
2402 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2403 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2404 */
2405 public static final Key<int[]> STATISTICS_HOT_PIXEL_MAP =
2406 new Key<int[]>("android.statistics.hotPixelMap", int[].class);
2407
2408 /**
Zhijun He379af012014-05-06 11:54:54 -07002409 * <p>Whether the camera device will output the lens
2410 * shading map in output result metadata.</p>
2411 * <p>When set to ON,
2412 * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} must be provided in
2413 * the output result metadata.</p>
2414 *
2415 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
2416 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2417 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2418 */
2419 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2420 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2421
2422 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002423 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08002424 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2425 * CONTRAST_CURVE.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002426 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
2427 *
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002428 * @see CaptureRequest#TONEMAP_CURVE_RED
Zhijun He5f2a47f2014-01-16 15:44:41 -08002429 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002430 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002431 public static final Key<float[]> TONEMAP_CURVE_BLUE =
2432 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002433
2434 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002435 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08002436 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2437 * CONTRAST_CURVE.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002438 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
2439 *
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002440 * @see CaptureRequest#TONEMAP_CURVE_RED
Zhijun He5f2a47f2014-01-16 15:44:41 -08002441 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002442 */
Zhijun He3ffd7052013-08-19 15:45:08 -07002443 public static final Key<float[]> TONEMAP_CURVE_GREEN =
2444 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002445
2446 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002447 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08002448 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2449 * CONTRAST_CURVE.</p>
2450 * <p>Each channel's curve is defined by an array of control points:</p>
2451 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} =
2452 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08002453 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Igor Murashkine0060932014-01-17 17:24:11 -08002454 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
2455 * guaranteed that input values 0.0 and 1.0 are included in the list to
2456 * define a complete mapping. For input values between control points,
2457 * the camera device must linearly interpolate between the control
2458 * points.</p>
2459 * <p>Each curve can have an independent number of points, and the number
2460 * of points can be less than max (that is, the request doesn't have to
2461 * always provide a curve with number of points equivalent to
2462 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2463 * <p>A few examples, and their corresponding graphical mappings; these
2464 * only specify the red channel and the precision is limited to 4
2465 * digits, for conciseness.</p>
2466 * <p>Linear mapping:</p>
2467 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 0, 1.0, 1.0 ]
2468 * </code></pre>
2469 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2470 * <p>Invert mapping:</p>
2471 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 1.0, 1.0, 0 ]
2472 * </code></pre>
2473 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2474 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
2475 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [
2476 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2477 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2478 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2479 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
2480 * </code></pre>
2481 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2482 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
2483 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [
2484 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2485 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2486 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2487 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
2488 * </code></pre>
2489 * <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 -08002490 *
Igor Murashkine0060932014-01-17 17:24:11 -08002491 * @see CaptureRequest#TONEMAP_CURVE_RED
2492 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002493 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002494 */
2495 public static final Key<float[]> TONEMAP_CURVE_RED =
2496 new Key<float[]>("android.tonemap.curveRed", float[].class);
2497
2498 /**
Igor Murashkine0060932014-01-17 17:24:11 -08002499 * <p>High-level global contrast/gamma/tonemapping control.</p>
2500 * <p>When switching to an application-defined contrast curve by setting
2501 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
2502 * per-channel with a set of <code>(in, out)</code> points that specify the
2503 * mapping from input high-bit-depth pixel value to the output
2504 * low-bit-depth value. Since the actual pixel ranges of both input
2505 * and output may change depending on the camera pipeline, the values
2506 * are specified by normalized floating-point numbers.</p>
2507 * <p>More-complex color mapping operations such as 3D color look-up
2508 * tables, selective chroma enhancement, or other non-linear color
2509 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2510 * CONTRAST_CURVE.</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002511 * <p>This must be set to a valid mode in
2512 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}.</p>
Igor Murashkine0060932014-01-17 17:24:11 -08002513 * <p>When using either FAST or HIGH_QUALITY, the camera device will
2514 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed},
2515 * {@link CaptureRequest#TONEMAP_CURVE_GREEN android.tonemap.curveGreen}, and {@link CaptureRequest#TONEMAP_CURVE_BLUE android.tonemap.curveBlue}.
2516 * These values are always available, and as close as possible to the
2517 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07002518 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08002519 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
2520 * roughly the same.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002521 *
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002522 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Igor Murashkine0060932014-01-17 17:24:11 -08002523 * @see CaptureRequest#TONEMAP_CURVE_BLUE
2524 * @see CaptureRequest#TONEMAP_CURVE_GREEN
2525 * @see CaptureRequest#TONEMAP_CURVE_RED
2526 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002527 * @see #TONEMAP_MODE_CONTRAST_CURVE
2528 * @see #TONEMAP_MODE_FAST
2529 * @see #TONEMAP_MODE_HIGH_QUALITY
2530 */
2531 public static final Key<Integer> TONEMAP_MODE =
2532 new Key<Integer>("android.tonemap.mode", int.class);
2533
2534 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002535 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002536 * that the camera is powered on and may be streaming images back to the
2537 * Application Processor. In certain rare circumstances, the OS may
2538 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08002539 * any untrusted applications.</p>
2540 * <p>In particular, the LED <em>must</em> always be on when the data could be
2541 * transmitted off the device. The LED <em>should</em> always be on whenever
2542 * data is stored locally on the device.</p>
2543 * <p>The LED <em>may</em> be off if a trusted application is using the data that
2544 * doesn't violate the above rules.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002545 * @hide
2546 */
2547 public static final Key<Boolean> LED_TRANSMIT =
2548 new Key<Boolean>("android.led.transmit", boolean.class);
2549
2550 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002551 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08002552 * to its current values, or is free to vary.</p>
2553 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002554 * 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 -08002555 * a change in other capture settings forced the camera device to
2556 * perform a black level reset.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002557 *
2558 * @see CaptureRequest#BLACK_LEVEL_LOCK
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002559 */
2560 public static final Key<Boolean> BLACK_LEVEL_LOCK =
2561 new Key<Boolean>("android.blackLevel.lock", boolean.class);
2562
Igor Murashkin3865a842014-01-17 18:18:39 -08002563 /**
2564 * <p>The frame number corresponding to the last request
2565 * with which the output result (metadata + buffers) has been fully
2566 * synchronized.</p>
2567 * <p>When a request is submitted to the camera device, there is usually a
2568 * delay of several frames before the controls get applied. A camera
2569 * device may either choose to account for this delay by implementing a
2570 * pipeline and carefully submit well-timed atomic control updates, or
2571 * it may start streaming control changes that span over several frame
2572 * boundaries.</p>
2573 * <p>In the latter case, whenever a request's settings change relative to
2574 * the previous submitted request, the full set of changes may take
2575 * multiple frame durations to fully take effect. Some settings may
2576 * take effect sooner (in less frame durations) than others.</p>
2577 * <p>While a set of control changes are being propagated, this value
2578 * will be CONVERGING.</p>
2579 * <p>Once it is fully known that a set of control changes have been
2580 * finished propagating, and the resulting updated control settings
2581 * have been read back by the camera device, this value will be set
2582 * to a non-negative frame number (corresponding to the request to
2583 * which the results have synchronized to).</p>
2584 * <p>Older camera device implementations may not have a way to detect
2585 * when all camera controls have been applied, and will always set this
2586 * value to UNKNOWN.</p>
2587 * <p>FULL capability devices will always have this value set to the
2588 * frame number of the request corresponding to this result.</p>
2589 * <p><em>Further details</em>:</p>
2590 * <ul>
2591 * <li>Whenever a request differs from the last request, any future
2592 * results not yet returned may have this value set to CONVERGING (this
2593 * could include any in-progress captures not yet returned by the camera
2594 * device, for more details see pipeline considerations below).</li>
2595 * <li>Submitting a series of multiple requests that differ from the
2596 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
2597 * moves the new synchronization frame to the last non-repeating
2598 * request (using the smallest frame number from the contiguous list of
2599 * repeating requests).</li>
2600 * <li>Submitting the same request repeatedly will not change this value
2601 * to CONVERGING, if it was already a non-negative value.</li>
2602 * <li>When this value changes to non-negative, that means that all of the
2603 * metadata controls from the request have been applied, all of the
2604 * metadata controls from the camera device have been read to the
2605 * updated values (into the result), and all of the graphics buffers
2606 * corresponding to this result are also synchronized to the request.</li>
2607 * </ul>
2608 * <p><em>Pipeline considerations</em>:</p>
2609 * <p>Submitting a request with updated controls relative to the previously
2610 * submitted requests may also invalidate the synchronization state
2611 * of all the results corresponding to currently in-flight requests.</p>
2612 * <p>In other words, results for this current request and up to
2613 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
2614 * android.sync.frameNumber change to CONVERGING.</p>
2615 *
2616 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2617 * @see #SYNC_FRAME_NUMBER_CONVERGING
2618 * @see #SYNC_FRAME_NUMBER_UNKNOWN
2619 * @hide
2620 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07002621 public static final Key<Long> SYNC_FRAME_NUMBER =
2622 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08002623
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002624 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2625 * End generated code
2626 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08002627}