Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 1 | /* |
| 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 Talvala | 2f1a2e4 | 2013-07-25 17:12:05 -0700 | [diff] [blame] | 17 | package android.hardware.camera2; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 18 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 19 | import android.hardware.camera2.impl.CameraMetadataNative; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 20 | |
| 21 | /** |
| 22 | * <p>The results of a single image capture from the image sensor.</p> |
| 23 | * |
| 24 | * <p>Contains the final configuration for the capture hardware (sensor, lens, |
| 25 | * flash), the processing pipeline, the control algorithms, and the output |
| 26 | * buffers.</p> |
| 27 | * |
| 28 | * <p>CaptureResults are produced by a {@link CameraDevice} after processing a |
| 29 | * {@link CaptureRequest}. All properties listed for capture requests can also |
| 30 | * be queried on the capture result, to determine the final values used for |
| 31 | * capture. The result also includes additional metadata about the state of the |
| 32 | * camera device during the capture.</p> |
| 33 | * |
| 34 | */ |
| 35 | public final class CaptureResult extends CameraMetadata { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 36 | |
| 37 | private final CameraMetadataNative mResults; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 38 | private final CaptureRequest mRequest; |
| 39 | private final int mSequenceId; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 40 | |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 41 | /** |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 42 | * Takes ownership of the passed-in properties object |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 43 | * @hide |
| 44 | */ |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 45 | public CaptureResult(CameraMetadataNative results, CaptureRequest parent, int sequenceId) { |
| 46 | if (results == null) { |
| 47 | throw new IllegalArgumentException("results was null"); |
| 48 | } |
| 49 | |
| 50 | if (parent == null) { |
| 51 | throw new IllegalArgumentException("parent was null"); |
| 52 | } |
| 53 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 54 | mResults = results; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 55 | mRequest = parent; |
| 56 | mSequenceId = sequenceId; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | @Override |
| 60 | public <T> T get(Key<T> key) { |
| 61 | return mResults.get(key); |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 62 | } |
| 63 | |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 64 | /** |
| 65 | * Get the request associated with this result. |
| 66 | * |
| 67 | * <p>Whenever a request is successfully captured, with |
| 68 | * {@link CameraDevice.CaptureListener#onCaptureCompleted}, |
| 69 | * the {@code result}'s {@code getRequest()} will return that {@code request}. |
| 70 | * </p> |
| 71 | * |
| 72 | * <p>In particular, |
| 73 | * <code><pre>cameraDevice.capture(someRequest, new CaptureListener() { |
| 74 | * {@literal @}Override |
| 75 | * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) { |
| 76 | * assert(myResult.getRequest.equals(myRequest) == true); |
| 77 | * } |
| 78 | * }; |
| 79 | * </code></pre> |
| 80 | * </p> |
| 81 | * |
| 82 | * @return The request associated with this result. Never {@code null}. |
| 83 | */ |
| 84 | public CaptureRequest getRequest() { |
| 85 | return mRequest; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Get the frame number associated with this result. |
| 90 | * |
| 91 | * <p>Whenever a request has been processed, regardless of failure or success, |
| 92 | * it gets a unique frame number assigned to its future result/failure.</p> |
| 93 | * |
| 94 | * <p>This value monotonically increments, starting with 0, |
| 95 | * for every new result or failure; and the scope is the lifetime of the |
| 96 | * {@link CameraDevice}.</p> |
| 97 | * |
| 98 | * @return int frame number |
| 99 | */ |
| 100 | public int getFrameNumber() { |
| 101 | return get(REQUEST_FRAME_COUNT); |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * The sequence ID for this failure that was returned by the |
| 106 | * {@link CameraDevice#capture} family of functions. |
| 107 | * |
| 108 | * <p>The sequence ID is a unique monotonically increasing value starting from 0, |
| 109 | * incremented every time a new group of requests is submitted to the CameraDevice.</p> |
| 110 | * |
| 111 | * @return int The ID for the sequence of requests that this capture result is a part of |
| 112 | * |
| 113 | * @see CameraDevice.CaptureListener#onCaptureSequenceCompleted |
| 114 | */ |
| 115 | public int getSequenceId() { |
| 116 | return mSequenceId; |
| 117 | } |
| 118 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 119 | /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 120 | * The key entries below this point are generated from metadata |
| 121 | * definitions in /system/media/camera/docs. Do not modify by hand or |
| 122 | * modify the comment blocks at the start or end. |
| 123 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ |
| 124 | |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 125 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 126 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 127 | * <p>A color transform matrix to use to transform |
| 128 | * from sensor RGB color space to output linear sRGB color space</p> |
| 129 | * <p>This matrix is either set by HAL when the request |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 130 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 131 | * directly by the application in the request when the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 132 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 133 | * <p>In the latter case, the HAL may round the matrix to account |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 134 | * for precision issues; the final rounded matrix should be |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 135 | * reported back in this matrix result metadata.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 136 | * |
| 137 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 138 | */ |
| 139 | public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM = |
| 140 | new Key<Rational[]>("android.colorCorrection.transform", Rational[].class); |
| 141 | |
| 142 | /** |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 143 | * <p>Gains applying to Bayer raw color channels for |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 144 | * white-balance</p> |
| 145 | * <p>The 4-channel white-balance gains are defined in |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 146 | * the order of <code>[R G_even G_odd B]</code>, where <code>G_even</code> is the gain |
| 147 | * for green pixels on even rows of the output, and <code>G_odd</code> |
| 148 | * is the gain for green pixels on the odd rows. if a HAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 149 | * does not support a separate gain for even/odd green channels, |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 150 | * it should use the <code>G_even</code> value, and write <code>G_odd</code> equal to |
| 151 | * <code>G_even</code> in the output result metadata.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 152 | * <p>This array is either set by HAL when the request |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 153 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or |
Igor Murashkin | d5ff06a | 2013-08-20 15:15:06 -0700 | [diff] [blame] | 154 | * directly by the application in the request when the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 155 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 156 | * <p>The output should be the gains actually applied by the HAL to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 157 | * the current frame.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 158 | * |
| 159 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 160 | */ |
| 161 | public static final Key<float[]> COLOR_CORRECTION_GAINS = |
| 162 | new Key<float[]>("android.colorCorrection.gains", float[].class); |
| 163 | |
| 164 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 165 | * <p>The ID sent with the latest |
| 166 | * CAMERA2_TRIGGER_PRECAPTURE_METERING call</p> |
| 167 | * <p>Must be 0 if no |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 168 | * CAMERA2_TRIGGER_PRECAPTURE_METERING trigger received yet |
| 169 | * by HAL. Always updated even if AE algorithm ignores the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 170 | * trigger</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 171 | * @hide |
| 172 | */ |
| 173 | public static final Key<Integer> CONTROL_AE_PRECAPTURE_ID = |
| 174 | new Key<Integer>("android.control.aePrecaptureId", int.class); |
| 175 | |
| 176 | /** |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 177 | * <p>The desired mode for the camera device's |
| 178 | * auto-exposure routine.</p> |
| 179 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is |
| 180 | * AUTO.</p> |
| 181 | * <p>When set to any of the ON modes, the camera device's |
| 182 | * auto-exposure routine is enabled, overriding the |
| 183 | * application's selected exposure time, sensor sensitivity, |
| 184 | * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, |
| 185 | * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and |
| 186 | * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes |
| 187 | * is selected, the camera device's flash unit controls are |
| 188 | * also overridden.</p> |
| 189 | * <p>The FLASH modes are only available if the camera device |
| 190 | * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> |
| 191 | * <p>If flash TORCH mode is desired, this field must be set to |
| 192 | * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> |
| 193 | * <p>When set to any of the ON modes, the values chosen by the |
| 194 | * camera device auto-exposure routine for the overridden |
| 195 | * fields for a given capture will be available in its |
| 196 | * CaptureResult.</p> |
| 197 | * |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 198 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 199 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
| 200 | * @see CaptureRequest#FLASH_MODE |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 201 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 202 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 203 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 204 | * @see #CONTROL_AE_MODE_OFF |
| 205 | * @see #CONTROL_AE_MODE_ON |
| 206 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH |
| 207 | * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH |
| 208 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE |
| 209 | */ |
| 210 | public static final Key<Integer> CONTROL_AE_MODE = |
| 211 | new Key<Integer>("android.control.aeMode", int.class); |
| 212 | |
| 213 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 214 | * <p>List of areas to use for |
| 215 | * metering</p> |
| 216 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 217 | * xmax, ymax, weight. The rectangle is defined inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 218 | * specified coordinates.</p> |
| 219 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 220 | * with (0,0) being the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 221 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 222 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 223 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 224 | * should be nonnegative.</p> |
| 225 | * <p>If all regions have 0 weight, then no specific metering area |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 226 | * needs to be used by the HAL. If the metering region is |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 227 | * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 228 | * should ignore the sections outside the region and output the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 229 | * used sections in the frame metadata</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 230 | * |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 231 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 232 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 233 | */ |
| 234 | public static final Key<int[]> CONTROL_AE_REGIONS = |
| 235 | new Key<int[]>("android.control.aeRegions", int[].class); |
| 236 | |
| 237 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 238 | * <p>Current state of AE algorithm</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 239 | * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always |
| 240 | * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 241 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 242 | * the algorithm states to INACTIVE.</p> |
| 243 | * <p>The camera device can do several state transitions between two results, if it is |
| 244 | * allowed by the state transition table. For example: INACTIVE may never actually be |
| 245 | * seen in a result.</p> |
| 246 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 247 | * AE state becomes CONVERGED, then the image data associated with this result should |
| 248 | * be good to use.</p> |
| 249 | * <p>Below are state transition tables for different AE modes.</p> |
| 250 | * <table> |
| 251 | * <thead> |
| 252 | * <tr> |
| 253 | * <th align="center">State</th> |
| 254 | * <th align="center">Transition Cause</th> |
| 255 | * <th align="center">New State</th> |
| 256 | * <th align="center">Notes</th> |
| 257 | * </tr> |
| 258 | * </thead> |
| 259 | * <tbody> |
| 260 | * <tr> |
| 261 | * <td align="center">INACTIVE</td> |
| 262 | * <td align="center"></td> |
| 263 | * <td align="center">INACTIVE</td> |
| 264 | * <td align="center">Camera device auto exposure algorithm is disabled</td> |
| 265 | * </tr> |
| 266 | * </tbody> |
| 267 | * </table> |
| 268 | * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p> |
| 269 | * <table> |
| 270 | * <thead> |
| 271 | * <tr> |
| 272 | * <th align="center">State</th> |
| 273 | * <th align="center">Transition Cause</th> |
| 274 | * <th align="center">New State</th> |
| 275 | * <th align="center">Notes</th> |
| 276 | * </tr> |
| 277 | * </thead> |
| 278 | * <tbody> |
| 279 | * <tr> |
| 280 | * <td align="center">INACTIVE</td> |
| 281 | * <td align="center">Camera device initiates AE scan</td> |
| 282 | * <td align="center">SEARCHING</td> |
| 283 | * <td align="center">Values changing</td> |
| 284 | * </tr> |
| 285 | * <tr> |
| 286 | * <td align="center">INACTIVE</td> |
| 287 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 288 | * <td align="center">LOCKED</td> |
| 289 | * <td align="center">Values locked</td> |
| 290 | * </tr> |
| 291 | * <tr> |
| 292 | * <td align="center">SEARCHING</td> |
| 293 | * <td align="center">Camera device finishes AE scan</td> |
| 294 | * <td align="center">CONVERGED</td> |
| 295 | * <td align="center">Good values, not changing</td> |
| 296 | * </tr> |
| 297 | * <tr> |
| 298 | * <td align="center">SEARCHING</td> |
| 299 | * <td align="center">Camera device finishes AE scan</td> |
| 300 | * <td align="center">FLASH_REQUIRED</td> |
| 301 | * <td align="center">Converged but too dark w/o flash</td> |
| 302 | * </tr> |
| 303 | * <tr> |
| 304 | * <td align="center">SEARCHING</td> |
| 305 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 306 | * <td align="center">LOCKED</td> |
| 307 | * <td align="center">Values locked</td> |
| 308 | * </tr> |
| 309 | * <tr> |
| 310 | * <td align="center">CONVERGED</td> |
| 311 | * <td align="center">Camera device initiates AE scan</td> |
| 312 | * <td align="center">SEARCHING</td> |
| 313 | * <td align="center">Values changing</td> |
| 314 | * </tr> |
| 315 | * <tr> |
| 316 | * <td align="center">CONVERGED</td> |
| 317 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 318 | * <td align="center">LOCKED</td> |
| 319 | * <td align="center">Values locked</td> |
| 320 | * </tr> |
| 321 | * <tr> |
| 322 | * <td align="center">FLASH_REQUIRED</td> |
| 323 | * <td align="center">Camera device initiates AE scan</td> |
| 324 | * <td align="center">SEARCHING</td> |
| 325 | * <td align="center">Values changing</td> |
| 326 | * </tr> |
| 327 | * <tr> |
| 328 | * <td align="center">FLASH_REQUIRED</td> |
| 329 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 330 | * <td align="center">LOCKED</td> |
| 331 | * <td align="center">Values locked</td> |
| 332 | * </tr> |
| 333 | * <tr> |
| 334 | * <td align="center">LOCKED</td> |
| 335 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 336 | * <td align="center">SEARCHING</td> |
| 337 | * <td align="center">Values not good after unlock</td> |
| 338 | * </tr> |
| 339 | * <tr> |
| 340 | * <td align="center">LOCKED</td> |
| 341 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 342 | * <td align="center">CONVERGED</td> |
| 343 | * <td align="center">Values good after unlock</td> |
| 344 | * </tr> |
| 345 | * <tr> |
| 346 | * <td align="center">LOCKED</td> |
| 347 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 348 | * <td align="center">FLASH_REQUIRED</td> |
| 349 | * <td align="center">Exposure good, but too dark</td> |
| 350 | * </tr> |
| 351 | * <tr> |
| 352 | * <td align="center">PRECAPTURE</td> |
| 353 | * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 354 | * <td align="center">CONVERGED</td> |
| 355 | * <td align="center">Ready for high-quality capture</td> |
| 356 | * </tr> |
| 357 | * <tr> |
| 358 | * <td align="center">PRECAPTURE</td> |
| 359 | * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 360 | * <td align="center">LOCKED</td> |
| 361 | * <td align="center">Ready for high-quality capture</td> |
| 362 | * </tr> |
| 363 | * <tr> |
| 364 | * <td align="center">Any state</td> |
| 365 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td> |
| 366 | * <td align="center">PRECAPTURE</td> |
| 367 | * <td align="center">Start AE precapture metering sequence</td> |
| 368 | * </tr> |
| 369 | * </tbody> |
| 370 | * </table> |
| 371 | * |
| 372 | * @see CaptureRequest#CONTROL_AE_LOCK |
| 373 | * @see CaptureRequest#CONTROL_AE_MODE |
| 374 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 375 | * @see CaptureRequest#CONTROL_MODE |
| 376 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 377 | * @see #CONTROL_AE_STATE_INACTIVE |
| 378 | * @see #CONTROL_AE_STATE_SEARCHING |
| 379 | * @see #CONTROL_AE_STATE_CONVERGED |
| 380 | * @see #CONTROL_AE_STATE_LOCKED |
| 381 | * @see #CONTROL_AE_STATE_FLASH_REQUIRED |
| 382 | * @see #CONTROL_AE_STATE_PRECAPTURE |
| 383 | */ |
| 384 | public static final Key<Integer> CONTROL_AE_STATE = |
| 385 | new Key<Integer>("android.control.aeState", int.class); |
| 386 | |
| 387 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 388 | * <p>Whether AF is currently enabled, and what |
| 389 | * mode it is set to</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 390 | * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO.</p> |
Zhijun He | 78146ec | 2014-01-14 18:12:13 -0800 | [diff] [blame] | 391 | * <p>If the lens is controlled by the camera device auto-focus algorithm, |
| 392 | * the camera device will report the current AF status in android.control.afState |
| 393 | * in result metadata.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 394 | * |
| 395 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 396 | * @see #CONTROL_AF_MODE_OFF |
| 397 | * @see #CONTROL_AF_MODE_AUTO |
| 398 | * @see #CONTROL_AF_MODE_MACRO |
| 399 | * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO |
| 400 | * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE |
| 401 | * @see #CONTROL_AF_MODE_EDOF |
| 402 | */ |
| 403 | public static final Key<Integer> CONTROL_AF_MODE = |
| 404 | new Key<Integer>("android.control.afMode", int.class); |
| 405 | |
| 406 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 407 | * <p>List of areas to use for focus |
| 408 | * estimation</p> |
| 409 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 410 | * xmax, ymax, weight. The rectangle is defined inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 411 | * specified coordinates.</p> |
| 412 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 413 | * with (0,0) being the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 414 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 415 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 416 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 417 | * should be nonnegative.</p> |
| 418 | * <p>If all regions have 0 weight, then no specific focus area |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 419 | * needs to be used by the HAL. If the focusing region is |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 420 | * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 421 | * should ignore the sections outside the region and output the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 422 | * used sections in the frame metadata</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 423 | * |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 424 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 425 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 426 | */ |
| 427 | public static final Key<int[]> CONTROL_AF_REGIONS = |
| 428 | new Key<int[]>("android.control.afRegions", int[].class); |
| 429 | |
| 430 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 431 | * <p>Current state of AF algorithm</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 432 | * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always |
| 433 | * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 434 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 435 | * the algorithm states to INACTIVE.</p> |
| 436 | * <p>The camera device can do several state transitions between two results, if it is |
| 437 | * allowed by the state transition table. For example: INACTIVE may never actually be |
| 438 | * seen in a result.</p> |
| 439 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 440 | * AF state becomes FOCUSED, then the image data associated with this result should |
| 441 | * be sharp.</p> |
| 442 | * <p>Below are state transition tables for different AF modes.</p> |
| 443 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p> |
| 444 | * <table> |
| 445 | * <thead> |
| 446 | * <tr> |
| 447 | * <th align="center">State</th> |
| 448 | * <th align="center">Transition Cause</th> |
| 449 | * <th align="center">New State</th> |
| 450 | * <th align="center">Notes</th> |
| 451 | * </tr> |
| 452 | * </thead> |
| 453 | * <tbody> |
| 454 | * <tr> |
| 455 | * <td align="center">INACTIVE</td> |
| 456 | * <td align="center"></td> |
| 457 | * <td align="center">INACTIVE</td> |
| 458 | * <td align="center">Never changes</td> |
| 459 | * </tr> |
| 460 | * </tbody> |
| 461 | * </table> |
| 462 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p> |
| 463 | * <table> |
| 464 | * <thead> |
| 465 | * <tr> |
| 466 | * <th align="center">State</th> |
| 467 | * <th align="center">Transition Cause</th> |
| 468 | * <th align="center">New State</th> |
| 469 | * <th align="center">Notes</th> |
| 470 | * </tr> |
| 471 | * </thead> |
| 472 | * <tbody> |
| 473 | * <tr> |
| 474 | * <td align="center">INACTIVE</td> |
| 475 | * <td align="center">AF_TRIGGER</td> |
| 476 | * <td align="center">ACTIVE_SCAN</td> |
| 477 | * <td align="center">Start AF sweep, Lens now moving</td> |
| 478 | * </tr> |
| 479 | * <tr> |
| 480 | * <td align="center">ACTIVE_SCAN</td> |
| 481 | * <td align="center">AF sweep done</td> |
| 482 | * <td align="center">FOCUSED_LOCKED</td> |
| 483 | * <td align="center">Focused, Lens now locked</td> |
| 484 | * </tr> |
| 485 | * <tr> |
| 486 | * <td align="center">ACTIVE_SCAN</td> |
| 487 | * <td align="center">AF sweep done</td> |
| 488 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 489 | * <td align="center">Not focused, Lens now locked</td> |
| 490 | * </tr> |
| 491 | * <tr> |
| 492 | * <td align="center">ACTIVE_SCAN</td> |
| 493 | * <td align="center">AF_CANCEL</td> |
| 494 | * <td align="center">INACTIVE</td> |
| 495 | * <td align="center">Cancel/reset AF, Lens now locked</td> |
| 496 | * </tr> |
| 497 | * <tr> |
| 498 | * <td align="center">FOCUSED_LOCKED</td> |
| 499 | * <td align="center">AF_CANCEL</td> |
| 500 | * <td align="center">INACTIVE</td> |
| 501 | * <td align="center">Cancel/reset AF</td> |
| 502 | * </tr> |
| 503 | * <tr> |
| 504 | * <td align="center">FOCUSED_LOCKED</td> |
| 505 | * <td align="center">AF_TRIGGER</td> |
| 506 | * <td align="center">ACTIVE_SCAN</td> |
| 507 | * <td align="center">Start new sweep, Lens now moving</td> |
| 508 | * </tr> |
| 509 | * <tr> |
| 510 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 511 | * <td align="center">AF_CANCEL</td> |
| 512 | * <td align="center">INACTIVE</td> |
| 513 | * <td align="center">Cancel/reset AF</td> |
| 514 | * </tr> |
| 515 | * <tr> |
| 516 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 517 | * <td align="center">AF_TRIGGER</td> |
| 518 | * <td align="center">ACTIVE_SCAN</td> |
| 519 | * <td align="center">Start new sweep, Lens now moving</td> |
| 520 | * </tr> |
| 521 | * <tr> |
| 522 | * <td align="center">Any state</td> |
| 523 | * <td align="center">Mode change</td> |
| 524 | * <td align="center">INACTIVE</td> |
| 525 | * <td align="center"></td> |
| 526 | * </tr> |
| 527 | * </tbody> |
| 528 | * </table> |
| 529 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p> |
| 530 | * <table> |
| 531 | * <thead> |
| 532 | * <tr> |
| 533 | * <th align="center">State</th> |
| 534 | * <th align="center">Transition Cause</th> |
| 535 | * <th align="center">New State</th> |
| 536 | * <th align="center">Notes</th> |
| 537 | * </tr> |
| 538 | * </thead> |
| 539 | * <tbody> |
| 540 | * <tr> |
| 541 | * <td align="center">INACTIVE</td> |
| 542 | * <td align="center">Camera device initiates new scan</td> |
| 543 | * <td align="center">PASSIVE_SCAN</td> |
| 544 | * <td align="center">Start AF scan, Lens now moving</td> |
| 545 | * </tr> |
| 546 | * <tr> |
| 547 | * <td align="center">INACTIVE</td> |
| 548 | * <td align="center">AF_TRIGGER</td> |
| 549 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 550 | * <td align="center">AF state query, Lens now locked</td> |
| 551 | * </tr> |
| 552 | * <tr> |
| 553 | * <td align="center">PASSIVE_SCAN</td> |
| 554 | * <td align="center">Camera device completes current scan</td> |
| 555 | * <td align="center">PASSIVE_FOCUSED</td> |
| 556 | * <td align="center">End AF scan, Lens now locked</td> |
| 557 | * </tr> |
| 558 | * <tr> |
| 559 | * <td align="center">PASSIVE_SCAN</td> |
| 560 | * <td align="center">Camera device fails current scan</td> |
| 561 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 562 | * <td align="center">End AF scan, Lens now locked</td> |
| 563 | * </tr> |
| 564 | * <tr> |
| 565 | * <td align="center">PASSIVE_SCAN</td> |
| 566 | * <td align="center">AF_TRIGGER</td> |
| 567 | * <td align="center">FOCUSED_LOCKED</td> |
| 568 | * <td align="center">Immediate trans. If focus is good, Lens now locked</td> |
| 569 | * </tr> |
| 570 | * <tr> |
| 571 | * <td align="center">PASSIVE_SCAN</td> |
| 572 | * <td align="center">AF_TRIGGER</td> |
| 573 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 574 | * <td align="center">Immediate trans. if focus is bad, Lens now locked</td> |
| 575 | * </tr> |
| 576 | * <tr> |
| 577 | * <td align="center">PASSIVE_SCAN</td> |
| 578 | * <td align="center">AF_CANCEL</td> |
| 579 | * <td align="center">INACTIVE</td> |
| 580 | * <td align="center">Reset lens position, Lens now locked</td> |
| 581 | * </tr> |
| 582 | * <tr> |
| 583 | * <td align="center">PASSIVE_FOCUSED</td> |
| 584 | * <td align="center">Camera device initiates new scan</td> |
| 585 | * <td align="center">PASSIVE_SCAN</td> |
| 586 | * <td align="center">Start AF scan, Lens now moving</td> |
| 587 | * </tr> |
| 588 | * <tr> |
| 589 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 590 | * <td align="center">Camera device initiates new scan</td> |
| 591 | * <td align="center">PASSIVE_SCAN</td> |
| 592 | * <td align="center">Start AF scan, Lens now moving</td> |
| 593 | * </tr> |
| 594 | * <tr> |
| 595 | * <td align="center">PASSIVE_FOCUSED</td> |
| 596 | * <td align="center">AF_TRIGGER</td> |
| 597 | * <td align="center">FOCUSED_LOCKED</td> |
| 598 | * <td align="center">Immediate trans. Lens now locked</td> |
| 599 | * </tr> |
| 600 | * <tr> |
| 601 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 602 | * <td align="center">AF_TRIGGER</td> |
| 603 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 604 | * <td align="center">Immediate trans. Lens now locked</td> |
| 605 | * </tr> |
| 606 | * <tr> |
| 607 | * <td align="center">FOCUSED_LOCKED</td> |
| 608 | * <td align="center">AF_TRIGGER</td> |
| 609 | * <td align="center">FOCUSED_LOCKED</td> |
| 610 | * <td align="center">No effect</td> |
| 611 | * </tr> |
| 612 | * <tr> |
| 613 | * <td align="center">FOCUSED_LOCKED</td> |
| 614 | * <td align="center">AF_CANCEL</td> |
| 615 | * <td align="center">INACTIVE</td> |
| 616 | * <td align="center">Restart AF scan</td> |
| 617 | * </tr> |
| 618 | * <tr> |
| 619 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 620 | * <td align="center">AF_TRIGGER</td> |
| 621 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 622 | * <td align="center">No effect</td> |
| 623 | * </tr> |
| 624 | * <tr> |
| 625 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 626 | * <td align="center">AF_CANCEL</td> |
| 627 | * <td align="center">INACTIVE</td> |
| 628 | * <td align="center">Restart AF scan</td> |
| 629 | * </tr> |
| 630 | * </tbody> |
| 631 | * </table> |
| 632 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p> |
| 633 | * <table> |
| 634 | * <thead> |
| 635 | * <tr> |
| 636 | * <th align="center">State</th> |
| 637 | * <th align="center">Transition Cause</th> |
| 638 | * <th align="center">New State</th> |
| 639 | * <th align="center">Notes</th> |
| 640 | * </tr> |
| 641 | * </thead> |
| 642 | * <tbody> |
| 643 | * <tr> |
| 644 | * <td align="center">INACTIVE</td> |
| 645 | * <td align="center">Camera device initiates new scan</td> |
| 646 | * <td align="center">PASSIVE_SCAN</td> |
| 647 | * <td align="center">Start AF scan, Lens now moving</td> |
| 648 | * </tr> |
| 649 | * <tr> |
| 650 | * <td align="center">INACTIVE</td> |
| 651 | * <td align="center">AF_TRIGGER</td> |
| 652 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 653 | * <td align="center">AF state query, Lens now locked</td> |
| 654 | * </tr> |
| 655 | * <tr> |
| 656 | * <td align="center">PASSIVE_SCAN</td> |
| 657 | * <td align="center">Camera device completes current scan</td> |
| 658 | * <td align="center">PASSIVE_FOCUSED</td> |
| 659 | * <td align="center">End AF scan, Lens now locked</td> |
| 660 | * </tr> |
| 661 | * <tr> |
| 662 | * <td align="center">PASSIVE_SCAN</td> |
| 663 | * <td align="center">Camera device fails current scan</td> |
| 664 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 665 | * <td align="center">End AF scan, Lens now locked</td> |
| 666 | * </tr> |
| 667 | * <tr> |
| 668 | * <td align="center">PASSIVE_SCAN</td> |
| 669 | * <td align="center">AF_TRIGGER</td> |
| 670 | * <td align="center">FOCUSED_LOCKED</td> |
| 671 | * <td align="center">Eventual trans. once focus good, Lens now locked</td> |
| 672 | * </tr> |
| 673 | * <tr> |
| 674 | * <td align="center">PASSIVE_SCAN</td> |
| 675 | * <td align="center">AF_TRIGGER</td> |
| 676 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 677 | * <td align="center">Eventual trans. if cannot focus, Lens now locked</td> |
| 678 | * </tr> |
| 679 | * <tr> |
| 680 | * <td align="center">PASSIVE_SCAN</td> |
| 681 | * <td align="center">AF_CANCEL</td> |
| 682 | * <td align="center">INACTIVE</td> |
| 683 | * <td align="center">Reset lens position, Lens now locked</td> |
| 684 | * </tr> |
| 685 | * <tr> |
| 686 | * <td align="center">PASSIVE_FOCUSED</td> |
| 687 | * <td align="center">Camera device initiates new scan</td> |
| 688 | * <td align="center">PASSIVE_SCAN</td> |
| 689 | * <td align="center">Start AF scan, Lens now moving</td> |
| 690 | * </tr> |
| 691 | * <tr> |
| 692 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 693 | * <td align="center">Camera device initiates new scan</td> |
| 694 | * <td align="center">PASSIVE_SCAN</td> |
| 695 | * <td align="center">Start AF scan, Lens now moving</td> |
| 696 | * </tr> |
| 697 | * <tr> |
| 698 | * <td align="center">PASSIVE_FOCUSED</td> |
| 699 | * <td align="center">AF_TRIGGER</td> |
| 700 | * <td align="center">FOCUSED_LOCKED</td> |
| 701 | * <td align="center">Immediate trans. Lens now locked</td> |
| 702 | * </tr> |
| 703 | * <tr> |
| 704 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 705 | * <td align="center">AF_TRIGGER</td> |
| 706 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 707 | * <td align="center">Immediate trans. Lens now locked</td> |
| 708 | * </tr> |
| 709 | * <tr> |
| 710 | * <td align="center">FOCUSED_LOCKED</td> |
| 711 | * <td align="center">AF_TRIGGER</td> |
| 712 | * <td align="center">FOCUSED_LOCKED</td> |
| 713 | * <td align="center">No effect</td> |
| 714 | * </tr> |
| 715 | * <tr> |
| 716 | * <td align="center">FOCUSED_LOCKED</td> |
| 717 | * <td align="center">AF_CANCEL</td> |
| 718 | * <td align="center">INACTIVE</td> |
| 719 | * <td align="center">Restart AF scan</td> |
| 720 | * </tr> |
| 721 | * <tr> |
| 722 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 723 | * <td align="center">AF_TRIGGER</td> |
| 724 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 725 | * <td align="center">No effect</td> |
| 726 | * </tr> |
| 727 | * <tr> |
| 728 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 729 | * <td align="center">AF_CANCEL</td> |
| 730 | * <td align="center">INACTIVE</td> |
| 731 | * <td align="center">Restart AF scan</td> |
| 732 | * </tr> |
| 733 | * </tbody> |
| 734 | * </table> |
| 735 | * |
| 736 | * @see CaptureRequest#CONTROL_AF_MODE |
| 737 | * @see CaptureRequest#CONTROL_MODE |
| 738 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 739 | * @see #CONTROL_AF_STATE_INACTIVE |
| 740 | * @see #CONTROL_AF_STATE_PASSIVE_SCAN |
| 741 | * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED |
| 742 | * @see #CONTROL_AF_STATE_ACTIVE_SCAN |
| 743 | * @see #CONTROL_AF_STATE_FOCUSED_LOCKED |
| 744 | * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED |
Eino-Ville Talvala | 9f880f7 | 2013-09-20 17:50:41 -0700 | [diff] [blame] | 745 | * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 746 | */ |
| 747 | public static final Key<Integer> CONTROL_AF_STATE = |
| 748 | new Key<Integer>("android.control.afState", int.class); |
| 749 | |
| 750 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 751 | * <p>The ID sent with the latest |
| 752 | * CAMERA2_TRIGGER_AUTOFOCUS call</p> |
| 753 | * <p>Must be 0 if no CAMERA2_TRIGGER_AUTOFOCUS trigger |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 754 | * received yet by HAL. Always updated even if AF algorithm |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 755 | * ignores the trigger</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 756 | * @hide |
| 757 | */ |
| 758 | public static final Key<Integer> CONTROL_AF_TRIGGER_ID = |
| 759 | new Key<Integer>("android.control.afTriggerId", int.class); |
| 760 | |
| 761 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 762 | * <p>Whether AWB is currently setting the color |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 763 | * transform fields, and what its illumination target |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 764 | * is</p> |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 765 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p> |
| 766 | * <p>When set to the ON mode, the camera device's auto white balance |
| 767 | * routine is enabled, overriding the application's selected |
| 768 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 769 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> |
| 770 | * <p>When set to the OFF mode, the camera device's auto white balance |
| 771 | * routine is disabled. The applicantion manually controls the white |
| 772 | * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, android.colorCorrection.gains |
| 773 | * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> |
| 774 | * <p>When set to any other modes, the camera device's auto white balance |
| 775 | * routine is disabled. The camera device uses each particular illumination |
| 776 | * target for white balance adjustment.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 777 | * |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 778 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 779 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
| 780 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 781 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 782 | * @see #CONTROL_AWB_MODE_OFF |
| 783 | * @see #CONTROL_AWB_MODE_AUTO |
| 784 | * @see #CONTROL_AWB_MODE_INCANDESCENT |
| 785 | * @see #CONTROL_AWB_MODE_FLUORESCENT |
| 786 | * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT |
| 787 | * @see #CONTROL_AWB_MODE_DAYLIGHT |
| 788 | * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT |
| 789 | * @see #CONTROL_AWB_MODE_TWILIGHT |
| 790 | * @see #CONTROL_AWB_MODE_SHADE |
| 791 | */ |
| 792 | public static final Key<Integer> CONTROL_AWB_MODE = |
| 793 | new Key<Integer>("android.control.awbMode", int.class); |
| 794 | |
| 795 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 796 | * <p>List of areas to use for illuminant |
| 797 | * estimation</p> |
| 798 | * <p>Only used in AUTO mode.</p> |
| 799 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 800 | * xmax, ymax, weight. The rectangle is defined inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 801 | * specified coordinates.</p> |
| 802 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 803 | * with (0,0) being the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 804 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 805 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 806 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 807 | * should be nonnegative.</p> |
| 808 | * <p>If all regions have 0 weight, then no specific metering area |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 809 | * needs to be used by the HAL. If the metering region is |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 810 | * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 811 | * should ignore the sections outside the region and output the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 812 | * used sections in the frame metadata</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 813 | * |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 814 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 815 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 816 | */ |
| 817 | public static final Key<int[]> CONTROL_AWB_REGIONS = |
| 818 | new Key<int[]>("android.control.awbRegions", int[].class); |
| 819 | |
| 820 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 821 | * <p>Current state of AWB algorithm</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 822 | * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always |
| 823 | * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 824 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 825 | * the algorithm states to INACTIVE.</p> |
| 826 | * <p>The camera device can do several state transitions between two results, if it is |
| 827 | * allowed by the state transition table. So INACTIVE may never actually be seen in |
| 828 | * a result.</p> |
| 829 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 830 | * AWB state becomes CONVERGED, then the image data associated with this result should |
| 831 | * be good to use.</p> |
| 832 | * <p>Below are state transition tables for different AWB modes.</p> |
| 833 | * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p> |
| 834 | * <table> |
| 835 | * <thead> |
| 836 | * <tr> |
| 837 | * <th align="center">State</th> |
| 838 | * <th align="center">Transition Cause</th> |
| 839 | * <th align="center">New State</th> |
| 840 | * <th align="center">Notes</th> |
| 841 | * </tr> |
| 842 | * </thead> |
| 843 | * <tbody> |
| 844 | * <tr> |
| 845 | * <td align="center">INACTIVE</td> |
| 846 | * <td align="center"></td> |
| 847 | * <td align="center">INACTIVE</td> |
| 848 | * <td align="center">Camera device auto white balance algorithm is disabled</td> |
| 849 | * </tr> |
| 850 | * </tbody> |
| 851 | * </table> |
| 852 | * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p> |
| 853 | * <table> |
| 854 | * <thead> |
| 855 | * <tr> |
| 856 | * <th align="center">State</th> |
| 857 | * <th align="center">Transition Cause</th> |
| 858 | * <th align="center">New State</th> |
| 859 | * <th align="center">Notes</th> |
| 860 | * </tr> |
| 861 | * </thead> |
| 862 | * <tbody> |
| 863 | * <tr> |
| 864 | * <td align="center">INACTIVE</td> |
| 865 | * <td align="center">Camera device initiates AWB scan</td> |
| 866 | * <td align="center">SEARCHING</td> |
| 867 | * <td align="center">Values changing</td> |
| 868 | * </tr> |
| 869 | * <tr> |
| 870 | * <td align="center">INACTIVE</td> |
| 871 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 872 | * <td align="center">LOCKED</td> |
| 873 | * <td align="center">Values locked</td> |
| 874 | * </tr> |
| 875 | * <tr> |
| 876 | * <td align="center">SEARCHING</td> |
| 877 | * <td align="center">Camera device finishes AWB scan</td> |
| 878 | * <td align="center">CONVERGED</td> |
| 879 | * <td align="center">Good values, not changing</td> |
| 880 | * </tr> |
| 881 | * <tr> |
| 882 | * <td align="center">SEARCHING</td> |
| 883 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 884 | * <td align="center">LOCKED</td> |
| 885 | * <td align="center">Values locked</td> |
| 886 | * </tr> |
| 887 | * <tr> |
| 888 | * <td align="center">CONVERGED</td> |
| 889 | * <td align="center">Camera device initiates AWB scan</td> |
| 890 | * <td align="center">SEARCHING</td> |
| 891 | * <td align="center">Values changing</td> |
| 892 | * </tr> |
| 893 | * <tr> |
| 894 | * <td align="center">CONVERGED</td> |
| 895 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 896 | * <td align="center">LOCKED</td> |
| 897 | * <td align="center">Values locked</td> |
| 898 | * </tr> |
| 899 | * <tr> |
| 900 | * <td align="center">LOCKED</td> |
| 901 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> |
| 902 | * <td align="center">SEARCHING</td> |
| 903 | * <td align="center">Values not good after unlock</td> |
| 904 | * </tr> |
| 905 | * <tr> |
| 906 | * <td align="center">LOCKED</td> |
| 907 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> |
| 908 | * <td align="center">CONVERGED</td> |
| 909 | * <td align="center">Values good after unlock</td> |
| 910 | * </tr> |
| 911 | * </tbody> |
| 912 | * </table> |
| 913 | * |
| 914 | * @see CaptureRequest#CONTROL_AWB_LOCK |
| 915 | * @see CaptureRequest#CONTROL_AWB_MODE |
| 916 | * @see CaptureRequest#CONTROL_MODE |
| 917 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 918 | * @see #CONTROL_AWB_STATE_INACTIVE |
| 919 | * @see #CONTROL_AWB_STATE_SEARCHING |
| 920 | * @see #CONTROL_AWB_STATE_CONVERGED |
| 921 | * @see #CONTROL_AWB_STATE_LOCKED |
| 922 | */ |
| 923 | public static final Key<Integer> CONTROL_AWB_STATE = |
| 924 | new Key<Integer>("android.control.awbState", int.class); |
| 925 | |
| 926 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 927 | * <p>Overall mode of 3A control |
| 928 | * routines</p> |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 929 | * <p>High-level 3A control. When set to OFF, all 3A control |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 930 | * by the camera device is disabled. The application must set the fields for |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 931 | * capture parameters itself.</p> |
| 932 | * <p>When set to AUTO, the individual algorithm controls in |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 933 | * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p> |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 934 | * <p>When set to USE_SCENE_MODE, the individual controls in |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 935 | * android.control.* are mostly disabled, and the camera device implements |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 936 | * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 937 | * as it wishes. The camera device scene mode 3A settings are provided by |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 938 | * android.control.sceneModeOverrides.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 939 | * |
| 940 | * @see CaptureRequest#CONTROL_AF_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 941 | * @see #CONTROL_MODE_OFF |
| 942 | * @see #CONTROL_MODE_AUTO |
| 943 | * @see #CONTROL_MODE_USE_SCENE_MODE |
| 944 | */ |
| 945 | public static final Key<Integer> CONTROL_MODE = |
| 946 | new Key<Integer>("android.control.mode", int.class); |
| 947 | |
| 948 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 949 | * <p>Operation mode for edge |
| 950 | * enhancement</p> |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 951 | * <p>Edge/sharpness/detail enhancement. OFF means no |
| 952 | * enhancement will be applied by the HAL.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 953 | * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 954 | * will be applied. HIGH_QUALITY mode indicates that the |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 955 | * camera device will use the highest-quality enhancement algorithms, |
| 956 | * even if it slows down capture rate. FAST means the camera device will |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 957 | * not slow down capture rate when applying edge enhancement.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 958 | * @see #EDGE_MODE_OFF |
| 959 | * @see #EDGE_MODE_FAST |
| 960 | * @see #EDGE_MODE_HIGH_QUALITY |
| 961 | */ |
| 962 | public static final Key<Integer> EDGE_MODE = |
| 963 | new Key<Integer>("android.edge.mode", int.class); |
| 964 | |
| 965 | /** |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 966 | * <p>The desired mode for for the camera device's flash control.</p> |
| 967 | * <p>This control is only effective when flash unit is available |
| 968 | * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} != 0</code>).</p> |
| 969 | * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. |
| 970 | * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, |
| 971 | * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> |
| 972 | * <p>When set to OFF, the camera device will not fire flash for this capture.</p> |
| 973 | * <p>When set to SINGLE, the camera device will fire flash regardless of the camera |
| 974 | * device's auto-exposure routine's result. When used in still capture case, this |
| 975 | * control should be used along with AE precapture metering sequence |
| 976 | * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> |
| 977 | * <p>When set to TORCH, the flash will be on continuously. This mode can be used |
| 978 | * for use cases such as preview, auto-focus assist, still capture, or video recording.</p> |
| 979 | * |
| 980 | * @see CaptureRequest#CONTROL_AE_MODE |
| 981 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 982 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 983 | * @see #FLASH_MODE_OFF |
| 984 | * @see #FLASH_MODE_SINGLE |
| 985 | * @see #FLASH_MODE_TORCH |
| 986 | */ |
| 987 | public static final Key<Integer> FLASH_MODE = |
| 988 | new Key<Integer>("android.flash.mode", int.class); |
| 989 | |
| 990 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 991 | * <p>Current state of the flash |
| 992 | * unit</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 993 | * @see #FLASH_STATE_UNAVAILABLE |
| 994 | * @see #FLASH_STATE_CHARGING |
| 995 | * @see #FLASH_STATE_READY |
| 996 | * @see #FLASH_STATE_FIRED |
| 997 | */ |
| 998 | public static final Key<Integer> FLASH_STATE = |
| 999 | new Key<Integer>("android.flash.state", int.class); |
| 1000 | |
| 1001 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1002 | * <p>GPS coordinates to include in output JPEG |
| 1003 | * EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1004 | */ |
| 1005 | public static final Key<double[]> JPEG_GPS_COORDINATES = |
| 1006 | new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); |
| 1007 | |
| 1008 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1009 | * <p>32 characters describing GPS algorithm to |
| 1010 | * include in EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1011 | */ |
| 1012 | public static final Key<String> JPEG_GPS_PROCESSING_METHOD = |
| 1013 | new Key<String>("android.jpeg.gpsProcessingMethod", String.class); |
| 1014 | |
| 1015 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1016 | * <p>Time GPS fix was made to include in |
| 1017 | * EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1018 | */ |
| 1019 | public static final Key<Long> JPEG_GPS_TIMESTAMP = |
| 1020 | new Key<Long>("android.jpeg.gpsTimestamp", long.class); |
| 1021 | |
| 1022 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1023 | * <p>Orientation of JPEG image to |
| 1024 | * write</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1025 | */ |
| 1026 | public static final Key<Integer> JPEG_ORIENTATION = |
| 1027 | new Key<Integer>("android.jpeg.orientation", int.class); |
| 1028 | |
| 1029 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1030 | * <p>Compression quality of the final JPEG |
| 1031 | * image</p> |
| 1032 | * <p>85-95 is typical usage range</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1033 | */ |
| 1034 | public static final Key<Byte> JPEG_QUALITY = |
| 1035 | new Key<Byte>("android.jpeg.quality", byte.class); |
| 1036 | |
| 1037 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1038 | * <p>Compression quality of JPEG |
| 1039 | * thumbnail</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1040 | */ |
| 1041 | public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = |
| 1042 | new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); |
| 1043 | |
| 1044 | /** |
Zhijun He | 5a9ff37 | 2013-12-26 11:49:09 -0800 | [diff] [blame] | 1045 | * <p>Resolution of embedded JPEG thumbnail</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1046 | * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, |
| 1047 | * but the captured JPEG will still be a valid image.</p> |
Zhijun He | 5a9ff37 | 2013-12-26 11:49:09 -0800 | [diff] [blame] | 1048 | * <p>When a jpeg image capture is issued, the thumbnail size selected should have |
| 1049 | * the same aspect ratio as the jpeg image.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1050 | */ |
| 1051 | public static final Key<android.hardware.camera2.Size> JPEG_THUMBNAIL_SIZE = |
| 1052 | new Key<android.hardware.camera2.Size>("android.jpeg.thumbnailSize", android.hardware.camera2.Size.class); |
| 1053 | |
| 1054 | /** |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 1055 | * <p>The ratio of lens focal length to the effective |
| 1056 | * aperture diameter.</p> |
| 1057 | * <p>This will only be supported on the camera devices that |
| 1058 | * have variable aperture lens. The aperture value can only be |
| 1059 | * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p> |
| 1060 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, |
| 1061 | * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, |
| 1062 | * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and android.sensor.frameDuration |
| 1063 | * to achieve manual exposure control.</p> |
| 1064 | * <p>The requested aperture value may take several frames to reach the |
| 1065 | * requested value; the camera device will report the current (intermediate) |
| 1066 | * aperture size in capture result metadata while the aperture is changing.</p> |
| 1067 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of |
| 1068 | * the ON modes, this will be overridden by the camera device |
| 1069 | * auto-exposure algorithm, the overridden values are then provided |
| 1070 | * back to the user in the corresponding result.</p> |
| 1071 | * |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1072 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1073 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
| 1074 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 1075 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1076 | */ |
| 1077 | public static final Key<Float> LENS_APERTURE = |
| 1078 | new Key<Float>("android.lens.aperture", float.class); |
| 1079 | |
| 1080 | /** |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 1081 | * <p>State of lens neutral density filter(s).</p> |
| 1082 | * <p>This will not be supported on most camera devices. On devices |
| 1083 | * where this is supported, this may only be set to one of the |
| 1084 | * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p> |
| 1085 | * <p>Lens filters are typically used to lower the amount of light the |
| 1086 | * sensor is exposed to (measured in steps of EV). As used here, an EV |
| 1087 | * step is the standard logarithmic representation, which are |
| 1088 | * non-negative, and inversely proportional to the amount of light |
| 1089 | * hitting the sensor. For example, setting this to 0 would result |
| 1090 | * in no reduction of the incoming light, and setting this to 2 would |
| 1091 | * mean that the filter is set to reduce incoming light by two stops |
| 1092 | * (allowing 1/4 of the prior amount of light to the sensor).</p> |
| 1093 | * |
| 1094 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1095 | */ |
| 1096 | public static final Key<Float> LENS_FILTER_DENSITY = |
| 1097 | new Key<Float>("android.lens.filterDensity", float.class); |
| 1098 | |
| 1099 | /** |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1100 | * <p>The current lens focal length; used for optical zoom.</p> |
| 1101 | * <p>This setting controls the physical focal length of the camera |
| 1102 | * device's lens. Changing the focal length changes the field of |
| 1103 | * view of the camera device, and is usually used for optical zoom.</p> |
| 1104 | * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this |
| 1105 | * setting won't be applied instantaneously, and it may take several |
| 1106 | * frames before the lens can move to the requested focal length. |
| 1107 | * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will |
| 1108 | * be set to MOVING.</p> |
| 1109 | * <p>This is expected not to be supported on most devices.</p> |
| 1110 | * |
| 1111 | * @see CaptureRequest#LENS_APERTURE |
| 1112 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
| 1113 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1114 | */ |
| 1115 | public static final Key<Float> LENS_FOCAL_LENGTH = |
| 1116 | new Key<Float>("android.lens.focalLength", float.class); |
| 1117 | |
| 1118 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1119 | * <p>Distance to plane of sharpest focus, |
| 1120 | * measured from frontmost surface of the lens</p> |
| 1121 | * <p>Should be zero for fixed-focus cameras</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1122 | */ |
| 1123 | public static final Key<Float> LENS_FOCUS_DISTANCE = |
| 1124 | new Key<Float>("android.lens.focusDistance", float.class); |
| 1125 | |
| 1126 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1127 | * <p>The range of scene distances that are in |
| 1128 | * sharp focus (depth of field)</p> |
| 1129 | * <p>If variable focus not supported, can still report |
| 1130 | * fixed depth of field range</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1131 | */ |
Zhijun He | c59b078 | 2013-09-26 10:39:36 -0700 | [diff] [blame] | 1132 | public static final Key<float[]> LENS_FOCUS_RANGE = |
| 1133 | new Key<float[]>("android.lens.focusRange", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1134 | |
| 1135 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1136 | * <p>Whether optical image stabilization is |
| 1137 | * enabled.</p> |
| 1138 | * <p>Will not be supported on most devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1139 | * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF |
| 1140 | * @see #LENS_OPTICAL_STABILIZATION_MODE_ON |
| 1141 | */ |
| 1142 | public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = |
| 1143 | new Key<Integer>("android.lens.opticalStabilizationMode", int.class); |
| 1144 | |
| 1145 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1146 | * <p>Current lens status</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1147 | * @see #LENS_STATE_STATIONARY |
Igor Murashkin | 9ea4ae6 | 2013-09-11 21:40:11 -0700 | [diff] [blame] | 1148 | * @see #LENS_STATE_MOVING |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1149 | */ |
| 1150 | public static final Key<Integer> LENS_STATE = |
| 1151 | new Key<Integer>("android.lens.state", int.class); |
| 1152 | |
| 1153 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1154 | * <p>Mode of operation for the noise reduction |
| 1155 | * algorithm</p> |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 1156 | * <p>Noise filtering control. OFF means no noise reduction |
| 1157 | * will be applied by the HAL.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1158 | * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering |
| 1159 | * will be applied. HIGH_QUALITY mode indicates that the camera device |
| 1160 | * will use the highest-quality noise filtering algorithms, |
| 1161 | * even if it slows down capture rate. FAST means the camera device should not |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 1162 | * slow down capture rate when applying noise filtering.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1163 | * @see #NOISE_REDUCTION_MODE_OFF |
| 1164 | * @see #NOISE_REDUCTION_MODE_FAST |
| 1165 | * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY |
| 1166 | */ |
| 1167 | public static final Key<Integer> NOISE_REDUCTION_MODE = |
| 1168 | new Key<Integer>("android.noiseReduction.mode", int.class); |
| 1169 | |
| 1170 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1171 | * <p>Whether a result given to the framework is the |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 1172 | * final one for the capture, or only a partial that contains a |
| 1173 | * subset of the full set of dynamic metadata |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1174 | * values.</p> |
| 1175 | * <p>The entries in the result metadata buffers for a |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 1176 | * single capture may not overlap, except for this entry. The |
| 1177 | * FINAL buffers must retain FIFO ordering relative to the |
| 1178 | * requests that generate them, so the FINAL buffer for frame 3 must |
| 1179 | * always be sent to the framework after the FINAL buffer for frame 2, and |
| 1180 | * before the FINAL buffer for frame 4. PARTIAL buffers may be returned |
| 1181 | * in any order relative to other frames, but all PARTIAL buffers for a given |
| 1182 | * capture must arrive before the FINAL buffer for that capture. This entry may |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1183 | * only be used by the HAL if quirks.usePartialResult is set to 1.</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 1184 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 1185 | * @hide |
| 1186 | */ |
| 1187 | public static final Key<Boolean> QUIRKS_PARTIAL_RESULT = |
| 1188 | new Key<Boolean>("android.quirks.partialResult", boolean.class); |
| 1189 | |
| 1190 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1191 | * <p>A frame counter set by the framework. This value monotonically |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 1192 | * increases with every new result (that is, each new result has a unique |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1193 | * frameCount value).</p> |
| 1194 | * <p>Reset on release()</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1195 | */ |
| 1196 | public static final Key<Integer> REQUEST_FRAME_COUNT = |
| 1197 | new Key<Integer>("android.request.frameCount", int.class); |
| 1198 | |
| 1199 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1200 | * <p>An application-specified ID for the current |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1201 | * request. Must be maintained unchanged in output |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1202 | * frame</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1203 | * @hide |
| 1204 | */ |
| 1205 | public static final Key<Integer> REQUEST_ID = |
| 1206 | new Key<Integer>("android.request.id", int.class); |
| 1207 | |
| 1208 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1209 | * <p>(x, y, width, height).</p> |
| 1210 | * <p>A rectangle with the top-level corner of (x,y) and size |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1211 | * (width, height). The region of the sensor that is used for |
| 1212 | * output. Each stream must use this rectangle to produce its |
| 1213 | * output, cropping to a smaller region if necessary to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1214 | * maintain the stream's aspect ratio.</p> |
| 1215 | * <p>HAL2.x uses only (x, y, width)</p> |
| 1216 | * <p>Any additional per-stream cropping must be done to |
| 1217 | * maximize the final pixel area of the stream.</p> |
| 1218 | * <p>For example, if the crop region is set to a 4:3 aspect |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1219 | * ratio, then 4:3 streams should use the exact crop |
| 1220 | * region. 16:9 streams should further crop vertically |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1221 | * (letterbox).</p> |
| 1222 | * <p>Conversely, if the crop region is set to a 16:9, then 4:3 |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1223 | * outputs should crop horizontally (pillarbox), and 16:9 |
| 1224 | * streams should match exactly. These additional crops must |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1225 | * be centered within the crop region.</p> |
| 1226 | * <p>The output streams must maintain square pixels at all |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1227 | * times, no matter what the relative aspect ratios of the |
| 1228 | * crop region and the stream are. Negative values for |
| 1229 | * corner are allowed for raw output if full pixel array is |
| 1230 | * larger than active pixel array. Width and height may be |
| 1231 | * rounded to nearest larger supportable width, especially |
| 1232 | * for raw output, where only a few fixed scales may be |
| 1233 | * possible. The width and height of the crop region cannot |
| 1234 | * be set to be smaller than floor( activeArraySize.width / |
| 1235 | * android.scaler.maxDigitalZoom ) and floor( |
| 1236 | * activeArraySize.height / android.scaler.maxDigitalZoom), |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1237 | * respectively.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1238 | */ |
| 1239 | public static final Key<android.graphics.Rect> SCALER_CROP_REGION = |
| 1240 | new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); |
| 1241 | |
| 1242 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1243 | * <p>Duration each pixel is exposed to |
| 1244 | * light.</p> |
| 1245 | * <p>If the sensor can't expose this exact duration, it should shorten the |
| 1246 | * duration exposed to the nearest possible value (rather than expose longer).</p> |
| 1247 | * <p>1/10000 - 30 sec range. No bulb mode</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1248 | */ |
| 1249 | public static final Key<Long> SENSOR_EXPOSURE_TIME = |
| 1250 | new Key<Long>("android.sensor.exposureTime", long.class); |
| 1251 | |
| 1252 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1253 | * <p>Duration from start of frame exposure to |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1254 | * start of next frame exposure.</p> |
| 1255 | * <p>The maximum frame rate that can be supported by a camera subsystem is |
| 1256 | * a function of many factors:</p> |
| 1257 | * <ul> |
| 1258 | * <li>Requested resolutions of output image streams</li> |
| 1259 | * <li>Availability of binning / skipping modes on the imager</li> |
| 1260 | * <li>The bandwidth of the imager interface</li> |
| 1261 | * <li>The bandwidth of the various ISP processing blocks</li> |
| 1262 | * </ul> |
| 1263 | * <p>Since these factors can vary greatly between different ISPs and |
| 1264 | * sensors, the camera abstraction tries to represent the bandwidth |
| 1265 | * restrictions with as simple a model as possible.</p> |
| 1266 | * <p>The model presented has the following characteristics:</p> |
| 1267 | * <ul> |
| 1268 | * <li>The image sensor is always configured to output the smallest |
| 1269 | * resolution possible given the application's requested output stream |
| 1270 | * sizes. The smallest resolution is defined as being at least as large |
| 1271 | * as the largest requested output stream size; the camera pipeline must |
| 1272 | * never digitally upsample sensor data when the crop region covers the |
| 1273 | * whole sensor. In general, this means that if only small output stream |
| 1274 | * resolutions are configured, the sensor can provide a higher frame |
| 1275 | * rate.</li> |
| 1276 | * <li>Since any request may use any or all the currently configured |
| 1277 | * output streams, the sensor and ISP must be configured to support |
| 1278 | * scaling a single capture to all the streams at the same time. This |
| 1279 | * means the camera pipeline must be ready to produce the largest |
| 1280 | * requested output size without any delay. Therefore, the overall |
| 1281 | * frame rate of a given configured stream set is governed only by the |
| 1282 | * largest requested stream resolution.</li> |
| 1283 | * <li>Using more than one output stream in a request does not affect the |
| 1284 | * frame duration.</li> |
| 1285 | * <li>JPEG streams act like processed YUV streams in requests for which |
| 1286 | * they are not included; in requests in which they are directly |
| 1287 | * referenced, they act as JPEG streams. This is because supporting a |
| 1288 | * JPEG stream requires the underlying YUV data to always be ready for |
| 1289 | * use by a JPEG encoder, but the encoder will only be used (and impact |
| 1290 | * frame duration) on requests that actually reference a JPEG stream.</li> |
| 1291 | * <li>The JPEG processor can run concurrently to the rest of the camera |
| 1292 | * pipeline, but cannot process more than 1 capture at a time.</li> |
| 1293 | * </ul> |
| 1294 | * <p>The necessary information for the application, given the model above, |
| 1295 | * is provided via the android.scaler.available*MinDurations fields. |
| 1296 | * These are used to determine the maximum frame rate / minimum frame |
| 1297 | * duration that is possible for a given stream configuration.</p> |
| 1298 | * <p>Specifically, the application can use the following rules to |
| 1299 | * determine the minimum frame duration it can request from the HAL |
| 1300 | * device:</p> |
| 1301 | * <ol> |
| 1302 | * <li>Given the application's currently configured set of output |
| 1303 | * streams, <code>S</code>, divide them into three sets: streams in a JPEG format |
| 1304 | * <code>SJ</code>, streams in a raw sensor format <code>SR</code>, and the rest ('processed') |
| 1305 | * <code>SP</code>.</li> |
| 1306 | * <li>For each subset of streams, find the largest resolution (by pixel |
| 1307 | * count) in the subset. This gives (at most) three resolutions <code>RJ</code>, |
| 1308 | * <code>RR</code>, and <code>RP</code>.</li> |
| 1309 | * <li>If <code>RJ</code> is greater than <code>RP</code>, set <code>RP</code> equal to <code>RJ</code>. If there is |
| 1310 | * no exact match for <code>RP == RJ</code> (in particular there isn't an available |
| 1311 | * processed resolution at the same size as <code>RJ</code>), then set <code>RP</code> equal |
| 1312 | * to the smallest processed resolution that is larger than <code>RJ</code>. If |
| 1313 | * there are no processed resolutions larger than <code>RJ</code>, then set <code>RJ</code> to |
| 1314 | * the processed resolution closest to <code>RJ</code>.</li> |
| 1315 | * <li>If <code>RP</code> is greater than <code>RR</code>, set <code>RR</code> equal to <code>RP</code>. If there is |
| 1316 | * no exact match for <code>RR == RP</code> (in particular there isn't an available |
| 1317 | * raw resolution at the same size as <code>RP</code>), then set <code>RR</code> equal to |
| 1318 | * or to the smallest raw resolution that is larger than <code>RP</code>. If |
| 1319 | * there are no raw resolutions larger than <code>RP</code>, then set <code>RR</code> to |
| 1320 | * the raw resolution closest to <code>RP</code>.</li> |
| 1321 | * <li>Look up the matching minimum frame durations in the property lists |
| 1322 | * {@link CameraCharacteristics#SCALER_AVAILABLE_JPEG_MIN_DURATIONS android.scaler.availableJpegMinDurations}, |
| 1323 | * android.scaler.availableRawMinDurations, and |
| 1324 | * {@link CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS android.scaler.availableProcessedMinDurations}. This gives three |
| 1325 | * minimum frame durations <code>FJ</code>, <code>FR</code>, and <code>FP</code>.</li> |
| 1326 | * <li>If a stream of requests do not use a JPEG stream, then the minimum |
| 1327 | * supported frame duration for each request is <code>max(FR, FP)</code>.</li> |
| 1328 | * <li>If a stream of requests all use the JPEG stream, then the minimum |
| 1329 | * supported frame duration for each request is <code>max(FR, FP, FJ)</code>.</li> |
| 1330 | * <li>If a mix of JPEG-using and non-JPEG-using requests is submitted by |
| 1331 | * the application, then the HAL will have to delay JPEG-using requests |
| 1332 | * whenever the JPEG encoder is still busy processing an older capture. |
| 1333 | * This will happen whenever a JPEG-using request starts capture less |
| 1334 | * than <code>FJ</code> <em>ns</em> after a previous JPEG-using request. The minimum |
| 1335 | * supported frame duration will vary between the values calculated in |
| 1336 | * #6 and #7.</li> |
| 1337 | * </ol> |
| 1338 | * |
| 1339 | * @see CameraCharacteristics#SCALER_AVAILABLE_JPEG_MIN_DURATIONS |
| 1340 | * @see CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1341 | */ |
| 1342 | public static final Key<Long> SENSOR_FRAME_DURATION = |
| 1343 | new Key<Long>("android.sensor.frameDuration", long.class); |
| 1344 | |
| 1345 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1346 | * <p>Gain applied to image data. Must be |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1347 | * implemented through analog gain only if set to values |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1348 | * below 'maximum analog sensitivity'.</p> |
| 1349 | * <p>If the sensor can't apply this exact gain, it should lessen the |
| 1350 | * gain to the nearest possible value (rather than gain more).</p> |
| 1351 | * <p>ISO 12232:2006 REI method</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1352 | */ |
| 1353 | public static final Key<Integer> SENSOR_SENSITIVITY = |
| 1354 | new Key<Integer>("android.sensor.sensitivity", int.class); |
| 1355 | |
| 1356 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1357 | * <p>Time at start of exposure of first |
| 1358 | * row</p> |
| 1359 | * <p>Monotonic, should be synced to other timestamps in |
| 1360 | * system</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1361 | */ |
| 1362 | public static final Key<Long> SENSOR_TIMESTAMP = |
| 1363 | new Key<Long>("android.sensor.timestamp", long.class); |
| 1364 | |
| 1365 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1366 | * <p>The temperature of the sensor, sampled at the time |
| 1367 | * exposure began for this frame.</p> |
| 1368 | * <p>The thermal diode being queried should be inside the sensor PCB, or |
| 1369 | * somewhere close to it.</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 1370 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1371 | * <p><b>Full capability</b> - |
| 1372 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1373 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 1374 | * |
| 1375 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Igor Murashkin | d5ff06a | 2013-08-20 15:15:06 -0700 | [diff] [blame] | 1376 | */ |
| 1377 | public static final Key<Float> SENSOR_TEMPERATURE = |
| 1378 | new Key<Float>("android.sensor.temperature", float.class); |
| 1379 | |
| 1380 | /** |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 1381 | * <p>Quality of lens shading correction applied |
| 1382 | * to the image data.</p> |
| 1383 | * <p>When set to OFF mode, no lens shading correction will be applied by the |
| 1384 | * camera device, and an identity lens shading map data will be provided |
| 1385 | * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens |
| 1386 | * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>, |
| 1387 | * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map |
| 1388 | * shown below:</p> |
| 1389 | * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 1390 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 1391 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 1392 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 1393 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 1394 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] |
| 1395 | * </code></pre> |
| 1396 | * <p>When set to other modes, lens shading correction will be applied by the |
| 1397 | * camera device. Applications can request lens shading map data by setting |
| 1398 | * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide |
| 1399 | * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified |
| 1400 | * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p> |
| 1401 | * |
| 1402 | * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE |
| 1403 | * @see CaptureResult#STATISTICS_LENS_SHADING_MAP |
| 1404 | * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE |
| 1405 | * @see #SHADING_MODE_OFF |
| 1406 | * @see #SHADING_MODE_FAST |
| 1407 | * @see #SHADING_MODE_HIGH_QUALITY |
| 1408 | * @hide |
| 1409 | */ |
| 1410 | public static final Key<Integer> SHADING_MODE = |
| 1411 | new Key<Integer>("android.shading.mode", int.class); |
| 1412 | |
| 1413 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1414 | * <p>State of the face detector |
| 1415 | * unit</p> |
| 1416 | * <p>Whether face detection is enabled, and whether it |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1417 | * should output just the basic fields or the full set of |
| 1418 | * fields. Value must be one of the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1419 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p> |
| 1420 | * |
| 1421 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1422 | * @see #STATISTICS_FACE_DETECT_MODE_OFF |
| 1423 | * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE |
| 1424 | * @see #STATISTICS_FACE_DETECT_MODE_FULL |
| 1425 | */ |
| 1426 | public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = |
| 1427 | new Key<Integer>("android.statistics.faceDetectMode", int.class); |
| 1428 | |
| 1429 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1430 | * <p>List of unique IDs for detected |
| 1431 | * faces</p> |
| 1432 | * <p>Only available if faceDetectMode == FULL</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 1433 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1434 | */ |
| 1435 | public static final Key<int[]> STATISTICS_FACE_IDS = |
| 1436 | new Key<int[]>("android.statistics.faceIds", int[].class); |
| 1437 | |
| 1438 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1439 | * <p>List of landmarks for detected |
| 1440 | * faces</p> |
| 1441 | * <p>Only available if faceDetectMode == FULL</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 1442 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1443 | */ |
| 1444 | public static final Key<int[]> STATISTICS_FACE_LANDMARKS = |
| 1445 | new Key<int[]>("android.statistics.faceLandmarks", int[].class); |
| 1446 | |
| 1447 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1448 | * <p>List of the bounding rectangles for detected |
| 1449 | * faces</p> |
| 1450 | * <p>Only available if faceDetectMode != OFF</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 1451 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1452 | */ |
| 1453 | public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES = |
| 1454 | new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class); |
| 1455 | |
| 1456 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1457 | * <p>List of the face confidence scores for |
| 1458 | * detected faces</p> |
| 1459 | * <p>Only available if faceDetectMode != OFF. The value should be |
| 1460 | * meaningful (for example, setting 100 at all times is illegal).</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 1461 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1462 | */ |
| 1463 | public static final Key<byte[]> STATISTICS_FACE_SCORES = |
| 1464 | new Key<byte[]>("android.statistics.faceScores", byte[].class); |
| 1465 | |
| 1466 | /** |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 1467 | * <p>The shading map is a low-resolution floating-point map |
| 1468 | * that lists the coefficients used to correct for vignetting, for each |
| 1469 | * Bayer color channel.</p> |
| 1470 | * <p>The least shaded section of the image should have a gain factor |
| 1471 | * of 1; all other sections should have gains above 1.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1472 | * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1473 | * must take into account the colorCorrection settings.</p> |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 1474 | * <p>The shading map is for the entire active pixel array, and is not |
| 1475 | * affected by the crop region specified in the request. Each shading map |
| 1476 | * entry is the value of the shading compensation map over a specific |
| 1477 | * pixel on the sensor. Specifically, with a (N x M) resolution shading |
| 1478 | * map, and an active pixel array size (W x H), shading map entry |
| 1479 | * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at |
| 1480 | * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels. |
| 1481 | * The map is assumed to be bilinearly interpolated between the sample points.</p> |
| 1482 | * <p>The channel order is [R, Geven, Godd, B], where Geven is the green |
| 1483 | * channel for the even rows of a Bayer pattern, and Godd is the odd rows. |
| 1484 | * The shading map is stored in a fully interleaved format, and its size |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1485 | * is provided in the camera static metadata by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p> |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 1486 | * <p>The shading map should have on the order of 30-40 rows and columns, |
| 1487 | * and must be smaller than 64x64.</p> |
| 1488 | * <p>As an example, given a very small map defined as:</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1489 | * <pre><code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ] |
| 1490 | * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} = |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 1491 | * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2, |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1492 | * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3, |
| 1493 | * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, |
| 1494 | * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2, |
| 1495 | * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, |
| 1496 | * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ] |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 1497 | * </code></pre> |
| 1498 | * <p>The low-resolution scaling map images for each channel are |
| 1499 | * (displayed using nearest-neighbor interpolation):</p> |
| 1500 | * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" /> |
| 1501 | * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" /> |
| 1502 | * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" /> |
| 1503 | * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p> |
| 1504 | * <p>As a visualization only, inverting the full-color map to recover an |
| 1505 | * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p> |
| 1506 | * <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 Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1507 | * |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1508 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1509 | * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1510 | * @see CaptureResult#STATISTICS_LENS_SHADING_MAP |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1511 | */ |
| 1512 | public static final Key<float[]> STATISTICS_LENS_SHADING_MAP = |
| 1513 | new Key<float[]>("android.statistics.lensShadingMap", float[].class); |
| 1514 | |
| 1515 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1516 | * <p>The best-fit color channel gains calculated |
| 1517 | * by the HAL's statistics units for the current output frame</p> |
| 1518 | * <p>This may be different than the gains used for this frame, |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1519 | * since statistics processing on data from a new frame |
| 1520 | * typically completes after the transform has already been |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1521 | * applied to that frame.</p> |
| 1522 | * <p>The 4 channel gains are defined in Bayer domain, |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1523 | * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1524 | * <p>This value should always be calculated by the AWB block, |
| 1525 | * regardless of the android.control.* current values.</p> |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 1526 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1527 | * |
| 1528 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 1529 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1530 | */ |
| 1531 | public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS = |
| 1532 | new Key<float[]>("android.statistics.predictedColorGains", float[].class); |
| 1533 | |
| 1534 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1535 | * <p>The best-fit color transform matrix estimate |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1536 | * calculated by the HAL's statistics units for the current |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1537 | * output frame</p> |
| 1538 | * <p>The HAL must provide the estimate from its |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1539 | * statistics unit on the white balance transforms to use |
| 1540 | * for the next frame. These are the values the HAL believes |
| 1541 | * are the best fit for the current output frame. This may |
| 1542 | * be different than the transform used for this frame, since |
| 1543 | * statistics processing on data from a new frame typically |
| 1544 | * completes after the transform has already been applied to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1545 | * that frame.</p> |
| 1546 | * <p>These estimates must be provided for all frames, even if |
| 1547 | * capture settings and color transforms are set by the application.</p> |
| 1548 | * <p>This value should always be calculated by the AWB block, |
| 1549 | * regardless of the android.control.* current values.</p> |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 1550 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1551 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1552 | */ |
| 1553 | public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM = |
| 1554 | new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class); |
| 1555 | |
| 1556 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1557 | * <p>The HAL estimated scene illumination lighting |
| 1558 | * frequency</p> |
| 1559 | * <p>Report NONE if there doesn't appear to be flickering |
| 1560 | * illumination</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1561 | * @see #STATISTICS_SCENE_FLICKER_NONE |
| 1562 | * @see #STATISTICS_SCENE_FLICKER_50HZ |
| 1563 | * @see #STATISTICS_SCENE_FLICKER_60HZ |
| 1564 | */ |
| 1565 | public static final Key<Integer> STATISTICS_SCENE_FLICKER = |
| 1566 | new Key<Integer>("android.statistics.sceneFlicker", int.class); |
| 1567 | |
| 1568 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1569 | * <p>Tonemapping / contrast / gamma curve for the blue |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame^] | 1570 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 1571 | * CONTRAST_CURVE.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1572 | * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> |
| 1573 | * |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 1574 | * @see CaptureRequest#TONEMAP_CURVE_RED |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1575 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1576 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 1577 | public static final Key<float[]> TONEMAP_CURVE_BLUE = |
| 1578 | new Key<float[]>("android.tonemap.curveBlue", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1579 | |
| 1580 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1581 | * <p>Tonemapping / contrast / gamma curve for the green |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame^] | 1582 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 1583 | * CONTRAST_CURVE.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1584 | * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> |
| 1585 | * |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 1586 | * @see CaptureRequest#TONEMAP_CURVE_RED |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1587 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1588 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 1589 | public static final Key<float[]> TONEMAP_CURVE_GREEN = |
| 1590 | new Key<float[]>("android.tonemap.curveGreen", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1591 | |
| 1592 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1593 | * <p>Tonemapping / contrast / gamma curve for the red |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame^] | 1594 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 1595 | * CONTRAST_CURVE.</p> |
| 1596 | * <p>Each channel's curve is defined by an array of control points:</p> |
| 1597 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = |
| 1598 | * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] |
| 1599 | * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> |
| 1600 | * <p>These are sorted in order of increasing <code>Pin</code>; it is always |
| 1601 | * guaranteed that input values 0.0 and 1.0 are included in the list to |
| 1602 | * define a complete mapping. For input values between control points, |
| 1603 | * the camera device must linearly interpolate between the control |
| 1604 | * points.</p> |
| 1605 | * <p>Each curve can have an independent number of points, and the number |
| 1606 | * of points can be less than max (that is, the request doesn't have to |
| 1607 | * always provide a curve with number of points equivalent to |
| 1608 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
| 1609 | * <p>A few examples, and their corresponding graphical mappings; these |
| 1610 | * only specify the red channel and the precision is limited to 4 |
| 1611 | * digits, for conciseness.</p> |
| 1612 | * <p>Linear mapping:</p> |
| 1613 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 0, 1.0, 1.0 ] |
| 1614 | * </code></pre> |
| 1615 | * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> |
| 1616 | * <p>Invert mapping:</p> |
| 1617 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 1.0, 1.0, 0 ] |
| 1618 | * </code></pre> |
| 1619 | * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> |
| 1620 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
| 1621 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ |
| 1622 | * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, |
| 1623 | * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, |
| 1624 | * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, |
| 1625 | * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ] |
| 1626 | * </code></pre> |
| 1627 | * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> |
| 1628 | * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> |
| 1629 | * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ |
| 1630 | * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, |
| 1631 | * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, |
| 1632 | * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, |
| 1633 | * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ] |
| 1634 | * </code></pre> |
| 1635 | * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1636 | * |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame^] | 1637 | * @see CaptureRequest#TONEMAP_CURVE_RED |
| 1638 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1639 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1640 | */ |
| 1641 | public static final Key<float[]> TONEMAP_CURVE_RED = |
| 1642 | new Key<float[]>("android.tonemap.curveRed", float[].class); |
| 1643 | |
| 1644 | /** |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame^] | 1645 | * <p>High-level global contrast/gamma/tonemapping control.</p> |
| 1646 | * <p>When switching to an application-defined contrast curve by setting |
| 1647 | * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined |
| 1648 | * per-channel with a set of <code>(in, out)</code> points that specify the |
| 1649 | * mapping from input high-bit-depth pixel value to the output |
| 1650 | * low-bit-depth value. Since the actual pixel ranges of both input |
| 1651 | * and output may change depending on the camera pipeline, the values |
| 1652 | * are specified by normalized floating-point numbers.</p> |
| 1653 | * <p>More-complex color mapping operations such as 3D color look-up |
| 1654 | * tables, selective chroma enhancement, or other non-linear color |
| 1655 | * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 1656 | * CONTRAST_CURVE.</p> |
| 1657 | * <p>When using either FAST or HIGH_QUALITY, the camera device will |
| 1658 | * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed}, |
| 1659 | * {@link CaptureRequest#TONEMAP_CURVE_GREEN android.tonemap.curveGreen}, and {@link CaptureRequest#TONEMAP_CURVE_BLUE android.tonemap.curveBlue}. |
| 1660 | * These values are always available, and as close as possible to the |
| 1661 | * actually used nonlinear/nonglobal transforms.</p> |
| 1662 | * <p>If a request is sent with TRANSFORM_MATRIX with the camera device's |
| 1663 | * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be |
| 1664 | * roughly the same.</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 1665 | * |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame^] | 1666 | * @see CaptureRequest#TONEMAP_CURVE_BLUE |
| 1667 | * @see CaptureRequest#TONEMAP_CURVE_GREEN |
| 1668 | * @see CaptureRequest#TONEMAP_CURVE_RED |
| 1669 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1670 | * @see #TONEMAP_MODE_CONTRAST_CURVE |
| 1671 | * @see #TONEMAP_MODE_FAST |
| 1672 | * @see #TONEMAP_MODE_HIGH_QUALITY |
| 1673 | */ |
| 1674 | public static final Key<Integer> TONEMAP_MODE = |
| 1675 | new Key<Integer>("android.tonemap.mode", int.class); |
| 1676 | |
| 1677 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1678 | * <p>This LED is nominally used to indicate to the user |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1679 | * that the camera is powered on and may be streaming images back to the |
| 1680 | * Application Processor. In certain rare circumstances, the OS may |
| 1681 | * disable this when video is processed locally and not transmitted to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1682 | * any untrusted applications.</p> |
| 1683 | * <p>In particular, the LED <em>must</em> always be on when the data could be |
| 1684 | * transmitted off the device. The LED <em>should</em> always be on whenever |
| 1685 | * data is stored locally on the device.</p> |
| 1686 | * <p>The LED <em>may</em> be off if a trusted application is using the data that |
| 1687 | * doesn't violate the above rules.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1688 | * @hide |
| 1689 | */ |
| 1690 | public static final Key<Boolean> LED_TRANSMIT = |
| 1691 | new Key<Boolean>("android.led.transmit", boolean.class); |
| 1692 | |
| 1693 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1694 | * <p>Whether black-level compensation is locked |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 1695 | * to its current values, or is free to vary.</p> |
| 1696 | * <p>Whether the black level offset was locked for this frame. Should be |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1697 | * ON if {@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock} was ON in the capture request, unless |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 1698 | * a change in other capture settings forced the camera device to |
| 1699 | * perform a black level reset.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1700 | * |
| 1701 | * @see CaptureRequest#BLACK_LEVEL_LOCK |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1702 | */ |
| 1703 | public static final Key<Boolean> BLACK_LEVEL_LOCK = |
| 1704 | new Key<Boolean>("android.blackLevel.lock", boolean.class); |
| 1705 | |
| 1706 | /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 1707 | * End generated code |
| 1708 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ |
Igor Murashkin | b779ac1 | 2013-09-05 12:40:19 -0700 | [diff] [blame] | 1709 | |
| 1710 | /** |
| 1711 | * <p> |
| 1712 | * List of the {@link Face Faces} detected through camera face detection |
| 1713 | * in this result. |
| 1714 | * </p> |
| 1715 | * <p> |
| 1716 | * Only available if {@link #STATISTICS_FACE_DETECT_MODE} {@code !=} |
| 1717 | * {@link CameraMetadata#STATISTICS_FACE_DETECT_MODE_OFF OFF}. |
| 1718 | * </p> |
| 1719 | * |
| 1720 | * @see Face |
| 1721 | */ |
| 1722 | public static final Key<Face[]> STATISTICS_FACES = |
| 1723 | new Key<Face[]>("android.statistics.faces", Face[].class); |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 1724 | } |