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 | |
| 125 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 126 | * <p>A color transform matrix to use to transform |
| 127 | * from sensor RGB color space to output linear sRGB color space</p> |
| 128 | * <p>This matrix is either set by HAL when the request |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 129 | * android.colorCorrection.mode is not TRANSFORM_MATRIX, or |
| 130 | * directly by the application in the request when the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 131 | * android.colorCorrection.mode is TRANSFORM_MATRIX.</p> |
| 132 | * <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] | 133 | * for precision issues; the final rounded matrix should be |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 134 | * reported back in this matrix result metadata.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 135 | */ |
| 136 | public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM = |
| 137 | new Key<Rational[]>("android.colorCorrection.transform", Rational[].class); |
| 138 | |
| 139 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 140 | * <p>Gains applying to Bayer color channels for |
| 141 | * white-balance</p> |
| 142 | * <p>The 4-channel white-balance gains are defined in |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 143 | * the order of [R G_even G_odd B], where G_even is the gain |
| 144 | * for green pixels on even rows of the output, and G_odd |
| 145 | * is the gain for greenpixels on the odd rows. if a HAL |
| 146 | * does not support a separate gain for even/odd green channels, |
| 147 | * it should use the G_even value,and write G_odd equal to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 148 | * G_even in the output result metadata.</p> |
| 149 | * <p>This array is either set by HAL when the request |
Igor Murashkin | d5ff06a | 2013-08-20 15:15:06 -0700 | [diff] [blame] | 150 | * android.colorCorrection.mode is not TRANSFORM_MATRIX, or |
| 151 | * directly by the application in the request when the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 152 | * android.colorCorrection.mode is TRANSFORM_MATRIX.</p> |
| 153 | * <p>The ouput should be the gains actually applied by the HAL to |
| 154 | * the current frame.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 155 | */ |
| 156 | public static final Key<float[]> COLOR_CORRECTION_GAINS = |
| 157 | new Key<float[]>("android.colorCorrection.gains", float[].class); |
| 158 | |
| 159 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 160 | * <p>The ID sent with the latest |
| 161 | * CAMERA2_TRIGGER_PRECAPTURE_METERING call</p> |
| 162 | * <p>Must be 0 if no |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 163 | * CAMERA2_TRIGGER_PRECAPTURE_METERING trigger received yet |
| 164 | * by HAL. Always updated even if AE algorithm ignores the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 165 | * trigger</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 166 | * |
| 167 | * @hide |
| 168 | */ |
| 169 | public static final Key<Integer> CONTROL_AE_PRECAPTURE_ID = |
| 170 | new Key<Integer>("android.control.aePrecaptureId", int.class); |
| 171 | |
| 172 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 173 | * <p>List of areas to use for |
| 174 | * metering</p> |
| 175 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 176 | * xmax, ymax, weight. The rectangle is defined inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 177 | * specified coordinates.</p> |
| 178 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 179 | * with (0,0) being the top-left pixel in the active pixel array, and |
| 180 | * (android.sensor.info.activeArraySize.width - 1, |
| 181 | * android.sensor.info.activeArraySize.height - 1) being the |
| 182 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 183 | * should be nonnegative.</p> |
| 184 | * <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] | 185 | * needs to be used by the HAL. If the metering region is |
| 186 | * outside the current android.scaler.cropRegion, the HAL |
| 187 | * should ignore the sections outside the region and output the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 188 | * used sections in the frame metadata</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 189 | */ |
| 190 | public static final Key<int[]> CONTROL_AE_REGIONS = |
| 191 | new Key<int[]>("android.control.aeRegions", int[].class); |
| 192 | |
| 193 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 194 | * <p>Current state of AE algorithm</p> |
| 195 | * <p>Whenever the AE algorithm state changes, a |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 196 | * MSG_AUTOEXPOSURE notification must be send if a |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 197 | * notification callback is registered.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 198 | * @see #CONTROL_AE_STATE_INACTIVE |
| 199 | * @see #CONTROL_AE_STATE_SEARCHING |
| 200 | * @see #CONTROL_AE_STATE_CONVERGED |
| 201 | * @see #CONTROL_AE_STATE_LOCKED |
| 202 | * @see #CONTROL_AE_STATE_FLASH_REQUIRED |
| 203 | * @see #CONTROL_AE_STATE_PRECAPTURE |
| 204 | */ |
| 205 | public static final Key<Integer> CONTROL_AE_STATE = |
| 206 | new Key<Integer>("android.control.aeState", int.class); |
| 207 | |
| 208 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 209 | * <p>Whether AF is currently enabled, and what |
| 210 | * mode it is set to</p> |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame^] | 211 | * <p>Only effective if android.control.mode = AUTO.</p> |
| 212 | * <p>If lens is controlled by HAL auto-focus algorithm, the HAL should |
| 213 | * report the current AF status in android.control.afState in |
| 214 | * result metadata.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 215 | * @see #CONTROL_AF_MODE_OFF |
| 216 | * @see #CONTROL_AF_MODE_AUTO |
| 217 | * @see #CONTROL_AF_MODE_MACRO |
| 218 | * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO |
| 219 | * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE |
| 220 | * @see #CONTROL_AF_MODE_EDOF |
| 221 | */ |
| 222 | public static final Key<Integer> CONTROL_AF_MODE = |
| 223 | new Key<Integer>("android.control.afMode", int.class); |
| 224 | |
| 225 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 226 | * <p>List of areas to use for focus |
| 227 | * estimation</p> |
| 228 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 229 | * xmax, ymax, weight. The rectangle is defined inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 230 | * specified coordinates.</p> |
| 231 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 232 | * with (0,0) being the top-left pixel in the active pixel array, and |
| 233 | * (android.sensor.info.activeArraySize.width - 1, |
| 234 | * android.sensor.info.activeArraySize.height - 1) being the |
| 235 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 236 | * should be nonnegative.</p> |
| 237 | * <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] | 238 | * needs to be used by the HAL. If the focusing region is |
| 239 | * outside the current android.scaler.cropRegion, the HAL |
| 240 | * should ignore the sections outside the region and output the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 241 | * used sections in the frame metadata</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 242 | */ |
| 243 | public static final Key<int[]> CONTROL_AF_REGIONS = |
| 244 | new Key<int[]>("android.control.afRegions", int[].class); |
| 245 | |
| 246 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 247 | * <p>Current state of AF algorithm</p> |
| 248 | * <p>Whenever the AF algorithm state changes, a |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 249 | * MSG_AUTOFOCUS notification must be send if a notification |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 250 | * callback is registered.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 251 | * @see #CONTROL_AF_STATE_INACTIVE |
| 252 | * @see #CONTROL_AF_STATE_PASSIVE_SCAN |
| 253 | * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED |
| 254 | * @see #CONTROL_AF_STATE_ACTIVE_SCAN |
| 255 | * @see #CONTROL_AF_STATE_FOCUSED_LOCKED |
| 256 | * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED |
Eino-Ville Talvala | 9f880f7 | 2013-09-20 17:50:41 -0700 | [diff] [blame] | 257 | * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 258 | */ |
| 259 | public static final Key<Integer> CONTROL_AF_STATE = |
| 260 | new Key<Integer>("android.control.afState", int.class); |
| 261 | |
| 262 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 263 | * <p>The ID sent with the latest |
| 264 | * CAMERA2_TRIGGER_AUTOFOCUS call</p> |
| 265 | * <p>Must be 0 if no CAMERA2_TRIGGER_AUTOFOCUS trigger |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 266 | * received yet by HAL. Always updated even if AF algorithm |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 267 | * ignores the trigger</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 268 | * |
| 269 | * @hide |
| 270 | */ |
| 271 | public static final Key<Integer> CONTROL_AF_TRIGGER_ID = |
| 272 | new Key<Integer>("android.control.afTriggerId", int.class); |
| 273 | |
| 274 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 275 | * <p>Whether AWB is currently setting the color |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 276 | * transform fields, and what its illumination target |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 277 | * is</p> |
| 278 | * <p>[BC - AWB lock,AWB modes]</p> |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame^] | 279 | * <p>Only effective if android.control.mode = AUTO.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 280 | * @see #CONTROL_AWB_MODE_OFF |
| 281 | * @see #CONTROL_AWB_MODE_AUTO |
| 282 | * @see #CONTROL_AWB_MODE_INCANDESCENT |
| 283 | * @see #CONTROL_AWB_MODE_FLUORESCENT |
| 284 | * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT |
| 285 | * @see #CONTROL_AWB_MODE_DAYLIGHT |
| 286 | * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT |
| 287 | * @see #CONTROL_AWB_MODE_TWILIGHT |
| 288 | * @see #CONTROL_AWB_MODE_SHADE |
| 289 | */ |
| 290 | public static final Key<Integer> CONTROL_AWB_MODE = |
| 291 | new Key<Integer>("android.control.awbMode", int.class); |
| 292 | |
| 293 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 294 | * <p>List of areas to use for illuminant |
| 295 | * estimation</p> |
| 296 | * <p>Only used in AUTO mode.</p> |
| 297 | * <p>Each area is a rectangle plus weight: xmin, ymin, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 298 | * xmax, ymax, weight. The rectangle is defined inclusive of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 299 | * specified coordinates.</p> |
| 300 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 301 | * with (0,0) being the top-left pixel in the active pixel array, and |
| 302 | * (android.sensor.info.activeArraySize.width - 1, |
| 303 | * android.sensor.info.activeArraySize.height - 1) being the |
| 304 | * bottom-right pixel in the active pixel array. The weight |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 305 | * should be nonnegative.</p> |
| 306 | * <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] | 307 | * needs to be used by the HAL. If the metering region is |
| 308 | * outside the current android.scaler.cropRegion, the HAL |
| 309 | * should ignore the sections outside the region and output the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 310 | * used sections in the frame metadata</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 311 | */ |
| 312 | public static final Key<int[]> CONTROL_AWB_REGIONS = |
| 313 | new Key<int[]>("android.control.awbRegions", int[].class); |
| 314 | |
| 315 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 316 | * <p>Current state of AWB algorithm</p> |
| 317 | * <p>Whenever the AWB algorithm state changes, a |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 318 | * MSG_AUTOWHITEBALANCE notification must be send if a |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 319 | * notification callback is registered.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 320 | * @see #CONTROL_AWB_STATE_INACTIVE |
| 321 | * @see #CONTROL_AWB_STATE_SEARCHING |
| 322 | * @see #CONTROL_AWB_STATE_CONVERGED |
| 323 | * @see #CONTROL_AWB_STATE_LOCKED |
| 324 | */ |
| 325 | public static final Key<Integer> CONTROL_AWB_STATE = |
| 326 | new Key<Integer>("android.control.awbState", int.class); |
| 327 | |
| 328 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 329 | * <p>Overall mode of 3A control |
| 330 | * routines</p> |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame^] | 331 | * <p>High-level 3A control. When set to OFF, all 3A control |
| 332 | * by the HAL is disabled. The application must set the fields for |
| 333 | * capture parameters itself.</p> |
| 334 | * <p>When set to AUTO, the individual algorithm controls in |
| 335 | * android.control.* are in effect, such as android.control.afMode.</p> |
| 336 | * <p>When set to USE_SCENE_MODE, the individual controls in |
| 337 | * android.control.* are mostly disabled, and the HAL implements |
| 338 | * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) |
| 339 | * as it wishes. The HAL scene mode 3A settings are provided by |
| 340 | * android.control.sceneModeOverrides.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 341 | * @see #CONTROL_MODE_OFF |
| 342 | * @see #CONTROL_MODE_AUTO |
| 343 | * @see #CONTROL_MODE_USE_SCENE_MODE |
| 344 | */ |
| 345 | public static final Key<Integer> CONTROL_MODE = |
| 346 | new Key<Integer>("android.control.mode", int.class); |
| 347 | |
| 348 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 349 | * <p>Operation mode for edge |
| 350 | * enhancement</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 351 | * @see #EDGE_MODE_OFF |
| 352 | * @see #EDGE_MODE_FAST |
| 353 | * @see #EDGE_MODE_HIGH_QUALITY |
| 354 | */ |
| 355 | public static final Key<Integer> EDGE_MODE = |
| 356 | new Key<Integer>("android.edge.mode", int.class); |
| 357 | |
| 358 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 359 | * <p>Select flash operation mode</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 360 | * @see #FLASH_MODE_OFF |
| 361 | * @see #FLASH_MODE_SINGLE |
| 362 | * @see #FLASH_MODE_TORCH |
| 363 | */ |
| 364 | public static final Key<Integer> FLASH_MODE = |
| 365 | new Key<Integer>("android.flash.mode", int.class); |
| 366 | |
| 367 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 368 | * <p>Current state of the flash |
| 369 | * unit</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 370 | * @see #FLASH_STATE_UNAVAILABLE |
| 371 | * @see #FLASH_STATE_CHARGING |
| 372 | * @see #FLASH_STATE_READY |
| 373 | * @see #FLASH_STATE_FIRED |
| 374 | */ |
| 375 | public static final Key<Integer> FLASH_STATE = |
| 376 | new Key<Integer>("android.flash.state", int.class); |
| 377 | |
| 378 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 379 | * <p>GPS coordinates to include in output JPEG |
| 380 | * EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 381 | */ |
| 382 | public static final Key<double[]> JPEG_GPS_COORDINATES = |
| 383 | new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); |
| 384 | |
| 385 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 386 | * <p>32 characters describing GPS algorithm to |
| 387 | * include in EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 388 | */ |
| 389 | public static final Key<String> JPEG_GPS_PROCESSING_METHOD = |
| 390 | new Key<String>("android.jpeg.gpsProcessingMethod", String.class); |
| 391 | |
| 392 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 393 | * <p>Time GPS fix was made to include in |
| 394 | * EXIF</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 395 | */ |
| 396 | public static final Key<Long> JPEG_GPS_TIMESTAMP = |
| 397 | new Key<Long>("android.jpeg.gpsTimestamp", long.class); |
| 398 | |
| 399 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 400 | * <p>Orientation of JPEG image to |
| 401 | * write</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 402 | */ |
| 403 | public static final Key<Integer> JPEG_ORIENTATION = |
| 404 | new Key<Integer>("android.jpeg.orientation", int.class); |
| 405 | |
| 406 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 407 | * <p>Compression quality of the final JPEG |
| 408 | * image</p> |
| 409 | * <p>85-95 is typical usage range</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 410 | */ |
| 411 | public static final Key<Byte> JPEG_QUALITY = |
| 412 | new Key<Byte>("android.jpeg.quality", byte.class); |
| 413 | |
| 414 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 415 | * <p>Compression quality of JPEG |
| 416 | * thumbnail</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 417 | */ |
| 418 | public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = |
| 419 | new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); |
| 420 | |
| 421 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 422 | * <p>Resolution of embedded JPEG |
| 423 | * thumbnail</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 424 | */ |
| 425 | public static final Key<android.hardware.camera2.Size> JPEG_THUMBNAIL_SIZE = |
| 426 | new Key<android.hardware.camera2.Size>("android.jpeg.thumbnailSize", android.hardware.camera2.Size.class); |
| 427 | |
| 428 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 429 | * <p>Size of the lens aperture</p> |
| 430 | * <p>Will not be supported on most devices. Can only |
| 431 | * pick from supported list</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 432 | */ |
| 433 | public static final Key<Float> LENS_APERTURE = |
| 434 | new Key<Float>("android.lens.aperture", float.class); |
| 435 | |
| 436 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 437 | * <p>State of lens neutral density |
| 438 | * filter(s)</p> |
| 439 | * <p>Will not be supported on most devices. Can only |
| 440 | * pick from supported list</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 441 | */ |
| 442 | public static final Key<Float> LENS_FILTER_DENSITY = |
| 443 | new Key<Float>("android.lens.filterDensity", float.class); |
| 444 | |
| 445 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 446 | * <p>Lens optical zoom setting</p> |
| 447 | * <p>Will not be supported on most devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 448 | */ |
| 449 | public static final Key<Float> LENS_FOCAL_LENGTH = |
| 450 | new Key<Float>("android.lens.focalLength", float.class); |
| 451 | |
| 452 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 453 | * <p>Distance to plane of sharpest focus, |
| 454 | * measured from frontmost surface of the lens</p> |
| 455 | * <p>Should be zero for fixed-focus cameras</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 456 | */ |
| 457 | public static final Key<Float> LENS_FOCUS_DISTANCE = |
| 458 | new Key<Float>("android.lens.focusDistance", float.class); |
| 459 | |
| 460 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 461 | * <p>The range of scene distances that are in |
| 462 | * sharp focus (depth of field)</p> |
| 463 | * <p>If variable focus not supported, can still report |
| 464 | * fixed depth of field range</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 465 | */ |
Zhijun He | c59b078 | 2013-09-26 10:39:36 -0700 | [diff] [blame] | 466 | public static final Key<float[]> LENS_FOCUS_RANGE = |
| 467 | new Key<float[]>("android.lens.focusRange", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 468 | |
| 469 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 470 | * <p>Whether optical image stabilization is |
| 471 | * enabled.</p> |
| 472 | * <p>Will not be supported on most devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 473 | * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF |
| 474 | * @see #LENS_OPTICAL_STABILIZATION_MODE_ON |
| 475 | */ |
| 476 | public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = |
| 477 | new Key<Integer>("android.lens.opticalStabilizationMode", int.class); |
| 478 | |
| 479 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 480 | * <p>Current lens status</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 481 | * @see #LENS_STATE_STATIONARY |
Igor Murashkin | 9ea4ae6 | 2013-09-11 21:40:11 -0700 | [diff] [blame] | 482 | * @see #LENS_STATE_MOVING |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 483 | */ |
| 484 | public static final Key<Integer> LENS_STATE = |
| 485 | new Key<Integer>("android.lens.state", int.class); |
| 486 | |
| 487 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 488 | * <p>Mode of operation for the noise reduction |
| 489 | * algorithm</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 490 | * @see #NOISE_REDUCTION_MODE_OFF |
| 491 | * @see #NOISE_REDUCTION_MODE_FAST |
| 492 | * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY |
| 493 | */ |
| 494 | public static final Key<Integer> NOISE_REDUCTION_MODE = |
| 495 | new Key<Integer>("android.noiseReduction.mode", int.class); |
| 496 | |
| 497 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 498 | * <p>Whether a result given to the framework is the |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 499 | * final one for the capture, or only a partial that contains a |
| 500 | * subset of the full set of dynamic metadata |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 501 | * values.</p> |
| 502 | * <p>The entries in the result metadata buffers for a |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 503 | * single capture may not overlap, except for this entry. The |
| 504 | * FINAL buffers must retain FIFO ordering relative to the |
| 505 | * requests that generate them, so the FINAL buffer for frame 3 must |
| 506 | * always be sent to the framework after the FINAL buffer for frame 2, and |
| 507 | * before the FINAL buffer for frame 4. PARTIAL buffers may be returned |
| 508 | * in any order relative to other frames, but all PARTIAL buffers for a given |
| 509 | * 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] | 510 | * only be used by the HAL if quirks.usePartialResult is set to 1.</p> |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 511 | * |
| 512 | * <b>Optional</b> - This value may be null on some devices. |
| 513 | * |
| 514 | * @hide |
| 515 | */ |
| 516 | public static final Key<Boolean> QUIRKS_PARTIAL_RESULT = |
| 517 | new Key<Boolean>("android.quirks.partialResult", boolean.class); |
| 518 | |
| 519 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 520 | * <p>A frame counter set by the framework. This value monotonically |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 521 | * 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] | 522 | * frameCount value).</p> |
| 523 | * <p>Reset on release()</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 524 | */ |
| 525 | public static final Key<Integer> REQUEST_FRAME_COUNT = |
| 526 | new Key<Integer>("android.request.frameCount", int.class); |
| 527 | |
| 528 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 529 | * <p>An application-specified ID for the current |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 530 | * request. Must be maintained unchanged in output |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 531 | * frame</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 532 | * |
| 533 | * @hide |
| 534 | */ |
| 535 | public static final Key<Integer> REQUEST_ID = |
| 536 | new Key<Integer>("android.request.id", int.class); |
| 537 | |
| 538 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 539 | * <p>(x, y, width, height).</p> |
| 540 | * <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] | 541 | * (width, height). The region of the sensor that is used for |
| 542 | * output. Each stream must use this rectangle to produce its |
| 543 | * output, cropping to a smaller region if necessary to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 544 | * maintain the stream's aspect ratio.</p> |
| 545 | * <p>HAL2.x uses only (x, y, width)</p> |
| 546 | * <p>Any additional per-stream cropping must be done to |
| 547 | * maximize the final pixel area of the stream.</p> |
| 548 | * <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] | 549 | * ratio, then 4:3 streams should use the exact crop |
| 550 | * region. 16:9 streams should further crop vertically |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 551 | * (letterbox).</p> |
| 552 | * <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] | 553 | * outputs should crop horizontally (pillarbox), and 16:9 |
| 554 | * streams should match exactly. These additional crops must |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 555 | * be centered within the crop region.</p> |
| 556 | * <p>The output streams must maintain square pixels at all |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 557 | * times, no matter what the relative aspect ratios of the |
| 558 | * crop region and the stream are. Negative values for |
| 559 | * corner are allowed for raw output if full pixel array is |
| 560 | * larger than active pixel array. Width and height may be |
| 561 | * rounded to nearest larger supportable width, especially |
| 562 | * for raw output, where only a few fixed scales may be |
| 563 | * possible. The width and height of the crop region cannot |
| 564 | * be set to be smaller than floor( activeArraySize.width / |
| 565 | * android.scaler.maxDigitalZoom ) and floor( |
| 566 | * activeArraySize.height / android.scaler.maxDigitalZoom), |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 567 | * respectively.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 568 | */ |
| 569 | public static final Key<android.graphics.Rect> SCALER_CROP_REGION = |
| 570 | new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); |
| 571 | |
| 572 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 573 | * <p>Duration each pixel is exposed to |
| 574 | * light.</p> |
| 575 | * <p>If the sensor can't expose this exact duration, it should shorten the |
| 576 | * duration exposed to the nearest possible value (rather than expose longer).</p> |
| 577 | * <p>1/10000 - 30 sec range. No bulb mode</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 578 | */ |
| 579 | public static final Key<Long> SENSOR_EXPOSURE_TIME = |
| 580 | new Key<Long>("android.sensor.exposureTime", long.class); |
| 581 | |
| 582 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 583 | * <p>Duration from start of frame exposure to |
| 584 | * start of next frame exposure</p> |
| 585 | * <p>Exposure time has priority, so duration is set to |
| 586 | * max(duration, exposure time + overhead)</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 587 | */ |
| 588 | public static final Key<Long> SENSOR_FRAME_DURATION = |
| 589 | new Key<Long>("android.sensor.frameDuration", long.class); |
| 590 | |
| 591 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 592 | * <p>Gain applied to image data. Must be |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 593 | * implemented through analog gain only if set to values |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 594 | * below 'maximum analog sensitivity'.</p> |
| 595 | * <p>If the sensor can't apply this exact gain, it should lessen the |
| 596 | * gain to the nearest possible value (rather than gain more).</p> |
| 597 | * <p>ISO 12232:2006 REI method</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 598 | */ |
| 599 | public static final Key<Integer> SENSOR_SENSITIVITY = |
| 600 | new Key<Integer>("android.sensor.sensitivity", int.class); |
| 601 | |
| 602 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 603 | * <p>Time at start of exposure of first |
| 604 | * row</p> |
| 605 | * <p>Monotonic, should be synced to other timestamps in |
| 606 | * system</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 607 | */ |
| 608 | public static final Key<Long> SENSOR_TIMESTAMP = |
| 609 | new Key<Long>("android.sensor.timestamp", long.class); |
| 610 | |
| 611 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 612 | * <p>The temperature of the sensor, sampled at the time |
| 613 | * exposure began for this frame.</p> |
| 614 | * <p>The thermal diode being queried should be inside the sensor PCB, or |
| 615 | * somewhere close to it.</p> |
Alex Ray | e83c4eb | 2013-10-02 17:14:36 -0700 | [diff] [blame] | 616 | * |
| 617 | * <b>Optional</b> - This value may be null on some devices. |
| 618 | * |
| 619 | * <b>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL}</b> - |
| 620 | * Present on all devices that report being FULL level hardware devices in the |
| 621 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL HARDWARE_LEVEL} key. |
Igor Murashkin | d5ff06a | 2013-08-20 15:15:06 -0700 | [diff] [blame] | 622 | */ |
| 623 | public static final Key<Float> SENSOR_TEMPERATURE = |
| 624 | new Key<Float>("android.sensor.temperature", float.class); |
| 625 | |
| 626 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 627 | * <p>State of the face detector |
| 628 | * unit</p> |
| 629 | * <p>Whether face detection is enabled, and whether it |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 630 | * should output just the basic fields or the full set of |
| 631 | * fields. Value must be one of the |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 632 | * android.statistics.info.availableFaceDetectModes.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 633 | * @see #STATISTICS_FACE_DETECT_MODE_OFF |
| 634 | * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE |
| 635 | * @see #STATISTICS_FACE_DETECT_MODE_FULL |
| 636 | */ |
| 637 | public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = |
| 638 | new Key<Integer>("android.statistics.faceDetectMode", int.class); |
| 639 | |
| 640 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 641 | * <p>List of unique IDs for detected |
| 642 | * faces</p> |
| 643 | * <p>Only available if faceDetectMode == FULL</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 644 | * |
| 645 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 646 | */ |
| 647 | public static final Key<int[]> STATISTICS_FACE_IDS = |
| 648 | new Key<int[]>("android.statistics.faceIds", int[].class); |
| 649 | |
| 650 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 651 | * <p>List of landmarks for detected |
| 652 | * faces</p> |
| 653 | * <p>Only available if faceDetectMode == FULL</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 654 | * |
| 655 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 656 | */ |
| 657 | public static final Key<int[]> STATISTICS_FACE_LANDMARKS = |
| 658 | new Key<int[]>("android.statistics.faceLandmarks", int[].class); |
| 659 | |
| 660 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 661 | * <p>List of the bounding rectangles for detected |
| 662 | * faces</p> |
| 663 | * <p>Only available if faceDetectMode != OFF</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 664 | * |
| 665 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 666 | */ |
| 667 | public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES = |
| 668 | new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class); |
| 669 | |
| 670 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 671 | * <p>List of the face confidence scores for |
| 672 | * detected faces</p> |
| 673 | * <p>Only available if faceDetectMode != OFF. The value should be |
| 674 | * meaningful (for example, setting 100 at all times is illegal).</p> |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 675 | * |
| 676 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 677 | */ |
| 678 | public static final Key<byte[]> STATISTICS_FACE_SCORES = |
| 679 | new Key<byte[]>("android.statistics.faceScores", byte[].class); |
| 680 | |
| 681 | /** |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 682 | * <p>The shading map is a low-resolution floating-point map |
| 683 | * that lists the coefficients used to correct for vignetting, for each |
| 684 | * Bayer color channel.</p> |
| 685 | * <p>The least shaded section of the image should have a gain factor |
| 686 | * of 1; all other sections should have gains above 1.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 687 | * <p>When android.colorCorrection.mode = TRANSFORM_MATRIX, the map |
| 688 | * must take into account the colorCorrection settings.</p> |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 689 | * <p>The shading map is for the entire active pixel array, and is not |
| 690 | * affected by the crop region specified in the request. Each shading map |
| 691 | * entry is the value of the shading compensation map over a specific |
| 692 | * pixel on the sensor. Specifically, with a (N x M) resolution shading |
| 693 | * map, and an active pixel array size (W x H), shading map entry |
| 694 | * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at |
| 695 | * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels. |
| 696 | * The map is assumed to be bilinearly interpolated between the sample points.</p> |
| 697 | * <p>The channel order is [R, Geven, Godd, B], where Geven is the green |
| 698 | * channel for the even rows of a Bayer pattern, and Godd is the odd rows. |
| 699 | * The shading map is stored in a fully interleaved format, and its size |
| 700 | * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p> |
| 701 | * <p>The shading map should have on the order of 30-40 rows and columns, |
| 702 | * and must be smaller than 64x64.</p> |
| 703 | * <p>As an example, given a very small map defined as:</p> |
| 704 | * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ] |
| 705 | * android.statistics.lensShadingMap = |
| 706 | * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2, |
| 707 | * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3, |
| 708 | * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, |
| 709 | * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2, |
| 710 | * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, |
| 711 | * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ] |
| 712 | * </code></pre> |
| 713 | * <p>The low-resolution scaling map images for each channel are |
| 714 | * (displayed using nearest-neighbor interpolation):</p> |
| 715 | * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" /> |
| 716 | * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" /> |
| 717 | * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" /> |
| 718 | * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p> |
| 719 | * <p>As a visualization only, inverting the full-color map to recover an |
| 720 | * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p> |
| 721 | * <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 | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 722 | */ |
| 723 | public static final Key<float[]> STATISTICS_LENS_SHADING_MAP = |
| 724 | new Key<float[]>("android.statistics.lensShadingMap", float[].class); |
| 725 | |
| 726 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 727 | * <p>The best-fit color channel gains calculated |
| 728 | * by the HAL's statistics units for the current output frame</p> |
| 729 | * <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] | 730 | * since statistics processing on data from a new frame |
| 731 | * typically completes after the transform has already been |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 732 | * applied to that frame.</p> |
| 733 | * <p>The 4 channel gains are defined in Bayer domain, |
| 734 | * see android.colorCorrection.gains for details.</p> |
| 735 | * <p>This value should always be calculated by the AWB block, |
| 736 | * regardless of the android.control.* current values.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 737 | */ |
| 738 | public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS = |
| 739 | new Key<float[]>("android.statistics.predictedColorGains", float[].class); |
| 740 | |
| 741 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 742 | * <p>The best-fit color transform matrix estimate |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 743 | * calculated by the HAL's statistics units for the current |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 744 | * output frame</p> |
| 745 | * <p>The HAL must provide the estimate from its |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 746 | * statistics unit on the white balance transforms to use |
| 747 | * for the next frame. These are the values the HAL believes |
| 748 | * are the best fit for the current output frame. This may |
| 749 | * be different than the transform used for this frame, since |
| 750 | * statistics processing on data from a new frame typically |
| 751 | * completes after the transform has already been applied to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 752 | * that frame.</p> |
| 753 | * <p>These estimates must be provided for all frames, even if |
| 754 | * capture settings and color transforms are set by the application.</p> |
| 755 | * <p>This value should always be calculated by the AWB block, |
| 756 | * regardless of the android.control.* current values.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 757 | */ |
| 758 | public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM = |
| 759 | new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class); |
| 760 | |
| 761 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 762 | * <p>The HAL estimated scene illumination lighting |
| 763 | * frequency</p> |
| 764 | * <p>Report NONE if there doesn't appear to be flickering |
| 765 | * illumination</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 766 | * @see #STATISTICS_SCENE_FLICKER_NONE |
| 767 | * @see #STATISTICS_SCENE_FLICKER_50HZ |
| 768 | * @see #STATISTICS_SCENE_FLICKER_60HZ |
| 769 | */ |
| 770 | public static final Key<Integer> STATISTICS_SCENE_FLICKER = |
| 771 | new Key<Integer>("android.statistics.sceneFlicker", int.class); |
| 772 | |
| 773 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 774 | * <p>Table mapping blue input values to output |
| 775 | * values</p> |
| 776 | * <p>Tonemapping / contrast / gamma curve for the blue |
| 777 | * channel, to use when android.tonemap.mode is CONTRAST_CURVE.</p> |
| 778 | * <p>See android.tonemap.curveRed for more details.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 779 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 780 | public static final Key<float[]> TONEMAP_CURVE_BLUE = |
| 781 | new Key<float[]>("android.tonemap.curveBlue", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 782 | |
| 783 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 784 | * <p>Table mapping green input values to output |
| 785 | * values</p> |
| 786 | * <p>Tonemapping / contrast / gamma curve for the green |
| 787 | * channel, to use when android.tonemap.mode is CONTRAST_CURVE.</p> |
| 788 | * <p>See android.tonemap.curveRed for more details.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 789 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 790 | public static final Key<float[]> TONEMAP_CURVE_GREEN = |
| 791 | new Key<float[]>("android.tonemap.curveGreen", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 792 | |
| 793 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 794 | * <p>Table mapping red input values to output |
| 795 | * values</p> |
| 796 | * <p>Tonemapping / contrast / gamma curve for the red |
| 797 | * channel, to use when android.tonemap.mode is CONTRAST_CURVE.</p> |
| 798 | * <p>Since the input and output ranges may vary depending on |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 799 | * the camera pipeline, the input and output pixel values |
| 800 | * are represented by normalized floating-point values |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 801 | * between 0 and 1, with 0 == black and 1 == white.</p> |
| 802 | * <p>The curve should be linearly interpolated between the |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 803 | * defined points. The points will be listed in increasing |
| 804 | * order of P_IN. For example, if the array is: [0.0, 0.0, |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 805 | * 0.3, 0.5, 1.0, 1.0], then the input->output mapping |
| 806 | * for a few sample points would be: 0 -> 0, 0.15 -> |
| 807 | * 0.25, 0.3 -> 0.5, 0.5 -> 0.64</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 808 | */ |
| 809 | public static final Key<float[]> TONEMAP_CURVE_RED = |
| 810 | new Key<float[]>("android.tonemap.curveRed", float[].class); |
| 811 | |
| 812 | /** |
| 813 | * @see #TONEMAP_MODE_CONTRAST_CURVE |
| 814 | * @see #TONEMAP_MODE_FAST |
| 815 | * @see #TONEMAP_MODE_HIGH_QUALITY |
| 816 | */ |
| 817 | public static final Key<Integer> TONEMAP_MODE = |
| 818 | new Key<Integer>("android.tonemap.mode", int.class); |
| 819 | |
| 820 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 821 | * <p>This LED is nominally used to indicate to the user |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 822 | * that the camera is powered on and may be streaming images back to the |
| 823 | * Application Processor. In certain rare circumstances, the OS may |
| 824 | * disable this when video is processed locally and not transmitted to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 825 | * any untrusted applications.</p> |
| 826 | * <p>In particular, the LED <em>must</em> always be on when the data could be |
| 827 | * transmitted off the device. The LED <em>should</em> always be on whenever |
| 828 | * data is stored locally on the device.</p> |
| 829 | * <p>The LED <em>may</em> be off if a trusted application is using the data that |
| 830 | * doesn't violate the above rules.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 831 | * |
| 832 | * @hide |
| 833 | */ |
| 834 | public static final Key<Boolean> LED_TRANSMIT = |
| 835 | new Key<Boolean>("android.led.transmit", boolean.class); |
| 836 | |
| 837 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 838 | * <p>Whether black-level compensation is locked |
| 839 | * to its current values, or is free to vary</p> |
| 840 | * <p>Whether the black level offset was locked for this frame. |
| 841 | * Should be ON if android.blackLevel.lock was ON in the capture request, |
| 842 | * unless a change in capture settings forced a black level reset.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 843 | */ |
| 844 | public static final Key<Boolean> BLACK_LEVEL_LOCK = |
| 845 | new Key<Boolean>("android.blackLevel.lock", boolean.class); |
| 846 | |
| 847 | /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 848 | * End generated code |
| 849 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ |
Igor Murashkin | b779ac1 | 2013-09-05 12:40:19 -0700 | [diff] [blame] | 850 | |
| 851 | /** |
| 852 | * <p> |
| 853 | * List of the {@link Face Faces} detected through camera face detection |
| 854 | * in this result. |
| 855 | * </p> |
| 856 | * <p> |
| 857 | * Only available if {@link #STATISTICS_FACE_DETECT_MODE} {@code !=} |
| 858 | * {@link CameraMetadata#STATISTICS_FACE_DETECT_MODE_OFF OFF}. |
| 859 | * </p> |
| 860 | * |
| 861 | * @see Face |
| 862 | */ |
| 863 | public static final Key<Face[]> STATISTICS_FACES = |
| 864 | new Key<Face[]>("android.statistics.faces", Face[].class); |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 865 | } |