Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Eino-Ville 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 | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 19 | import android.annotation.NonNull; |
| 20 | import android.annotation.Nullable; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 21 | import android.hardware.camera2.impl.CameraMetadataNative; |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 22 | import android.hardware.camera2.impl.PublicKey; |
| 23 | import android.hardware.camera2.impl.SyntheticKey; |
Ruben Brunk | 5776aaf | 2014-06-19 13:42:40 -0700 | [diff] [blame] | 24 | import android.hardware.camera2.utils.HashCodeHelpers; |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 25 | import android.hardware.camera2.utils.TypeReference; |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 26 | import android.os.Parcel; |
| 27 | import android.os.Parcelable; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 28 | import android.view.Surface; |
| 29 | |
Ruben Brunk | feb50af | 2014-05-09 19:58:49 -0700 | [diff] [blame] | 30 | import java.util.Collection; |
| 31 | import java.util.Collections; |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 32 | import java.util.HashSet; |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 33 | import java.util.List; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 34 | import java.util.Objects; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 35 | |
| 36 | |
| 37 | /** |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 38 | * <p>An immutable package of settings and outputs needed to capture a single |
| 39 | * image from the camera device.</p> |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 40 | * |
| 41 | * <p>Contains the configuration for the capture hardware (sensor, lens, flash), |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 42 | * the processing pipeline, the control algorithms, and the output buffers. Also |
| 43 | * contains the list of target Surfaces to send image data to for this |
| 44 | * capture.</p> |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 45 | * |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 46 | * <p>CaptureRequests can be created by using a {@link Builder} instance, |
| 47 | * obtained by calling {@link CameraDevice#createCaptureRequest}</p> |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 48 | * |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 49 | * <p>CaptureRequests are given to {@link CameraCaptureSession#capture} or |
| 50 | * {@link CameraCaptureSession#setRepeatingRequest} to capture images from a camera.</p> |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 51 | * |
| 52 | * <p>Each request can specify a different subset of target Surfaces for the |
| 53 | * camera to send the captured data to. All the surfaces used in a request must |
| 54 | * be part of the surface list given to the last call to |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 55 | * {@link CameraDevice#createCaptureSession}, when the request is submitted to the |
| 56 | * session.</p> |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 57 | * |
| 58 | * <p>For example, a request meant for repeating preview might only include the |
| 59 | * Surface for the preview SurfaceView or SurfaceTexture, while a |
| 60 | * high-resolution still capture would also include a Surface from a ImageReader |
| 61 | * configured for high-resolution JPEG images.</p> |
| 62 | * |
Eino-Ville Talvala | 0aa2bde | 2015-05-19 17:25:54 -0700 | [diff] [blame] | 63 | * <p>A reprocess capture request allows a previously-captured image from the camera device to be |
| 64 | * sent back to the device for further processing. It can be created with |
Eino-Ville Talvala | bd7f34f | 2015-05-21 11:10:51 -0700 | [diff] [blame] | 65 | * {@link CameraDevice#createReprocessCaptureRequest}, and used with a reprocessable capture session |
Eino-Ville Talvala | 0aa2bde | 2015-05-19 17:25:54 -0700 | [diff] [blame] | 66 | * created with {@link CameraDevice#createReprocessableCaptureSession}.</p> |
| 67 | * |
| 68 | * @see CameraCaptureSession#capture |
| 69 | * @see CameraCaptureSession#setRepeatingRequest |
| 70 | * @see CameraCaptureSession#captureBurst |
| 71 | * @see CameraCaptureSession#setRepeatingBurst |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 72 | * @see CameraDevice#createCaptureRequest |
Eino-Ville Talvala | 0aa2bde | 2015-05-19 17:25:54 -0700 | [diff] [blame] | 73 | * @see CameraDevice#createReprocessCaptureRequest |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 74 | */ |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 75 | public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> |
| 76 | implements Parcelable { |
| 77 | |
| 78 | /** |
| 79 | * A {@code Key} is used to do capture request field lookups with |
| 80 | * {@link CaptureResult#get} or to set fields with |
| 81 | * {@link CaptureRequest.Builder#set(Key, Object)}. |
| 82 | * |
| 83 | * <p>For example, to set the crop rectangle for the next capture: |
| 84 | * <code><pre> |
| 85 | * Rect cropRectangle = new Rect(0, 0, 640, 480); |
| 86 | * captureRequestBuilder.set(SCALER_CROP_REGION, cropRectangle); |
| 87 | * </pre></code> |
| 88 | * </p> |
| 89 | * |
| 90 | * <p>To enumerate over all possible keys for {@link CaptureResult}, see |
| 91 | * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p> |
| 92 | * |
| 93 | * @see CaptureResult#get |
| 94 | * @see CameraCharacteristics#getAvailableCaptureResultKeys |
| 95 | */ |
| 96 | public final static class Key<T> { |
| 97 | private final CameraMetadataNative.Key<T> mKey; |
| 98 | |
| 99 | /** |
| 100 | * Visible for testing and vendor extensions only. |
| 101 | * |
| 102 | * @hide |
| 103 | */ |
| 104 | public Key(String name, Class<T> type) { |
| 105 | mKey = new CameraMetadataNative.Key<T>(name, type); |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Visible for testing and vendor extensions only. |
| 110 | * |
| 111 | * @hide |
| 112 | */ |
| 113 | public Key(String name, TypeReference<T> typeReference) { |
| 114 | mKey = new CameraMetadataNative.Key<T>(name, typeReference); |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * Return a camelCase, period separated name formatted like: |
| 119 | * {@code "root.section[.subsections].name"}. |
| 120 | * |
| 121 | * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."}; |
| 122 | * keys that are device/platform-specific are prefixed with {@code "com."}.</p> |
| 123 | * |
| 124 | * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would |
| 125 | * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device |
| 126 | * specific key might look like {@code "com.google.nexus.data.private"}.</p> |
| 127 | * |
| 128 | * @return String representation of the key name |
| 129 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 130 | @NonNull |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 131 | public String getName() { |
| 132 | return mKey.getName(); |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * {@inheritDoc} |
| 137 | */ |
| 138 | @Override |
| 139 | public final int hashCode() { |
| 140 | return mKey.hashCode(); |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * {@inheritDoc} |
| 145 | */ |
| 146 | @SuppressWarnings("unchecked") |
| 147 | @Override |
| 148 | public final boolean equals(Object o) { |
| 149 | return o instanceof Key && ((Key<T>)o).mKey.equals(mKey); |
| 150 | } |
| 151 | |
| 152 | /** |
Chien-Yu Chen | 12a8385 | 2015-07-07 12:17:22 -0700 | [diff] [blame] | 153 | * Return this {@link Key} as a string representation. |
| 154 | * |
| 155 | * <p>{@code "CaptureRequest.Key(%s)"}, where {@code %s} represents |
| 156 | * the name of this key as returned by {@link #getName}.</p> |
| 157 | * |
| 158 | * @return string representation of {@link Key} |
| 159 | */ |
| 160 | @NonNull |
| 161 | @Override |
| 162 | public String toString() { |
| 163 | return String.format("CaptureRequest.Key(%s)", mKey.getName()); |
| 164 | } |
| 165 | |
| 166 | /** |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 167 | * Visible for CameraMetadataNative implementation only; do not use. |
| 168 | * |
| 169 | * TODO: Make this private or remove it altogether. |
| 170 | * |
| 171 | * @hide |
| 172 | */ |
| 173 | public CameraMetadataNative.Key<T> getNativeKey() { |
| 174 | return mKey; |
| 175 | } |
| 176 | |
| 177 | @SuppressWarnings({ "unchecked" }) |
| 178 | /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) { |
| 179 | mKey = (CameraMetadataNative.Key<T>) nativeKey; |
| 180 | } |
| 181 | } |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 182 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 183 | private final HashSet<Surface> mSurfaceSet; |
| 184 | private final CameraMetadataNative mSettings; |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 185 | private boolean mIsReprocess; |
Zhijun He | a767772 | 2015-06-01 16:36:06 -0700 | [diff] [blame] | 186 | // If this request is part of constrained high speed request list that was created by |
Eino-Ville Talvala | 639fffe | 2015-06-30 10:34:48 -0700 | [diff] [blame] | 187 | // {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList} |
Zhijun He | a767772 | 2015-06-01 16:36:06 -0700 | [diff] [blame] | 188 | private boolean mIsPartOfCHSRequestList = false; |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 189 | // Each reprocess request must be tied to a reprocessable session ID. |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 190 | // Valid only for reprocess requests (mIsReprocess == true). |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 191 | private int mReprocessableSessionId; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 192 | |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 193 | private Object mUserTag; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 194 | |
| 195 | /** |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 196 | * Construct empty request. |
| 197 | * |
| 198 | * Used by Binder to unparcel this object only. |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 199 | */ |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 200 | private CaptureRequest() { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 201 | mSettings = new CameraMetadataNative(); |
| 202 | mSurfaceSet = new HashSet<Surface>(); |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 203 | mIsReprocess = false; |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 204 | mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | /** |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 208 | * Clone from source capture request. |
| 209 | * |
| 210 | * Used by the Builder to create an immutable copy. |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 211 | */ |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 212 | @SuppressWarnings("unchecked") |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 213 | private CaptureRequest(CaptureRequest source) { |
| 214 | mSettings = new CameraMetadataNative(source.mSettings); |
| 215 | mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone(); |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 216 | mIsReprocess = source.mIsReprocess; |
Zhijun He | a767772 | 2015-06-01 16:36:06 -0700 | [diff] [blame] | 217 | mIsPartOfCHSRequestList = source.mIsPartOfCHSRequestList; |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 218 | mReprocessableSessionId = source.mReprocessableSessionId; |
Eino-Ville Talvala | 7b01c5c | 2013-10-08 19:34:29 -0700 | [diff] [blame] | 219 | mUserTag = source.mUserTag; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | /** |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 223 | * Take ownership of passed-in settings. |
| 224 | * |
| 225 | * Used by the Builder to create a mutable CaptureRequest. |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 226 | * |
| 227 | * @param settings Settings for this capture request. |
| 228 | * @param isReprocess Indicates whether to create a reprocess capture request. {@code true} |
| 229 | * to create a reprocess capture request. {@code false} to create a regular |
| 230 | * capture request. |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 231 | * @param reprocessableSessionId The ID of the camera capture session this capture is created |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 232 | * for. This is used to validate if the application submits a |
| 233 | * reprocess capture request to the same session where |
| 234 | * the {@link TotalCaptureResult}, used to create the reprocess |
| 235 | * capture, came from. |
| 236 | * |
| 237 | * @throws IllegalArgumentException If creating a reprocess capture request with an invalid |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 238 | * reprocessableSessionId. |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 239 | * |
| 240 | * @see CameraDevice#createReprocessCaptureRequest |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 241 | */ |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 242 | private CaptureRequest(CameraMetadataNative settings, boolean isReprocess, |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 243 | int reprocessableSessionId) { |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 244 | mSettings = CameraMetadataNative.move(settings); |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 245 | mSurfaceSet = new HashSet<Surface>(); |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 246 | mIsReprocess = isReprocess; |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 247 | if (isReprocess) { |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 248 | if (reprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) { |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 249 | throw new IllegalArgumentException("Create a reprocess capture request with an " + |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 250 | "invalid session ID: " + reprocessableSessionId); |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 251 | } |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 252 | mReprocessableSessionId = reprocessableSessionId; |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 253 | } else { |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 254 | mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE; |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 255 | } |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 256 | } |
| 257 | |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 258 | /** |
| 259 | * Get a capture request field value. |
| 260 | * |
| 261 | * <p>The field definitions can be found in {@link CaptureRequest}.</p> |
| 262 | * |
| 263 | * <p>Querying the value for the same key more than once will return a value |
| 264 | * which is equal to the previous queried value.</p> |
| 265 | * |
| 266 | * @throws IllegalArgumentException if the key was not valid |
| 267 | * |
| 268 | * @param key The result field to read. |
| 269 | * @return The value of that key, or {@code null} if the field is not set. |
| 270 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 271 | @Nullable |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 272 | public <T> T get(Key<T> key) { |
| 273 | return mSettings.get(key); |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 274 | } |
| 275 | |
| 276 | /** |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 277 | * {@inheritDoc} |
| 278 | * @hide |
| 279 | */ |
| 280 | @SuppressWarnings("unchecked") |
| 281 | @Override |
| 282 | protected <T> T getProtected(Key<?> key) { |
| 283 | return (T) mSettings.get(key); |
| 284 | } |
| 285 | |
| 286 | /** |
| 287 | * {@inheritDoc} |
| 288 | * @hide |
| 289 | */ |
| 290 | @SuppressWarnings("unchecked") |
| 291 | @Override |
| 292 | protected Class<Key<?>> getKeyClass() { |
| 293 | Object thisClass = Key.class; |
| 294 | return (Class<Key<?>>)thisClass; |
| 295 | } |
| 296 | |
| 297 | /** |
| 298 | * {@inheritDoc} |
| 299 | */ |
| 300 | @Override |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 301 | @NonNull |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 302 | public List<Key<?>> getKeys() { |
| 303 | // Force the javadoc for this function to show up on the CaptureRequest page |
| 304 | return super.getKeys(); |
| 305 | } |
| 306 | |
| 307 | /** |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 308 | * Retrieve the tag for this request, if any. |
| 309 | * |
| 310 | * <p>This tag is not used for anything by the camera device, but can be |
| 311 | * used by an application to easily identify a CaptureRequest when it is |
| 312 | * returned by |
Eino-Ville Talvala | fd88743 | 2014-09-04 13:07:40 -0700 | [diff] [blame] | 313 | * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted} |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 314 | * </p> |
| 315 | * |
| 316 | * @return the last tag Object set on this request, or {@code null} if |
| 317 | * no tag has been set. |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 318 | * @see Builder#setTag |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 319 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 320 | @Nullable |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 321 | public Object getTag() { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 322 | return mUserTag; |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 323 | } |
| 324 | |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 325 | /** |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 326 | * Determine if this is a reprocess capture request. |
| 327 | * |
| 328 | * <p>A reprocess capture request produces output images from an input buffer from the |
| 329 | * {@link CameraCaptureSession}'s input {@link Surface}. A reprocess capture request can be |
| 330 | * created by {@link CameraDevice#createReprocessCaptureRequest}.</p> |
| 331 | * |
| 332 | * @return {@code true} if this is a reprocess capture request. {@code false} if this is not a |
| 333 | * reprocess capture request. |
| 334 | * |
| 335 | * @see CameraDevice#createReprocessCaptureRequest |
| 336 | */ |
| 337 | public boolean isReprocess() { |
| 338 | return mIsReprocess; |
| 339 | } |
| 340 | |
| 341 | /** |
Zhijun He | a767772 | 2015-06-01 16:36:06 -0700 | [diff] [blame] | 342 | * <p>Determine if this request is part of a constrained high speed request list that was |
Eino-Ville Talvala | 639fffe | 2015-06-30 10:34:48 -0700 | [diff] [blame] | 343 | * created by |
| 344 | * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}. |
| 345 | * A constrained high speed request list contains some constrained high speed capture requests |
| 346 | * with certain interleaved pattern that is suitable for high speed preview/video streaming. An |
| 347 | * active constrained high speed capture session only accepts constrained high speed request |
| 348 | * lists. This method can be used to do the sanity check when a constrained high speed capture |
| 349 | * session receives a request list via {@link CameraCaptureSession#setRepeatingBurst} or |
| 350 | * {@link CameraCaptureSession#captureBurst}. </p> |
Zhijun He | a767772 | 2015-06-01 16:36:06 -0700 | [diff] [blame] | 351 | * |
| 352 | * |
| 353 | * @return {@code true} if this request is part of a constrained high speed request list, |
| 354 | * {@code false} otherwise. |
| 355 | * |
| 356 | * @hide |
| 357 | */ |
| 358 | public boolean isPartOfCRequestList() { |
| 359 | return mIsPartOfCHSRequestList; |
| 360 | } |
| 361 | |
| 362 | /** |
| 363 | * Returns a copy of the underlying {@link CameraMetadataNative}. |
| 364 | * @hide |
| 365 | */ |
| 366 | public CameraMetadataNative getNativeCopy() { |
| 367 | return new CameraMetadataNative(mSettings); |
| 368 | } |
| 369 | |
| 370 | /** |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 371 | * Get the reprocessable session ID this reprocess capture request is associated with. |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 372 | * |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 373 | * @return the reprocessable session ID this reprocess capture request is associated with |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 374 | * |
| 375 | * @throws IllegalStateException if this capture request is not a reprocess capture request. |
| 376 | * @hide |
| 377 | */ |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 378 | public int getReprocessableSessionId() { |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 379 | if (mIsReprocess == false || |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 380 | mReprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) { |
| 381 | throw new IllegalStateException("Getting the reprocessable session ID for a "+ |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 382 | "non-reprocess capture request is illegal."); |
| 383 | } |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 384 | return mReprocessableSessionId; |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 385 | } |
| 386 | |
| 387 | /** |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 388 | * Determine whether this CaptureRequest is equal to another CaptureRequest. |
| 389 | * |
| 390 | * <p>A request is considered equal to another is if it's set of key/values is equal, it's |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 391 | * list of output surfaces is equal, the user tag is equal, and the return values of |
| 392 | * isReprocess() are equal.</p> |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 393 | * |
| 394 | * @param other Another instance of CaptureRequest. |
| 395 | * |
| 396 | * @return True if the requests are the same, false otherwise. |
| 397 | */ |
| 398 | @Override |
| 399 | public boolean equals(Object other) { |
| 400 | return other instanceof CaptureRequest |
| 401 | && equals((CaptureRequest)other); |
| 402 | } |
| 403 | |
| 404 | private boolean equals(CaptureRequest other) { |
| 405 | return other != null |
| 406 | && Objects.equals(mUserTag, other.mUserTag) |
| 407 | && mSurfaceSet.equals(other.mSurfaceSet) |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 408 | && mSettings.equals(other.mSettings) |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 409 | && mIsReprocess == other.mIsReprocess |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 410 | && mReprocessableSessionId == other.mReprocessableSessionId; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 411 | } |
| 412 | |
| 413 | @Override |
| 414 | public int hashCode() { |
Eino-Ville Talvala | 0819c75 | 2015-06-17 11:34:41 -0700 | [diff] [blame] | 415 | return HashCodeHelpers.hashCodeGeneric(mSettings, mSurfaceSet, mUserTag); |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 416 | } |
| 417 | |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 418 | public static final Parcelable.Creator<CaptureRequest> CREATOR = |
| 419 | new Parcelable.Creator<CaptureRequest>() { |
| 420 | @Override |
| 421 | public CaptureRequest createFromParcel(Parcel in) { |
| 422 | CaptureRequest request = new CaptureRequest(); |
| 423 | request.readFromParcel(in); |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 424 | |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 425 | return request; |
| 426 | } |
| 427 | |
| 428 | @Override |
| 429 | public CaptureRequest[] newArray(int size) { |
| 430 | return new CaptureRequest[size]; |
| 431 | } |
| 432 | }; |
| 433 | |
| 434 | /** |
| 435 | * Expand this object from a Parcel. |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 436 | * Hidden since this breaks the immutability of CaptureRequest, but is |
| 437 | * needed to receive CaptureRequests with aidl. |
| 438 | * |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 439 | * @param in The parcel from which the object should be read |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 440 | * @hide |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 441 | */ |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 442 | private void readFromParcel(Parcel in) { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 443 | mSettings.readFromParcel(in); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 444 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 445 | mSurfaceSet.clear(); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 446 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 447 | Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader()); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 448 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 449 | if (parcelableArray == null) { |
| 450 | return; |
| 451 | } |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 452 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 453 | for (Parcelable p : parcelableArray) { |
| 454 | Surface s = (Surface) p; |
| 455 | mSurfaceSet.add(s); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 456 | } |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 457 | |
| 458 | mIsReprocess = (in.readInt() == 0) ? false : true; |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 459 | mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE; |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 460 | } |
| 461 | |
| 462 | @Override |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 463 | public int describeContents() { |
| 464 | return 0; |
| 465 | } |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 466 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 467 | @Override |
| 468 | public void writeToParcel(Parcel dest, int flags) { |
| 469 | mSettings.writeToParcel(dest, flags); |
| 470 | dest.writeParcelableArray(mSurfaceSet.toArray(new Surface[mSurfaceSet.size()]), flags); |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 471 | dest.writeInt(mIsReprocess ? 1 : 0); |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 472 | } |
| 473 | |
| 474 | /** |
Ruben Brunk | feb50af | 2014-05-09 19:58:49 -0700 | [diff] [blame] | 475 | * @hide |
| 476 | */ |
| 477 | public boolean containsTarget(Surface surface) { |
| 478 | return mSurfaceSet.contains(surface); |
| 479 | } |
| 480 | |
| 481 | /** |
| 482 | * @hide |
| 483 | */ |
| 484 | public Collection<Surface> getTargets() { |
| 485 | return Collections.unmodifiableCollection(mSurfaceSet); |
| 486 | } |
| 487 | |
| 488 | /** |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 489 | * A builder for capture requests. |
| 490 | * |
| 491 | * <p>To obtain a builder instance, use the |
| 492 | * {@link CameraDevice#createCaptureRequest} method, which initializes the |
| 493 | * request fields to one of the templates defined in {@link CameraDevice}. |
| 494 | * |
| 495 | * @see CameraDevice#createCaptureRequest |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 496 | * @see CameraDevice#TEMPLATE_PREVIEW |
| 497 | * @see CameraDevice#TEMPLATE_RECORD |
| 498 | * @see CameraDevice#TEMPLATE_STILL_CAPTURE |
| 499 | * @see CameraDevice#TEMPLATE_VIDEO_SNAPSHOT |
| 500 | * @see CameraDevice#TEMPLATE_MANUAL |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 501 | */ |
| 502 | public final static class Builder { |
| 503 | |
Igor Murashkin | 7a36a0f | 2013-09-10 18:13:09 -0700 | [diff] [blame] | 504 | private final CaptureRequest mRequest; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 505 | |
| 506 | /** |
| 507 | * Initialize the builder using the template; the request takes |
| 508 | * ownership of the template. |
| 509 | * |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 510 | * @param template Template settings for this capture request. |
| 511 | * @param reprocess Indicates whether to create a reprocess capture request. {@code true} |
| 512 | * to create a reprocess capture request. {@code false} to create a regular |
| 513 | * capture request. |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 514 | * @param reprocessableSessionId The ID of the camera capture session this capture is |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 515 | * created for. This is used to validate if the application |
| 516 | * submits a reprocess capture request to the same session |
| 517 | * where the {@link TotalCaptureResult}, used to create the |
| 518 | * reprocess capture, came from. |
| 519 | * |
| 520 | * @throws IllegalArgumentException If creating a reprocess capture request with an invalid |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 521 | * reprocessableSessionId. |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 522 | * @hide |
| 523 | */ |
Chien-Yu Chen | 7a316f6b | 2015-04-13 14:31:45 -0700 | [diff] [blame] | 524 | public Builder(CameraMetadataNative template, boolean reprocess, |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 525 | int reprocessableSessionId) { |
| 526 | mRequest = new CaptureRequest(template, reprocess, reprocessableSessionId); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 527 | } |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 528 | |
| 529 | /** |
| 530 | * <p>Add a surface to the list of targets for this request</p> |
| 531 | * |
| 532 | * <p>The Surface added must be one of the surfaces included in the most |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 533 | * recent call to {@link CameraDevice#createCaptureSession}, when the |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 534 | * request is given to the camera device.</p> |
| 535 | * |
| 536 | * <p>Adding a target more than once has no effect.</p> |
| 537 | * |
| 538 | * @param outputTarget Surface to use as an output target for this request |
| 539 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 540 | public void addTarget(@NonNull Surface outputTarget) { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 541 | mRequest.mSurfaceSet.add(outputTarget); |
| 542 | } |
| 543 | |
| 544 | /** |
| 545 | * <p>Remove a surface from the list of targets for this request.</p> |
| 546 | * |
| 547 | * <p>Removing a target that is not currently added has no effect.</p> |
| 548 | * |
| 549 | * @param outputTarget Surface to use as an output target for this request |
| 550 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 551 | public void removeTarget(@NonNull Surface outputTarget) { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 552 | mRequest.mSurfaceSet.remove(outputTarget); |
| 553 | } |
| 554 | |
| 555 | /** |
| 556 | * Set a capture request field to a value. The field definitions can be |
| 557 | * found in {@link CaptureRequest}. |
| 558 | * |
Eino-Ville Talvala | d840727 | 2015-11-08 18:27:20 -0800 | [diff] [blame] | 559 | * <p>Setting a field to {@code null} will remove that field from the capture request. |
| 560 | * Unless the field is optional, removing it will likely produce an error from the camera |
| 561 | * device when the request is submitted.</p> |
| 562 | * |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 563 | * @param key The metadata field to write. |
| 564 | * @param value The value to set the field to, which must be of a matching |
| 565 | * type to the key. |
| 566 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 567 | public <T> void set(@NonNull Key<T> key, T value) { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 568 | mRequest.mSettings.set(key, value); |
| 569 | } |
| 570 | |
| 571 | /** |
| 572 | * Get a capture request field value. The field definitions can be |
| 573 | * found in {@link CaptureRequest}. |
| 574 | * |
| 575 | * @throws IllegalArgumentException if the key was not valid |
| 576 | * |
| 577 | * @param key The metadata field to read. |
| 578 | * @return The value of that key, or {@code null} if the field is not set. |
| 579 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 580 | @Nullable |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 581 | public <T> T get(Key<T> key) { |
| 582 | return mRequest.mSettings.get(key); |
| 583 | } |
| 584 | |
| 585 | /** |
| 586 | * Set a tag for this request. |
| 587 | * |
| 588 | * <p>This tag is not used for anything by the camera device, but can be |
| 589 | * used by an application to easily identify a CaptureRequest when it is |
| 590 | * returned by |
Eino-Ville Talvala | fd88743 | 2014-09-04 13:07:40 -0700 | [diff] [blame] | 591 | * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted} |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 592 | * |
| 593 | * @param tag an arbitrary Object to store with this request |
| 594 | * @see CaptureRequest#getTag |
| 595 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 596 | public void setTag(@Nullable Object tag) { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 597 | mRequest.mUserTag = tag; |
| 598 | } |
| 599 | |
| 600 | /** |
Zhijun He | a767772 | 2015-06-01 16:36:06 -0700 | [diff] [blame] | 601 | * <p>Mark this request as part of a constrained high speed request list created by |
Eino-Ville Talvala | 639fffe | 2015-06-30 10:34:48 -0700 | [diff] [blame] | 602 | * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}. |
| 603 | * A constrained high speed request list contains some constrained high speed capture |
| 604 | * requests with certain interleaved pattern that is suitable for high speed preview/video |
| 605 | * streaming.</p> |
Zhijun He | a767772 | 2015-06-01 16:36:06 -0700 | [diff] [blame] | 606 | * |
| 607 | * @hide |
| 608 | */ |
| 609 | public void setPartOfCHSRequestList(boolean partOfCHSList) { |
| 610 | mRequest.mIsPartOfCHSRequestList = partOfCHSList; |
| 611 | } |
| 612 | |
| 613 | /** |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 614 | * Build a request using the current target Surfaces and settings. |
Sol Boucher | edeab40 | 2014-07-09 18:36:28 -0700 | [diff] [blame] | 615 | * <p>Note that, although it is possible to create a {@code CaptureRequest} with no target |
| 616 | * {@link Surface}s, passing such a request into {@link CameraCaptureSession#capture}, |
| 617 | * {@link CameraCaptureSession#captureBurst}, |
| 618 | * {@link CameraCaptureSession#setRepeatingBurst}, or |
| 619 | * {@link CameraCaptureSession#setRepeatingRequest} will cause that method to throw an |
| 620 | * {@link IllegalArgumentException}.</p> |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 621 | * |
| 622 | * @return A new capture request instance, ready for submission to the |
| 623 | * camera device. |
| 624 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 625 | @NonNull |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 626 | public CaptureRequest build() { |
| 627 | return new CaptureRequest(mRequest); |
| 628 | } |
| 629 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 630 | /** |
| 631 | * @hide |
| 632 | */ |
| 633 | public boolean isEmpty() { |
| 634 | return mRequest.mSettings.isEmpty(); |
| 635 | } |
| 636 | |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 637 | } |
| 638 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 639 | /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 640 | * The key entries below this point are generated from metadata |
| 641 | * definitions in /system/media/camera/docs. Do not modify by hand or |
| 642 | * modify the comment blocks at the start or end. |
| 643 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ |
| 644 | |
| 645 | /** |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 646 | * <p>The mode control selects how the image data is converted from the |
| 647 | * sensor's native color into linear sRGB color.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 648 | * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 649 | * control is overridden by the AWB routine. When AWB is disabled, the |
| 650 | * application controls how the color mapping is performed.</p> |
| 651 | * <p>We define the expected processing pipeline below. For consistency |
| 652 | * across devices, this is always the case with TRANSFORM_MATRIX.</p> |
| 653 | * <p>When either FULL or HIGH_QUALITY is used, the camera device may |
| 654 | * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 655 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the |
| 656 | * camera device (in the results) and be roughly correct.</p> |
| 657 | * <p>Switching to TRANSFORM_MATRIX and using the data provided from |
| 658 | * FAST or HIGH_QUALITY will yield a picture with the same white point |
| 659 | * as what was produced by the camera device in the earlier frame.</p> |
| 660 | * <p>The expected processing pipeline is as follows:</p> |
| 661 | * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p> |
| 662 | * <p>The white balance is encoded by two values, a 4-channel white-balance |
| 663 | * gain vector (applied in the Bayer domain), and a 3x3 color transform |
| 664 | * matrix (applied after demosaic).</p> |
| 665 | * <p>The 4-channel white-balance gains are defined as:</p> |
| 666 | * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ] |
| 667 | * </code></pre> |
| 668 | * <p>where <code>G_even</code> is the gain for green pixels on even rows of the |
| 669 | * output, and <code>G_odd</code> is the gain for green pixels on the odd rows. |
| 670 | * These may be identical for a given camera device implementation; if |
| 671 | * the camera device does not support a separate gain for even/odd green |
| 672 | * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to |
| 673 | * <code>G_even</code> in the output result metadata.</p> |
| 674 | * <p>The matrices for color transforms are defined as a 9-entry vector:</p> |
| 675 | * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ] |
| 676 | * </code></pre> |
| 677 | * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>, |
| 678 | * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p> |
| 679 | * <p>with colors as follows:</p> |
| 680 | * <pre><code>r' = I0r + I1g + I2b |
| 681 | * g' = I3r + I4g + I5b |
| 682 | * b' = I6r + I7g + I8b |
| 683 | * </code></pre> |
| 684 | * <p>Both the input and output value ranges must match. Overflow/underflow |
| 685 | * values are clipped to fit within the range.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 686 | * <p><b>Possible values:</b> |
| 687 | * <ul> |
| 688 | * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li> |
| 689 | * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li> |
| 690 | * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 691 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 692 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 693 | * <p><b>Full capability</b> - |
| 694 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 695 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 696 | * |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 697 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
| 698 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 699 | * @see CaptureRequest#CONTROL_AWB_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 700 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 701 | * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX |
| 702 | * @see #COLOR_CORRECTION_MODE_FAST |
| 703 | * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY |
| 704 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 705 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 706 | public static final Key<Integer> COLOR_CORRECTION_MODE = |
| 707 | new Key<Integer>("android.colorCorrection.mode", int.class); |
| 708 | |
| 709 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 710 | * <p>A color transform matrix to use to transform |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 711 | * from sensor RGB color space to output linear sRGB color space.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 712 | * <p>This matrix is either set by the camera device when the request |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 713 | * {@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] | 714 | * directly by the application in the request when the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 715 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 716 | * <p>In the latter case, the camera device may round the matrix to account |
| 717 | * for precision issues; the final rounded matrix should be reported back |
| 718 | * in this matrix result metadata. The transform should keep the magnitude |
| 719 | * of the output color values within <code>[0, 1.0]</code> (assuming input color |
| 720 | * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p> |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 721 | * <p>The valid range of each matrix element varies on different devices, but |
| 722 | * values within [-1.5, 3.0] are guaranteed not to be clipped.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 723 | * <p><b>Units</b>: Unitless scale factors</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 724 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 725 | * <p><b>Full capability</b> - |
| 726 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 727 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 728 | * |
| 729 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 730 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 731 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 732 | @PublicKey |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 733 | public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM = |
| 734 | new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 735 | |
| 736 | /** |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 737 | * <p>Gains applying to Bayer raw color channels for |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 738 | * white-balance.</p> |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 739 | * <p>These per-channel gains are either set by the camera device |
| 740 | * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not |
| 741 | * TRANSFORM_MATRIX, or directly by the application in the |
| 742 | * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is |
| 743 | * TRANSFORM_MATRIX.</p> |
| 744 | * <p>The gains in the result metadata are the gains actually |
| 745 | * applied by the camera device to the current frame.</p> |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 746 | * <p>The valid range of gains varies on different devices, but gains |
| 747 | * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given |
| 748 | * device allows gains below 1.0, this is usually not recommended because |
| 749 | * this can create color artifacts.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 750 | * <p><b>Units</b>: Unitless gain factors</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 751 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 752 | * <p><b>Full capability</b> - |
| 753 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 754 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 755 | * |
| 756 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 757 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 758 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 759 | @PublicKey |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 760 | public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS = |
| 761 | new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 762 | |
| 763 | /** |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 764 | * <p>Mode of operation for the chromatic aberration correction algorithm.</p> |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 765 | * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light |
| 766 | * can not focus on the same point after exiting from the lens. This metadata defines |
| 767 | * the high level control of chromatic aberration correction algorithm, which aims to |
| 768 | * minimize the chromatic artifacts that may occur along the object boundaries in an |
| 769 | * image.</p> |
| 770 | * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration |
| 771 | * correction will be applied. HIGH_QUALITY mode indicates that the camera device will |
| 772 | * use the highest-quality aberration correction algorithms, even if it slows down |
| 773 | * capture rate. FAST means the camera device will not slow down capture rate when |
| 774 | * applying aberration correction.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 775 | * <p>LEGACY devices will always be in FAST mode.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 776 | * <p><b>Possible values:</b> |
| 777 | * <ul> |
| 778 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li> |
| 779 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li> |
| 780 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 781 | * </ul></p> |
| 782 | * <p><b>Available values for this device:</b><br> |
| 783 | * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 784 | * <p>This key is available on all devices.</p> |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 785 | * |
Zhijun He | 9e4e439 | 2014-08-18 11:12:32 -0700 | [diff] [blame] | 786 | * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES |
| 787 | * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF |
| 788 | * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST |
| 789 | * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 790 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 791 | @PublicKey |
Zhijun He | 9e4e439 | 2014-08-18 11:12:32 -0700 | [diff] [blame] | 792 | public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE = |
| 793 | new Key<Integer>("android.colorCorrection.aberrationMode", int.class); |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 794 | |
| 795 | /** |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 796 | * <p>The desired setting for the camera device's auto-exposure |
| 797 | * algorithm's antibanding compensation.</p> |
| 798 | * <p>Some kinds of lighting fixtures, such as some fluorescent |
| 799 | * lights, flicker at the rate of the power supply frequency |
| 800 | * (60Hz or 50Hz, depending on country). While this is |
| 801 | * typically not noticeable to a person, it can be visible to |
| 802 | * a camera device. If a camera sets its exposure time to the |
| 803 | * wrong value, the flicker may become visible in the |
| 804 | * viewfinder as flicker or in a final captured image, as a |
| 805 | * set of variable-brightness bands across the image.</p> |
| 806 | * <p>Therefore, the auto-exposure routines of camera devices |
| 807 | * include antibanding routines that ensure that the chosen |
| 808 | * exposure value will not cause such banding. The choice of |
| 809 | * exposure time depends on the rate of flicker, which the |
| 810 | * camera device can detect automatically, or the expected |
| 811 | * rate can be selected by the application using this |
| 812 | * control.</p> |
| 813 | * <p>A given camera device may not support all of the possible |
| 814 | * options for the antibanding mode. The |
| 815 | * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains |
| 816 | * the available modes for a given camera device.</p> |
Yin-Chia Yeh | 7b2cae6 | 2014-11-25 11:54:18 -0800 | [diff] [blame] | 817 | * <p>AUTO mode is the default if it is available on given |
| 818 | * camera device. When AUTO mode is not available, the |
| 819 | * default will be either 50HZ or 60HZ, and both 50HZ |
| 820 | * and 60HZ will be available.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 821 | * <p>If manual exposure control is enabled (by setting |
| 822 | * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF), |
| 823 | * then this setting has no effect, and the application must |
| 824 | * ensure it selects exposure times that do not cause banding |
| 825 | * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist |
| 826 | * the application in this.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 827 | * <p><b>Possible values:</b> |
| 828 | * <ul> |
| 829 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li> |
| 830 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li> |
| 831 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li> |
| 832 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li> |
| 833 | * </ul></p> |
| 834 | * <p><b>Available values for this device:</b><br></p> |
| 835 | * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 836 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 837 | * |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 838 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 839 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 840 | * @see CaptureRequest#CONTROL_MODE |
| 841 | * @see CaptureResult#STATISTICS_SCENE_FLICKER |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 842 | * @see #CONTROL_AE_ANTIBANDING_MODE_OFF |
| 843 | * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ |
| 844 | * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ |
| 845 | * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO |
| 846 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 847 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 848 | public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = |
| 849 | new Key<Integer>("android.control.aeAntibandingMode", int.class); |
| 850 | |
| 851 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 852 | * <p>Adjustment to auto-exposure (AE) target image |
| 853 | * brightness.</p> |
| 854 | * <p>The adjustment is measured as a count of steps, with the |
| 855 | * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the |
| 856 | * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p> |
| 857 | * <p>For example, if the exposure value (EV) step is 0.333, '6' |
| 858 | * will mean an exposure compensation of +2 EV; -3 will mean an |
| 859 | * exposure compensation of -1 EV. One EV represents a doubling |
| 860 | * of image brightness. Note that this control will only be |
| 861 | * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control |
| 862 | * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p> |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 863 | * <p>In the event of exposure compensation value being changed, camera device |
| 864 | * may take several frames to reach the newly requested exposure target. |
| 865 | * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING |
| 866 | * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will |
| 867 | * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or |
| 868 | * FLASH_REQUIRED (if the scene is too dark for still capture).</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 869 | * <p><b>Units</b>: Compensation steps</p> |
| 870 | * <p><b>Range of valid values:</b><br> |
| 871 | * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 872 | * <p>This key is available on all devices.</p> |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 873 | * |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 874 | * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE |
| 875 | * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 876 | * @see CaptureRequest#CONTROL_AE_LOCK |
| 877 | * @see CaptureRequest#CONTROL_AE_MODE |
| 878 | * @see CaptureResult#CONTROL_AE_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 879 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 880 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 881 | public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = |
| 882 | new Key<Integer>("android.control.aeExposureCompensation", int.class); |
| 883 | |
| 884 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 885 | * <p>Whether auto-exposure (AE) is currently locked to its latest |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 886 | * calculated values.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 887 | * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters, |
| 888 | * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p> |
| 889 | * <p>Note that even when AE is locked, the flash may be fired if |
| 890 | * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / |
| 891 | * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p> |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 892 | * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock |
| 893 | * is ON, the camera device will still adjust its exposure value.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 894 | * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) |
| 895 | * when AE is already locked, the camera device will not change the exposure time |
| 896 | * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}) |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 897 | * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 898 | * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 899 | * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed. |
| 900 | * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p> |
| 901 | * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock |
| 902 | * the AE if AE is locked by the camera device internally during precapture metering |
| 903 | * sequence In other words, submitting requests with AE unlock has no effect for an |
| 904 | * ongoing precapture metering sequence. Otherwise, the precapture metering sequence |
| 905 | * will never succeed in a sequence of preview requests where AE lock is always set |
| 906 | * to <code>false</code>.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 907 | * <p>Since the camera device has a pipeline of in-flight requests, the settings that |
| 908 | * get locked do not necessarily correspond to the settings that were present in the |
| 909 | * latest capture result received from the camera device, since additional captures |
| 910 | * and AE updates may have occurred even before the result was sent out. If an |
| 911 | * application is switching between automatic and manual control and wishes to eliminate |
| 912 | * any flicker during the switch, the following procedure is recommended:</p> |
| 913 | * <ol> |
| 914 | * <li>Starting in auto-AE mode:</li> |
| 915 | * <li>Lock AE</li> |
| 916 | * <li>Wait for the first result to be output that has the AE locked</li> |
| 917 | * <li>Copy exposure settings from that result into a request, set the request to manual AE</li> |
| 918 | * <li>Submit the capture request, proceed to run manual AE as desired.</li> |
| 919 | * </ol> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 920 | * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 921 | * <p>This key is available on all devices.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 922 | * |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 923 | * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 924 | * @see CaptureRequest#CONTROL_AE_MODE |
| 925 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 926 | * @see CaptureResult#CONTROL_AE_STATE |
| 927 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 928 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 929 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 930 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 931 | public static final Key<Boolean> CONTROL_AE_LOCK = |
| 932 | new Key<Boolean>("android.control.aeLock", boolean.class); |
| 933 | |
| 934 | /** |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 935 | * <p>The desired mode for the camera device's |
| 936 | * auto-exposure routine.</p> |
| 937 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is |
| 938 | * AUTO.</p> |
| 939 | * <p>When set to any of the ON modes, the camera device's |
| 940 | * auto-exposure routine is enabled, overriding the |
| 941 | * application's selected exposure time, sensor sensitivity, |
| 942 | * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, |
| 943 | * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and |
| 944 | * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes |
| 945 | * is selected, the camera device's flash unit controls are |
| 946 | * also overridden.</p> |
| 947 | * <p>The FLASH modes are only available if the camera device |
| 948 | * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> |
| 949 | * <p>If flash TORCH mode is desired, this field must be set to |
| 950 | * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> |
| 951 | * <p>When set to any of the ON modes, the values chosen by the |
| 952 | * camera device auto-exposure routine for the overridden |
| 953 | * fields for a given capture will be available in its |
| 954 | * CaptureResult.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 955 | * <p><b>Possible values:</b> |
| 956 | * <ul> |
| 957 | * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li> |
| 958 | * <li>{@link #CONTROL_AE_MODE_ON ON}</li> |
| 959 | * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li> |
| 960 | * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li> |
| 961 | * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li> |
| 962 | * </ul></p> |
| 963 | * <p><b>Available values for this device:</b><br> |
| 964 | * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 965 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 966 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 967 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 968 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 969 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
| 970 | * @see CaptureRequest#FLASH_MODE |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 971 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 972 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 973 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 974 | * @see #CONTROL_AE_MODE_OFF |
| 975 | * @see #CONTROL_AE_MODE_ON |
| 976 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH |
| 977 | * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH |
| 978 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE |
| 979 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 980 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 981 | public static final Key<Integer> CONTROL_AE_MODE = |
| 982 | new Key<Integer>("android.control.aeMode", int.class); |
| 983 | |
| 984 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 985 | * <p>List of metering areas to use for auto-exposure adjustment.</p> |
| 986 | * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0. |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 987 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 988 | * <p>The maximum number of regions supported by the device is determined by the value |
| 989 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 990 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 991 | * 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] | 992 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 993 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Yin-Chia Yeh | 97f1c85 | 2014-05-28 16:36:05 -0700 | [diff] [blame] | 994 | * bottom-right pixel in the active pixel array.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 995 | * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight |
Yin-Chia Yeh | 97f1c85 | 2014-05-28 16:36:05 -0700 | [diff] [blame] | 996 | * for every pixel in the area. This means that a large metering area |
| 997 | * with the same weight as a smaller area will have more effect in |
| 998 | * the metering result. Metering areas can partially overlap and the |
| 999 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1000 | * <p>The weights are relative to weights of other exposure metering regions, so if only one |
| 1001 | * region is used, all non-zero weights will have the same effect. A region with 0 |
| 1002 | * weight is ignored.</p> |
| 1003 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 1004 | * camera device.</p> |
| 1005 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 1006 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 1007 | * region and output only the intersection rectangle as the metering region in the result |
| 1008 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 1009 | * not reported in the result metadata.</p> |
| 1010 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
| 1011 | * <p><b>Range of valid values:</b><br> |
| 1012 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
| 1013 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1014 | * <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] | 1015 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1016 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1017 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1018 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1019 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1020 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 1021 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS = |
| 1022 | new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1023 | |
| 1024 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1025 | * <p>Range over which the auto-exposure routine can |
| 1026 | * adjust the capture frame rate to maintain good |
| 1027 | * exposure.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1028 | * <p>Only constrains auto-exposure (AE) algorithm, not |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1029 | * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and |
| 1030 | * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p> |
| 1031 | * <p><b>Units</b>: Frames per second (FPS)</p> |
| 1032 | * <p><b>Range of valid values:</b><br> |
| 1033 | * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p> |
| 1034 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1035 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1036 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1037 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1038 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1039 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1040 | @PublicKey |
Igor Murashkin | 78712a8 | 2014-05-27 18:32:18 -0700 | [diff] [blame] | 1041 | public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE = |
| 1042 | new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }}); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1043 | |
| 1044 | /** |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1045 | * <p>Whether the camera device will trigger a precapture |
| 1046 | * metering sequence when it processes this request.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1047 | * <p>This entry is normally set to IDLE, or is not |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1048 | * included at all in the request settings. When included and |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 1049 | * set to START, the camera device will trigger the auto-exposure (AE) |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1050 | * precapture metering sequence.</p> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1051 | * <p>When set to CANCEL, the camera device will cancel any active |
| 1052 | * precapture metering trigger, and return to its initial AE state. |
| 1053 | * If a precapture metering sequence is already completed, and the camera |
| 1054 | * device has implicitly locked the AE for subsequent still capture, the |
| 1055 | * CANCEL trigger will unlock the AE and return to its initial AE state.</p> |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 1056 | * <p>The precapture sequence should be triggered before starting a |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1057 | * high-quality still capture for final metering decisions to |
| 1058 | * be made, and for firing pre-capture flash pulses to estimate |
| 1059 | * scene brightness and required final capture flash power, when |
| 1060 | * the flash is enabled.</p> |
| 1061 | * <p>Normally, this entry should be set to START for only a |
| 1062 | * single request, and the application should wait until the |
| 1063 | * sequence completes before starting a new one.</p> |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 1064 | * <p>When a precapture metering sequence is finished, the camera device |
| 1065 | * may lock the auto-exposure routine internally to be able to accurately expose the |
| 1066 | * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>). |
| 1067 | * For this case, the AE may not resume normal scan if no subsequent still capture is |
| 1068 | * submitted. To ensure that the AE routine restarts normal scan, the application should |
| 1069 | * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request |
| 1070 | * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1071 | * still capture request after the precapture sequence completes. Alternatively, for |
| 1072 | * API level 23 or newer devices, the CANCEL can be used to unlock the camera device |
| 1073 | * internally locked AE if the application doesn't submit a still capture request after |
| 1074 | * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not |
| 1075 | * be used in devices that have earlier API levels.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1076 | * <p>The exact effect of auto-exposure (AE) precapture trigger |
| 1077 | * depends on the current AE mode and state; see |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1078 | * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition |
| 1079 | * details.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1080 | * <p>On LEGACY-level devices, the precapture trigger is not supported; |
| 1081 | * capturing a high-resolution JPEG image will automatically trigger a |
| 1082 | * precapture sequence before the high-resolution capture, including |
| 1083 | * potentially firing a pre-capture flash.</p> |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 1084 | * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} |
| 1085 | * simultaneously is allowed. However, since these triggers often require cooperation between |
| 1086 | * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a |
| 1087 | * focus sweep), the camera device may delay acting on a later trigger until the previous |
| 1088 | * trigger has been fully handled. This may lead to longer intervals between the trigger and |
| 1089 | * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for |
| 1090 | * example.</p> |
| 1091 | * <p>If both the precapture and the auto-focus trigger are activated on the same request, then |
| 1092 | * the camera device will complete them in the optimal order for that device.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1093 | * <p><b>Possible values:</b> |
| 1094 | * <ul> |
| 1095 | * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li> |
| 1096 | * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1097 | * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1098 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1099 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1100 | * <p><b>Limited capability</b> - |
| 1101 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 1102 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1103 | * |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 1104 | * @see CaptureRequest#CONTROL_AE_LOCK |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1105 | * @see CaptureResult#CONTROL_AE_STATE |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 1106 | * @see CaptureRequest#CONTROL_AF_TRIGGER |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 1107 | * @see CaptureRequest#CONTROL_CAPTURE_INTENT |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1108 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1109 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE |
| 1110 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1111 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1112 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1113 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1114 | public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = |
| 1115 | new Key<Integer>("android.control.aePrecaptureTrigger", int.class); |
| 1116 | |
| 1117 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1118 | * <p>Whether auto-focus (AF) is currently enabled, and what |
| 1119 | * mode it is set to.</p> |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1120 | * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1121 | * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} > 0</code>). Also note that |
| 1122 | * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device |
| 1123 | * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before |
| 1124 | * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p> |
Zhijun He | 78146ec | 2014-01-14 18:12:13 -0800 | [diff] [blame] | 1125 | * <p>If the lens is controlled by the camera device auto-focus algorithm, |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1126 | * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState} |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1127 | * in result metadata.</p> |
| 1128 | * <p><b>Possible values:</b> |
| 1129 | * <ul> |
| 1130 | * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li> |
| 1131 | * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li> |
| 1132 | * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li> |
| 1133 | * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li> |
| 1134 | * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li> |
| 1135 | * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li> |
| 1136 | * </ul></p> |
| 1137 | * <p><b>Available values for this device:</b><br> |
| 1138 | * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p> |
| 1139 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1140 | * |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1141 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1142 | * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1143 | * @see CaptureResult#CONTROL_AF_STATE |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1144 | * @see CaptureRequest#CONTROL_AF_TRIGGER |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1145 | * @see CaptureRequest#CONTROL_MODE |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1146 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1147 | * @see #CONTROL_AF_MODE_OFF |
| 1148 | * @see #CONTROL_AF_MODE_AUTO |
| 1149 | * @see #CONTROL_AF_MODE_MACRO |
| 1150 | * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO |
| 1151 | * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE |
| 1152 | * @see #CONTROL_AF_MODE_EDOF |
| 1153 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1154 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1155 | public static final Key<Integer> CONTROL_AF_MODE = |
| 1156 | new Key<Integer>("android.control.afMode", int.class); |
| 1157 | |
| 1158 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1159 | * <p>List of metering areas to use for auto-focus.</p> |
| 1160 | * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0. |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1161 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1162 | * <p>The maximum number of focus areas supported by the device is determined by the value |
| 1163 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1164 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 1165 | * 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] | 1166 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 1167 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Yin-Chia Yeh | 97f1c85 | 2014-05-28 16:36:05 -0700 | [diff] [blame] | 1168 | * bottom-right pixel in the active pixel array.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1169 | * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight |
Yin-Chia Yeh | 97f1c85 | 2014-05-28 16:36:05 -0700 | [diff] [blame] | 1170 | * for every pixel in the area. This means that a large metering area |
| 1171 | * with the same weight as a smaller area will have more effect in |
| 1172 | * the metering result. Metering areas can partially overlap and the |
| 1173 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1174 | * <p>The weights are relative to weights of other metering regions, so if only one region |
| 1175 | * is used, all non-zero weights will have the same effect. A region with 0 weight is |
| 1176 | * ignored.</p> |
| 1177 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 1178 | * camera device.</p> |
| 1179 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 1180 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 1181 | * region and output only the intersection rectangle as the metering region in the result |
| 1182 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 1183 | * not reported in the result metadata.</p> |
| 1184 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
| 1185 | * <p><b>Range of valid values:</b><br> |
| 1186 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
| 1187 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1188 | * <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] | 1189 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1190 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1191 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1192 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1193 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1194 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 1195 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS = |
| 1196 | new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1197 | |
| 1198 | /** |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1199 | * <p>Whether the camera device will trigger autofocus for this request.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1200 | * <p>This entry is normally set to IDLE, or is not |
| 1201 | * included at all in the request settings.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1202 | * <p>When included and set to START, the camera device will trigger the |
| 1203 | * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p> |
| 1204 | * <p>When set to CANCEL, the camera device will cancel any active trigger, |
| 1205 | * and return to its initial AF state.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1206 | * <p>Generally, applications should set this entry to START or CANCEL for only a |
| 1207 | * single capture, and then return it to IDLE (or not set at all). Specifying |
| 1208 | * START for multiple captures in a row means restarting the AF operation over |
| 1209 | * and over again.</p> |
| 1210 | * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p> |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 1211 | * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} |
| 1212 | * simultaneously is allowed. However, since these triggers often require cooperation between |
| 1213 | * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a |
| 1214 | * focus sweep), the camera device may delay acting on a later trigger until the previous |
| 1215 | * trigger has been fully handled. This may lead to longer intervals between the trigger and |
| 1216 | * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1217 | * <p><b>Possible values:</b> |
| 1218 | * <ul> |
| 1219 | * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li> |
| 1220 | * <li>{@link #CONTROL_AF_TRIGGER_START START}</li> |
| 1221 | * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li> |
| 1222 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1223 | * <p>This key is available on all devices.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1224 | * |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 1225 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1226 | * @see CaptureResult#CONTROL_AF_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1227 | * @see #CONTROL_AF_TRIGGER_IDLE |
| 1228 | * @see #CONTROL_AF_TRIGGER_START |
| 1229 | * @see #CONTROL_AF_TRIGGER_CANCEL |
| 1230 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1231 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1232 | public static final Key<Integer> CONTROL_AF_TRIGGER = |
| 1233 | new Key<Integer>("android.control.afTrigger", int.class); |
| 1234 | |
| 1235 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1236 | * <p>Whether auto-white balance (AWB) is currently locked to its |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 1237 | * latest calculated values.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1238 | * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters, |
| 1239 | * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p> |
| 1240 | * <p>Since the camera device has a pipeline of in-flight requests, the settings that |
| 1241 | * get locked do not necessarily correspond to the settings that were present in the |
| 1242 | * latest capture result received from the camera device, since additional captures |
| 1243 | * and AWB updates may have occurred even before the result was sent out. If an |
| 1244 | * application is switching between automatic and manual control and wishes to eliminate |
| 1245 | * any flicker during the switch, the following procedure is recommended:</p> |
| 1246 | * <ol> |
| 1247 | * <li>Starting in auto-AWB mode:</li> |
| 1248 | * <li>Lock AWB</li> |
| 1249 | * <li>Wait for the first result to be output that has the AWB locked</li> |
| 1250 | * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li> |
| 1251 | * <li>Submit the capture request, proceed to run manual AWB as desired.</li> |
| 1252 | * </ol> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1253 | * <p>Note that AWB lock is only meaningful when |
| 1254 | * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes, |
| 1255 | * AWB is already fixed to a specific setting.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1256 | * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p> |
| 1257 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1258 | * |
| 1259 | * @see CaptureRequest#CONTROL_AWB_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1260 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1261 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1262 | public static final Key<Boolean> CONTROL_AWB_LOCK = |
| 1263 | new Key<Boolean>("android.control.awbLock", boolean.class); |
| 1264 | |
| 1265 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1266 | * <p>Whether auto-white balance (AWB) is currently setting the color |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1267 | * transform fields, and what its illumination target |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1268 | * is.</p> |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1269 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1270 | * <p>When set to the ON mode, the camera device's auto-white balance |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1271 | * routine is enabled, overriding the application's selected |
| 1272 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1273 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} |
| 1274 | * is OFF, the behavior of AWB is device dependent. It is recommened to |
| 1275 | * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before |
| 1276 | * setting AE mode to OFF.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1277 | * <p>When set to the OFF mode, the camera device's auto-white balance |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1278 | * routine is disabled. The application manually controls the white |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1279 | * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1280 | * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1281 | * <p>When set to any other modes, the camera device's auto-white |
| 1282 | * balance routine is disabled. The camera device uses each |
| 1283 | * particular illumination target for white balance |
| 1284 | * adjustment. The application's values for |
| 1285 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, |
| 1286 | * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 1287 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1288 | * <p><b>Possible values:</b> |
| 1289 | * <ul> |
| 1290 | * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li> |
| 1291 | * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li> |
| 1292 | * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li> |
| 1293 | * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li> |
| 1294 | * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li> |
| 1295 | * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li> |
| 1296 | * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li> |
| 1297 | * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li> |
| 1298 | * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li> |
| 1299 | * </ul></p> |
| 1300 | * <p><b>Available values for this device:</b><br> |
| 1301 | * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1302 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1303 | * |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1304 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1305 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
| 1306 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1307 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1308 | * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1309 | * @see CaptureRequest#CONTROL_AWB_LOCK |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1310 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1311 | * @see #CONTROL_AWB_MODE_OFF |
| 1312 | * @see #CONTROL_AWB_MODE_AUTO |
| 1313 | * @see #CONTROL_AWB_MODE_INCANDESCENT |
| 1314 | * @see #CONTROL_AWB_MODE_FLUORESCENT |
| 1315 | * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT |
| 1316 | * @see #CONTROL_AWB_MODE_DAYLIGHT |
| 1317 | * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT |
| 1318 | * @see #CONTROL_AWB_MODE_TWILIGHT |
| 1319 | * @see #CONTROL_AWB_MODE_SHADE |
| 1320 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1321 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1322 | public static final Key<Integer> CONTROL_AWB_MODE = |
| 1323 | new Key<Integer>("android.control.awbMode", int.class); |
| 1324 | |
| 1325 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1326 | * <p>List of metering areas to use for auto-white-balance illuminant |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 1327 | * estimation.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1328 | * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0. |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1329 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1330 | * <p>The maximum number of regions supported by the device is determined by the value |
| 1331 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1332 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 1333 | * 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] | 1334 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 1335 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Yin-Chia Yeh | 97f1c85 | 2014-05-28 16:36:05 -0700 | [diff] [blame] | 1336 | * bottom-right pixel in the active pixel array.</p> |
| 1337 | * <p>The weight must range from 0 to 1000, and represents a weight |
| 1338 | * for every pixel in the area. This means that a large metering area |
| 1339 | * with the same weight as a smaller area will have more effect in |
| 1340 | * the metering result. Metering areas can partially overlap and the |
| 1341 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1342 | * <p>The weights are relative to weights of other white balance metering regions, so if |
| 1343 | * only one region is used, all non-zero weights will have the same effect. A region with |
| 1344 | * 0 weight is ignored.</p> |
| 1345 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 1346 | * camera device.</p> |
| 1347 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 1348 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 1349 | * region and output only the intersection rectangle as the metering region in the result |
| 1350 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 1351 | * not reported in the result metadata.</p> |
| 1352 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
| 1353 | * <p><b>Range of valid values:</b><br> |
| 1354 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
| 1355 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1356 | * <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] | 1357 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1358 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1359 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1360 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1361 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1362 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 1363 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS = |
| 1364 | new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1365 | |
| 1366 | /** |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1367 | * <p>Information to the camera device 3A (auto-exposure, |
| 1368 | * auto-focus, auto-white balance) routines about the purpose |
| 1369 | * of this capture, to help the camera device to decide optimal 3A |
| 1370 | * strategy.</p> |
Zhijun He | e30adb7 | 2014-04-09 19:04:31 -0700 | [diff] [blame] | 1371 | * <p>This control (except for MANUAL) is only effective if |
| 1372 | * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1373 | * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 1374 | * contains PRIVATE_REPROCESSING or YUV_REPROCESSING. MANUAL will be supported if |
Zhijun He | 513f7c3 | 2015-04-24 18:23:54 -0700 | [diff] [blame] | 1375 | * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR. Other intent values are |
| 1376 | * always supported.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1377 | * <p><b>Possible values:</b> |
| 1378 | * <ul> |
| 1379 | * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li> |
| 1380 | * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li> |
| 1381 | * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li> |
| 1382 | * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li> |
| 1383 | * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li> |
| 1384 | * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> |
| 1385 | * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li> |
| 1386 | * </ul></p> |
| 1387 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1388 | * |
| 1389 | * @see CaptureRequest#CONTROL_MODE |
Zhijun He | e30adb7 | 2014-04-09 19:04:31 -0700 | [diff] [blame] | 1390 | * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1391 | * @see #CONTROL_CAPTURE_INTENT_CUSTOM |
| 1392 | * @see #CONTROL_CAPTURE_INTENT_PREVIEW |
| 1393 | * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE |
| 1394 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD |
| 1395 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT |
| 1396 | * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG |
Zhijun He | e30adb7 | 2014-04-09 19:04:31 -0700 | [diff] [blame] | 1397 | * @see #CONTROL_CAPTURE_INTENT_MANUAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1398 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1399 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1400 | public static final Key<Integer> CONTROL_CAPTURE_INTENT = |
| 1401 | new Key<Integer>("android.control.captureIntent", int.class); |
| 1402 | |
| 1403 | /** |
Ruben Brunk | 5f1dcfe | 2014-01-17 16:42:51 -0800 | [diff] [blame] | 1404 | * <p>A special color effect to apply.</p> |
| 1405 | * <p>When this mode is set, a color effect will be applied |
| 1406 | * to images produced by the camera device. The interpretation |
| 1407 | * and implementation of these color effects is left to the |
| 1408 | * implementor of the camera device, and should not be |
| 1409 | * depended on to be consistent (or present) across all |
| 1410 | * devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1411 | * <p><b>Possible values:</b> |
| 1412 | * <ul> |
| 1413 | * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li> |
| 1414 | * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li> |
| 1415 | * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li> |
| 1416 | * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li> |
| 1417 | * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li> |
| 1418 | * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li> |
| 1419 | * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li> |
| 1420 | * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li> |
| 1421 | * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li> |
| 1422 | * </ul></p> |
| 1423 | * <p><b>Available values for this device:</b><br> |
| 1424 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1425 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1426 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1427 | * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1428 | * @see #CONTROL_EFFECT_MODE_OFF |
| 1429 | * @see #CONTROL_EFFECT_MODE_MONO |
| 1430 | * @see #CONTROL_EFFECT_MODE_NEGATIVE |
| 1431 | * @see #CONTROL_EFFECT_MODE_SOLARIZE |
| 1432 | * @see #CONTROL_EFFECT_MODE_SEPIA |
| 1433 | * @see #CONTROL_EFFECT_MODE_POSTERIZE |
| 1434 | * @see #CONTROL_EFFECT_MODE_WHITEBOARD |
| 1435 | * @see #CONTROL_EFFECT_MODE_BLACKBOARD |
| 1436 | * @see #CONTROL_EFFECT_MODE_AQUA |
| 1437 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1438 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1439 | public static final Key<Integer> CONTROL_EFFECT_MODE = |
| 1440 | new Key<Integer>("android.control.effectMode", int.class); |
| 1441 | |
| 1442 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1443 | * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1444 | * routines.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1445 | * <p>This is a top-level 3A control switch. When set to OFF, all 3A control |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1446 | * 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] | 1447 | * capture parameters itself.</p> |
| 1448 | * <p>When set to AUTO, the individual algorithm controls in |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1449 | * 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] | 1450 | * <p>When set to USE_SCENE_MODE, the individual controls in |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1451 | * android.control.* are mostly disabled, and the camera device implements |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 1452 | * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1453 | * as it wishes. The camera device scene mode 3A settings are provided by |
Zhijun He | 527d522 | 2015-05-14 15:36:04 -0700 | [diff] [blame] | 1454 | * {@link android.hardware.camera2.CaptureResult capture results}.</p> |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 1455 | * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference |
| 1456 | * is that this frame will not be used by camera device background 3A statistics |
| 1457 | * update, as if this frame is never captured. This mode can be used in the scenario |
| 1458 | * where the application doesn't want a 3A manual control capture to affect |
| 1459 | * the subsequent auto 3A capture results.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1460 | * <p><b>Possible values:</b> |
| 1461 | * <ul> |
| 1462 | * <li>{@link #CONTROL_MODE_OFF OFF}</li> |
| 1463 | * <li>{@link #CONTROL_MODE_AUTO AUTO}</li> |
| 1464 | * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li> |
| 1465 | * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li> |
| 1466 | * </ul></p> |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 1467 | * <p><b>Available values for this device:</b><br> |
| 1468 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1469 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1470 | * |
| 1471 | * @see CaptureRequest#CONTROL_AF_MODE |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 1472 | * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1473 | * @see #CONTROL_MODE_OFF |
| 1474 | * @see #CONTROL_MODE_AUTO |
| 1475 | * @see #CONTROL_MODE_USE_SCENE_MODE |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 1476 | * @see #CONTROL_MODE_OFF_KEEP_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1477 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1478 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1479 | public static final Key<Integer> CONTROL_MODE = |
| 1480 | new Key<Integer>("android.control.mode", int.class); |
| 1481 | |
| 1482 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1483 | * <p>Control for which scene mode is currently active.</p> |
| 1484 | * <p>Scene modes are custom camera modes optimized for a certain set of conditions and |
| 1485 | * capture settings.</p> |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1486 | * <p>This is the mode that that is active when |
Zhijun He | ee2ebde | 2015-06-16 19:58:11 -0700 | [diff] [blame] | 1487 | * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will |
| 1488 | * disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} |
| 1489 | * while in use.</p> |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1490 | * <p>The interpretation and implementation of these scene modes is left |
| 1491 | * to the implementor of the camera device. Their behavior will not be |
| 1492 | * consistent across all devices, and any given device may only implement |
| 1493 | * a subset of these modes.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1494 | * <p><b>Possible values:</b> |
| 1495 | * <ul> |
| 1496 | * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li> |
| 1497 | * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li> |
| 1498 | * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li> |
| 1499 | * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li> |
| 1500 | * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li> |
| 1501 | * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li> |
| 1502 | * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li> |
| 1503 | * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li> |
| 1504 | * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li> |
| 1505 | * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li> |
| 1506 | * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li> |
| 1507 | * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li> |
| 1508 | * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li> |
| 1509 | * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li> |
| 1510 | * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li> |
| 1511 | * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li> |
| 1512 | * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li> |
| 1513 | * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li> |
Eino-Ville Talvala | f4eac12 | 2014-12-05 11:10:15 -0800 | [diff] [blame] | 1514 | * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1515 | * </ul></p> |
| 1516 | * <p><b>Available values for this device:</b><br> |
| 1517 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1518 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1519 | * |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1520 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1521 | * @see CaptureRequest#CONTROL_AF_MODE |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1522 | * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1523 | * @see CaptureRequest#CONTROL_AWB_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1524 | * @see CaptureRequest#CONTROL_MODE |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1525 | * @see #CONTROL_SCENE_MODE_DISABLED |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1526 | * @see #CONTROL_SCENE_MODE_FACE_PRIORITY |
| 1527 | * @see #CONTROL_SCENE_MODE_ACTION |
| 1528 | * @see #CONTROL_SCENE_MODE_PORTRAIT |
| 1529 | * @see #CONTROL_SCENE_MODE_LANDSCAPE |
| 1530 | * @see #CONTROL_SCENE_MODE_NIGHT |
| 1531 | * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT |
| 1532 | * @see #CONTROL_SCENE_MODE_THEATRE |
| 1533 | * @see #CONTROL_SCENE_MODE_BEACH |
| 1534 | * @see #CONTROL_SCENE_MODE_SNOW |
| 1535 | * @see #CONTROL_SCENE_MODE_SUNSET |
| 1536 | * @see #CONTROL_SCENE_MODE_STEADYPHOTO |
| 1537 | * @see #CONTROL_SCENE_MODE_FIREWORKS |
| 1538 | * @see #CONTROL_SCENE_MODE_SPORTS |
| 1539 | * @see #CONTROL_SCENE_MODE_PARTY |
| 1540 | * @see #CONTROL_SCENE_MODE_CANDLELIGHT |
| 1541 | * @see #CONTROL_SCENE_MODE_BARCODE |
Zhijun He | e040418 | 2014-06-26 13:17:09 -0700 | [diff] [blame] | 1542 | * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO |
Eino-Ville Talvala | f4eac12 | 2014-12-05 11:10:15 -0800 | [diff] [blame] | 1543 | * @see #CONTROL_SCENE_MODE_HDR |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1544 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1545 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1546 | public static final Key<Integer> CONTROL_SCENE_MODE = |
| 1547 | new Key<Integer>("android.control.sceneMode", int.class); |
| 1548 | |
| 1549 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1550 | * <p>Whether video stabilization is |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1551 | * active.</p> |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 1552 | * <p>Video stabilization automatically warps images from |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1553 | * the camera in order to stabilize motion between consecutive frames.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1554 | * <p>If enabled, video stabilization can modify the |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 1555 | * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1556 | * <p>Switching between different video stabilization modes may take several |
| 1557 | * frames to initialize, the camera device will report the current mode |
| 1558 | * in capture result metadata. For example, When "ON" mode is requested, |
| 1559 | * the video stabilization modes in the first several capture results may |
| 1560 | * still be "OFF", and it will become "ON" when the initialization is |
| 1561 | * done.</p> |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 1562 | * <p>In addition, not all recording sizes or frame rates may be supported for |
| 1563 | * stabilization by a device that reports stabilization support. It is guaranteed |
| 1564 | * that an output targeting a MediaRecorder or MediaCodec will be stabilized if |
| 1565 | * the recording resolution is less than or equal to 1920 x 1080 (width less than |
| 1566 | * or equal to 1920, height less than or equal to 1080), and the recording |
| 1567 | * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult |
| 1568 | * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return |
| 1569 | * OFF if the recording output is not stabilized, or if there are no output |
| 1570 | * Surface types that can be stabilized.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1571 | * <p>If a camera device supports both this mode and OIS |
| 1572 | * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may |
| 1573 | * produce undesirable interaction, so it is recommended not to enable |
| 1574 | * both at the same time.</p> |
| 1575 | * <p><b>Possible values:</b> |
| 1576 | * <ul> |
| 1577 | * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li> |
| 1578 | * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li> |
| 1579 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1580 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1581 | * |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 1582 | * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 1583 | * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1584 | * @see CaptureRequest#SCALER_CROP_REGION |
Zhijun He | 4793af5 | 2014-05-05 10:39:12 -0700 | [diff] [blame] | 1585 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF |
| 1586 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1587 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1588 | @PublicKey |
Zhijun He | 4793af5 | 2014-05-05 10:39:12 -0700 | [diff] [blame] | 1589 | public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE = |
| 1590 | new Key<Integer>("android.control.videoStabilizationMode", int.class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1591 | |
| 1592 | /** |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 1593 | * <p>The amount of additional sesnsitivity boost applied to output images |
| 1594 | * after RAW sensor data is captured.</p> |
| 1595 | * <p>Some camera devices support additional digital sensitivity boosting in the |
| 1596 | * camera processing pipeline after sensor RAW image is captured. |
| 1597 | * Such a boost will be applied to YUV/JPEG format output images but will not |
| 1598 | * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p> |
| 1599 | * <p>This key is optional. Applications can assume there is no boost applied |
| 1600 | * after RAW is captured if this key is not available. |
| 1601 | * When this key is available, the sensitivity boost value must be within |
Yin-Chia Yeh | 67e61b6 | 2016-01-26 13:27:35 -0800 | [diff] [blame^] | 1602 | * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}.</p> |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 1603 | * <p>If the camera device cannot apply the exact boost requested, it will reduce the |
| 1604 | * boost to the nearest supported value. |
| 1605 | * The final boost value used will be available in the output capture result.</p> |
| 1606 | * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images |
| 1607 | * of such device will have the total sensitivity of |
Yin-Chia Yeh | 67e61b6 | 2016-01-26 13:27:35 -0800 | [diff] [blame^] | 1608 | * <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} / 100</code> |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 1609 | * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p> |
| 1610 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to |
| 1611 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 1612 | * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p> |
| 1613 | * <p><b>Range of valid values:</b><br> |
| 1614 | * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p> |
| 1615 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1616 | * |
| 1617 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1618 | * @see CaptureRequest#CONTROL_MODE |
| 1619 | * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST |
| 1620 | * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE |
| 1621 | * @see CaptureRequest#SENSOR_SENSITIVITY |
| 1622 | */ |
| 1623 | @PublicKey |
| 1624 | public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST = |
| 1625 | new Key<Integer>("android.control.postRawSensitivityBoost", int.class); |
| 1626 | |
| 1627 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1628 | * <p>Operation mode for edge |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1629 | * enhancement.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1630 | * <p>Edge enhancement improves sharpness and details in the captured image. OFF means |
| 1631 | * no enhancement will be applied by the camera device.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1632 | * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 1633 | * will be applied. HIGH_QUALITY mode indicates that the |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1634 | * camera device will use the highest-quality enhancement algorithms, |
| 1635 | * even if it slows down capture rate. FAST means the camera device will |
Chien-Yu Chen | 9c9167e | 2015-07-14 16:38:25 -0700 | [diff] [blame] | 1636 | * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if |
| 1637 | * edge enhancement will slow down capture rate. Every output stream will have a similar |
| 1638 | * amount of enhancement applied.</p> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 1639 | * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular |
| 1640 | * buffer of high-resolution images during preview and reprocess image(s) from that buffer |
| 1641 | * into a final capture when triggered by the user. In this mode, the camera device applies |
| 1642 | * edge enhancement to low-resolution streams (below maximum recording resolution) to |
| 1643 | * maximize preview quality, but does not apply edge enhancement to high-resolution streams, |
| 1644 | * since those will be reprocessed later if necessary.</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 1645 | * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera |
| 1646 | * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively. |
Chien-Yu Chen | 9c9167e | 2015-07-14 16:38:25 -0700 | [diff] [blame] | 1647 | * The camera device may adjust its internal edge enhancement parameters for best |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 1648 | * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1649 | * <p><b>Possible values:</b> |
| 1650 | * <ul> |
| 1651 | * <li>{@link #EDGE_MODE_OFF OFF}</li> |
| 1652 | * <li>{@link #EDGE_MODE_FAST FAST}</li> |
| 1653 | * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 1654 | * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1655 | * </ul></p> |
| 1656 | * <p><b>Available values for this device:</b><br> |
| 1657 | * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1658 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1659 | * <p><b>Full capability</b> - |
| 1660 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1661 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 1662 | * |
| 1663 | * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1664 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 1665 | * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1666 | * @see #EDGE_MODE_OFF |
| 1667 | * @see #EDGE_MODE_FAST |
| 1668 | * @see #EDGE_MODE_HIGH_QUALITY |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 1669 | * @see #EDGE_MODE_ZERO_SHUTTER_LAG |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1670 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1671 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1672 | public static final Key<Integer> EDGE_MODE = |
| 1673 | new Key<Integer>("android.edge.mode", int.class); |
| 1674 | |
| 1675 | /** |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1676 | * <p>The desired mode for for the camera device's flash control.</p> |
| 1677 | * <p>This control is only effective when flash unit is available |
Zhijun He | 153ac10 | 2014-02-03 12:25:12 -0800 | [diff] [blame] | 1678 | * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p> |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1679 | * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. |
| 1680 | * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, |
| 1681 | * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> |
| 1682 | * <p>When set to OFF, the camera device will not fire flash for this capture.</p> |
| 1683 | * <p>When set to SINGLE, the camera device will fire flash regardless of the camera |
| 1684 | * device's auto-exposure routine's result. When used in still capture case, this |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1685 | * control should be used along with auto-exposure (AE) precapture metering sequence |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1686 | * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> |
| 1687 | * <p>When set to TORCH, the flash will be on continuously. This mode can be used |
| 1688 | * for use cases such as preview, auto-focus assist, still capture, or video recording.</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1689 | * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1690 | * <p><b>Possible values:</b> |
| 1691 | * <ul> |
| 1692 | * <li>{@link #FLASH_MODE_OFF OFF}</li> |
| 1693 | * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li> |
| 1694 | * <li>{@link #FLASH_MODE_TORCH TORCH}</li> |
| 1695 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1696 | * <p>This key is available on all devices.</p> |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1697 | * |
| 1698 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1699 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 1700 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1701 | * @see CaptureResult#FLASH_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1702 | * @see #FLASH_MODE_OFF |
| 1703 | * @see #FLASH_MODE_SINGLE |
| 1704 | * @see #FLASH_MODE_TORCH |
| 1705 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1706 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1707 | public static final Key<Integer> FLASH_MODE = |
| 1708 | new Key<Integer>("android.flash.mode", int.class); |
| 1709 | |
| 1710 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1711 | * <p>Operational mode for hot pixel correction.</p> |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1712 | * <p>Hotpixel correction interpolates out, or otherwise removes, pixels |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1713 | * that do not accurately measure the incoming light (i.e. pixels that |
| 1714 | * are stuck at an arbitrary value or are oversensitive).</p> |
| 1715 | * <p><b>Possible values:</b> |
| 1716 | * <ul> |
| 1717 | * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li> |
| 1718 | * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li> |
| 1719 | * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 1720 | * </ul></p> |
| 1721 | * <p><b>Available values for this device:</b><br> |
| 1722 | * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1723 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 1724 | * |
| 1725 | * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1726 | * @see #HOT_PIXEL_MODE_OFF |
| 1727 | * @see #HOT_PIXEL_MODE_FAST |
| 1728 | * @see #HOT_PIXEL_MODE_HIGH_QUALITY |
| 1729 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1730 | @PublicKey |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1731 | public static final Key<Integer> HOT_PIXEL_MODE = |
| 1732 | new Key<Integer>("android.hotPixel.mode", int.class); |
| 1733 | |
| 1734 | /** |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1735 | * <p>A location object to use when generating image GPS metadata.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1736 | * <p>Setting a location object in a request will include the GPS coordinates of the location |
| 1737 | * into any JPEG images captured based on the request. These coordinates can then be |
| 1738 | * viewed by anyone who receives the JPEG image.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1739 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1740 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1741 | @PublicKey |
| 1742 | @SyntheticKey |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1743 | public static final Key<android.location.Location> JPEG_GPS_LOCATION = |
| 1744 | new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class); |
| 1745 | |
| 1746 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1747 | * <p>GPS coordinates to include in output JPEG |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1748 | * EXIF.</p> |
| 1749 | * <p><b>Range of valid values:</b><br> |
| 1750 | * (-180 - 180], [-90,90], [-inf, inf]</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1751 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1752 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1753 | */ |
| 1754 | public static final Key<double[]> JPEG_GPS_COORDINATES = |
| 1755 | new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); |
| 1756 | |
| 1757 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1758 | * <p>32 characters describing GPS algorithm to |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1759 | * include in EXIF.</p> |
| 1760 | * <p><b>Units</b>: UTF-8 null-terminated string</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1761 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1762 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1763 | */ |
| 1764 | public static final Key<String> JPEG_GPS_PROCESSING_METHOD = |
| 1765 | new Key<String>("android.jpeg.gpsProcessingMethod", String.class); |
| 1766 | |
| 1767 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1768 | * <p>Time GPS fix was made to include in |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1769 | * EXIF.</p> |
| 1770 | * <p><b>Units</b>: UTC in seconds since January 1, 1970</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1771 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1772 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1773 | */ |
| 1774 | public static final Key<Long> JPEG_GPS_TIMESTAMP = |
| 1775 | new Key<Long>("android.jpeg.gpsTimestamp", long.class); |
| 1776 | |
| 1777 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1778 | * <p>The orientation for a JPEG image.</p> |
| 1779 | * <p>The clockwise rotation angle in degrees, relative to the orientation |
| 1780 | * to the camera, that the JPEG picture needs to be rotated by, to be viewed |
| 1781 | * upright.</p> |
| 1782 | * <p>Camera devices may either encode this value into the JPEG EXIF header, or |
Yin-Chia Yeh | d49ebcc | 2015-03-27 13:54:04 -0700 | [diff] [blame] | 1783 | * rotate the image data to match this orientation. When the image data is rotated, |
| 1784 | * the thumbnail data will also be rotated.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1785 | * <p>Note that this orientation is relative to the orientation of the camera sensor, given |
| 1786 | * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p> |
| 1787 | * <p>To translate from the device orientation given by the Android sensor APIs, the following |
| 1788 | * sample code may be used:</p> |
| 1789 | * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) { |
| 1790 | * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0; |
| 1791 | * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION); |
| 1792 | * |
| 1793 | * // Round device orientation to a multiple of 90 |
| 1794 | * deviceOrientation = (deviceOrientation + 45) / 90 * 90; |
| 1795 | * |
| 1796 | * // Reverse device orientation for front-facing cameras |
| 1797 | * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT; |
| 1798 | * if (facingFront) deviceOrientation = -deviceOrientation; |
| 1799 | * |
| 1800 | * // Calculate desired JPEG orientation relative to camera orientation to make |
| 1801 | * // the image upright relative to the device orientation |
| 1802 | * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360; |
| 1803 | * |
| 1804 | * return jpegOrientation; |
| 1805 | * } |
| 1806 | * </code></pre> |
| 1807 | * <p><b>Units</b>: Degrees in multiples of 90</p> |
| 1808 | * <p><b>Range of valid values:</b><br> |
| 1809 | * 0, 90, 180, 270</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1810 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1811 | * |
| 1812 | * @see CameraCharacteristics#SENSOR_ORIENTATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1813 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1814 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1815 | public static final Key<Integer> JPEG_ORIENTATION = |
| 1816 | new Key<Integer>("android.jpeg.orientation", int.class); |
| 1817 | |
| 1818 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1819 | * <p>Compression quality of the final JPEG |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1820 | * image.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1821 | * <p>85-95 is typical usage range.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1822 | * <p><b>Range of valid values:</b><br> |
| 1823 | * 1-100; larger is higher quality</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1824 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1825 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1826 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1827 | public static final Key<Byte> JPEG_QUALITY = |
| 1828 | new Key<Byte>("android.jpeg.quality", byte.class); |
| 1829 | |
| 1830 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1831 | * <p>Compression quality of JPEG |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1832 | * thumbnail.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1833 | * <p><b>Range of valid values:</b><br> |
| 1834 | * 1-100; larger is higher quality</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1835 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1836 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1837 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1838 | public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = |
| 1839 | new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); |
| 1840 | |
| 1841 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1842 | * <p>Resolution of embedded JPEG thumbnail.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1843 | * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, |
| 1844 | * but the captured JPEG will still be a valid image.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1845 | * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected |
| 1846 | * should have the same aspect ratio as the main JPEG output.</p> |
Zhijun He | 50f7243 | 2014-05-28 13:52:04 -0700 | [diff] [blame] | 1847 | * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect |
| 1848 | * ratio, the camera device creates the thumbnail by cropping it from the primary image. |
| 1849 | * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has |
| 1850 | * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to |
| 1851 | * generate the thumbnail image. The thumbnail image will always have a smaller Field |
| 1852 | * Of View (FOV) than the primary image when aspect ratios differ.</p> |
Yin-Chia Yeh | 5988311 | 2015-06-22 15:51:40 -0700 | [diff] [blame] | 1853 | * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested, |
| 1854 | * the camera device will handle thumbnail rotation in one of the following ways:</p> |
| 1855 | * <ul> |
| 1856 | * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag} |
| 1857 | * and keep jpeg and thumbnail image data unrotated.</li> |
| 1858 | * <li>Rotate the jpeg and thumbnail image data and not set |
| 1859 | * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this |
| 1860 | * case, LIMITED or FULL hardware level devices will report rotated thumnail size in |
| 1861 | * capture result, so the width and height will be interchanged if 90 or 270 degree |
| 1862 | * orientation is requested. LEGACY device will always report unrotated thumbnail |
| 1863 | * size.</li> |
| 1864 | * </ul> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1865 | * <p><b>Range of valid values:</b><br> |
| 1866 | * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1867 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1868 | * |
| 1869 | * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES |
Yin-Chia Yeh | 5988311 | 2015-06-22 15:51:40 -0700 | [diff] [blame] | 1870 | * @see CaptureRequest#JPEG_ORIENTATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1871 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1872 | @PublicKey |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 1873 | public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = |
| 1874 | new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1875 | |
| 1876 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1877 | * <p>The desired lens aperture size, as a ratio of lens focal length to the |
| 1878 | * effective aperture diameter.</p> |
| 1879 | * <p>Setting this value is only supported on the camera devices that have a variable |
| 1880 | * aperture lens.</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 1881 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, |
| 1882 | * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1883 | * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 1884 | * to achieve manual exposure control.</p> |
| 1885 | * <p>The requested aperture value may take several frames to reach the |
| 1886 | * requested value; the camera device will report the current (intermediate) |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1887 | * aperture size in capture result metadata while the aperture is changing. |
| 1888 | * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 1889 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of |
| 1890 | * the ON modes, this will be overridden by the camera device |
| 1891 | * auto-exposure algorithm, the overridden values are then provided |
| 1892 | * back to the user in the corresponding result.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1893 | * <p><b>Units</b>: The f-number (f/N)</p> |
| 1894 | * <p><b>Range of valid values:</b><br> |
| 1895 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1896 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1897 | * <p><b>Full capability</b> - |
| 1898 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1899 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 1900 | * |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1901 | * @see CaptureRequest#CONTROL_AE_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1902 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1903 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1904 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1905 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1906 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1907 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1908 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1909 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1910 | public static final Key<Float> LENS_APERTURE = |
| 1911 | new Key<Float>("android.lens.aperture", float.class); |
| 1912 | |
| 1913 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1914 | * <p>The desired setting for the lens neutral density filter(s).</p> |
| 1915 | * <p>This control will not be supported on most camera devices.</p> |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 1916 | * <p>Lens filters are typically used to lower the amount of light the |
| 1917 | * sensor is exposed to (measured in steps of EV). As used here, an EV |
| 1918 | * step is the standard logarithmic representation, which are |
| 1919 | * non-negative, and inversely proportional to the amount of light |
| 1920 | * hitting the sensor. For example, setting this to 0 would result |
| 1921 | * in no reduction of the incoming light, and setting this to 2 would |
| 1922 | * mean that the filter is set to reduce incoming light by two stops |
| 1923 | * (allowing 1/4 of the prior amount of light to the sensor).</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1924 | * <p>It may take several frames before the lens filter density changes |
| 1925 | * to the requested value. While the filter density is still changing, |
| 1926 | * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1927 | * <p><b>Units</b>: Exposure Value (EV)</p> |
| 1928 | * <p><b>Range of valid values:</b><br> |
| 1929 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1930 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1931 | * <p><b>Full capability</b> - |
| 1932 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1933 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 1934 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1935 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 1936 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1937 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1938 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1939 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1940 | public static final Key<Float> LENS_FILTER_DENSITY = |
| 1941 | new Key<Float>("android.lens.filterDensity", float.class); |
| 1942 | |
| 1943 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1944 | * <p>The desired lens focal length; used for optical zoom.</p> |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1945 | * <p>This setting controls the physical focal length of the camera |
| 1946 | * device's lens. Changing the focal length changes the field of |
| 1947 | * view of the camera device, and is usually used for optical zoom.</p> |
| 1948 | * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this |
| 1949 | * setting won't be applied instantaneously, and it may take several |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1950 | * frames before the lens can change to the requested focal length. |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1951 | * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will |
| 1952 | * be set to MOVING.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1953 | * <p>Optical zoom will not be supported on most devices.</p> |
| 1954 | * <p><b>Units</b>: Millimeters</p> |
| 1955 | * <p><b>Range of valid values:</b><br> |
| 1956 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1957 | * <p>This key is available on all devices.</p> |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1958 | * |
| 1959 | * @see CaptureRequest#LENS_APERTURE |
| 1960 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1961 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1962 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1963 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1964 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1965 | public static final Key<Float> LENS_FOCAL_LENGTH = |
| 1966 | new Key<Float>("android.lens.focalLength", float.class); |
| 1967 | |
| 1968 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1969 | * <p>Desired distance to plane of sharpest focus, |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1970 | * measured from frontmost surface of the lens.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1971 | * <p>This control can be used for setting manual focus, on devices that support |
| 1972 | * the MANUAL_SENSOR capability and have a variable-focus lens (see |
| 1973 | * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}).</p> |
| 1974 | * <p>A value of <code>0.0f</code> means infinity focus. The value set will be clamped to |
| 1975 | * <code>[0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code>.</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1976 | * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied |
| 1977 | * instantaneously, and it may take several frames before the lens |
| 1978 | * can move to the requested focus distance. While the lens is still moving, |
| 1979 | * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1980 | * <p>LEGACY devices support at most setting this to <code>0.0f</code> |
| 1981 | * for infinity focus.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1982 | * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p> |
| 1983 | * <p><b>Range of valid values:</b><br> |
| 1984 | * >= 0</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1985 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1986 | * <p><b>Full capability</b> - |
| 1987 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1988 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1989 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1990 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1991 | * @see CaptureRequest#LENS_FOCAL_LENGTH |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1992 | * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1993 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
| 1994 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1995 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1996 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1997 | public static final Key<Float> LENS_FOCUS_DISTANCE = |
| 1998 | new Key<Float>("android.lens.focusDistance", float.class); |
| 1999 | |
| 2000 | /** |
Ruben Brunk | 00849b3 | 2014-01-17 18:30:23 -0800 | [diff] [blame] | 2001 | * <p>Sets whether the camera device uses optical image stabilization (OIS) |
| 2002 | * when capturing images.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2003 | * <p>OIS is used to compensate for motion blur due to small |
| 2004 | * movements of the camera during capture. Unlike digital image |
| 2005 | * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS |
| 2006 | * makes use of mechanical elements to stabilize the camera |
| 2007 | * sensor, and thus allows for longer exposure times before |
| 2008 | * camera shake becomes apparent.</p> |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 2009 | * <p>Switching between different optical stabilization modes may take several |
| 2010 | * frames to initialize, the camera device will report the current mode in |
| 2011 | * capture result metadata. For example, When "ON" mode is requested, the |
| 2012 | * optical stabilization modes in the first several capture results may still |
| 2013 | * be "OFF", and it will become "ON" when the initialization is done.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2014 | * <p>If a camera device supports both OIS and digital image stabilization |
| 2015 | * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable |
| 2016 | * interaction, so it is recommended not to enable both at the same time.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2017 | * <p>Not all devices will support OIS; see |
| 2018 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for |
| 2019 | * available controls.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2020 | * <p><b>Possible values:</b> |
| 2021 | * <ul> |
| 2022 | * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li> |
| 2023 | * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li> |
| 2024 | * </ul></p> |
| 2025 | * <p><b>Available values for this device:</b><br> |
| 2026 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2027 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2028 | * <p><b>Limited capability</b> - |
| 2029 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2030 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2031 | * |
| 2032 | * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2033 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2034 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2035 | * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF |
| 2036 | * @see #LENS_OPTICAL_STABILIZATION_MODE_ON |
| 2037 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2038 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2039 | public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = |
| 2040 | new Key<Integer>("android.lens.opticalStabilizationMode", int.class); |
| 2041 | |
| 2042 | /** |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2043 | * <p>Mode of operation for the noise reduction algorithm.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2044 | * <p>The noise reduction algorithm attempts to improve image quality by removing |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2045 | * excessive noise added by the capture process, especially in dark conditions.</p> |
| 2046 | * <p>OFF means no noise reduction will be applied by the camera device, for both raw and |
| 2047 | * YUV domain.</p> |
| 2048 | * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove |
| 2049 | * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF. |
| 2050 | * This mode is optional, may not be support by all devices. The application should check |
| 2051 | * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2052 | * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering |
| 2053 | * will be applied. HIGH_QUALITY mode indicates that the camera device |
| 2054 | * will use the highest-quality noise filtering algorithms, |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2055 | * even if it slows down capture rate. FAST means the camera device will not |
Chien-Yu Chen | 9c9167e | 2015-07-14 16:38:25 -0700 | [diff] [blame] | 2056 | * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if |
| 2057 | * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate. |
| 2058 | * Every output stream will have a similar amount of enhancement applied.</p> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2059 | * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular |
| 2060 | * buffer of high-resolution images during preview and reprocess image(s) from that buffer |
| 2061 | * into a final capture when triggered by the user. In this mode, the camera device applies |
| 2062 | * noise reduction to low-resolution streams (below maximum recording resolution) to maximize |
| 2063 | * preview quality, but does not apply noise reduction to high-resolution streams, since |
| 2064 | * those will be reprocessed later if necessary.</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2065 | * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device |
| 2066 | * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device |
| 2067 | * may adjust the noise reduction parameters for best image quality based on the |
| 2068 | * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2069 | * <p><b>Possible values:</b> |
| 2070 | * <ul> |
| 2071 | * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li> |
| 2072 | * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li> |
| 2073 | * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2074 | * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2075 | * <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2076 | * </ul></p> |
| 2077 | * <p><b>Available values for this device:</b><br> |
| 2078 | * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2079 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2080 | * <p><b>Full capability</b> - |
| 2081 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2082 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2083 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2084 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2085 | * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2086 | * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2087 | * @see #NOISE_REDUCTION_MODE_OFF |
| 2088 | * @see #NOISE_REDUCTION_MODE_FAST |
| 2089 | * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2090 | * @see #NOISE_REDUCTION_MODE_MINIMAL |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2091 | * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2092 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2093 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2094 | public static final Key<Integer> NOISE_REDUCTION_MODE = |
| 2095 | new Key<Integer>("android.noiseReduction.mode", int.class); |
| 2096 | |
| 2097 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2098 | * <p>An application-specified ID for the current |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2099 | * request. Must be maintained unchanged in output |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2100 | * frame</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2101 | * <p><b>Units</b>: arbitrary integer assigned by application</p> |
| 2102 | * <p><b>Range of valid values:</b><br> |
| 2103 | * Any int</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2104 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2105 | * @hide |
| 2106 | */ |
| 2107 | public static final Key<Integer> REQUEST_ID = |
| 2108 | new Key<Integer>("android.request.id", int.class); |
| 2109 | |
| 2110 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2111 | * <p>The desired region of the sensor to read out for this capture.</p> |
| 2112 | * <p>This control can be used to implement digital zoom.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2113 | * <p>The crop region coordinate system is based off |
| 2114 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the |
| 2115 | * top-left corner of the sensor active array.</p> |
| 2116 | * <p>Output streams use this rectangle to produce their output, |
| 2117 | * cropping to a smaller region if necessary to maintain the |
| 2118 | * stream's aspect ratio, then scaling the sensor input to |
| 2119 | * match the output's configured resolution.</p> |
| 2120 | * <p>The crop region is applied after the RAW to other color |
| 2121 | * space (e.g. YUV) conversion. Since raw streams |
| 2122 | * (e.g. RAW16) don't have the conversion stage, they are not |
| 2123 | * croppable. The crop region will be ignored by raw streams.</p> |
Zhijun He | 9e6d188 | 2014-05-22 16:47:35 -0700 | [diff] [blame] | 2124 | * <p>For non-raw streams, any additional per-stream cropping will |
| 2125 | * be done to maximize the final pixel area of the stream.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2126 | * <p>For example, if the crop region is set to a 4:3 aspect |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2127 | * ratio, then 4:3 streams will use the exact crop |
| 2128 | * region. 16:9 streams will further crop vertically |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2129 | * (letterbox).</p> |
| 2130 | * <p>Conversely, if the crop region is set to a 16:9, then 4:3 |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2131 | * outputs will crop horizontally (pillarbox), and 16:9 |
| 2132 | * streams will match exactly. These additional crops will |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2133 | * be centered within the crop region.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2134 | * <p>The width and height of the crop region cannot |
| 2135 | * be set to be smaller than |
| 2136 | * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and |
| 2137 | * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p> |
| 2138 | * <p>The camera device may adjust the crop region to account |
| 2139 | * for rounding and other hardware requirements; the final |
| 2140 | * crop region used will be included in the output capture |
| 2141 | * result.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2142 | * <p><b>Units</b>: Pixel coordinates relative to |
| 2143 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2144 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 2145 | * |
| 2146 | * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2147 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2148 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2149 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2150 | public static final Key<android.graphics.Rect> SCALER_CROP_REGION = |
| 2151 | new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); |
| 2152 | |
| 2153 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2154 | * <p>Duration each pixel is exposed to |
| 2155 | * light.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2156 | * <p>If the sensor can't expose this exact duration, it will shorten the |
| 2157 | * duration exposed to the nearest possible value (rather than expose longer). |
| 2158 | * The final exposure time used will be available in the output capture result.</p> |
| 2159 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to |
| 2160 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 2161 | * <p><b>Units</b>: Nanoseconds</p> |
| 2162 | * <p><b>Range of valid values:</b><br> |
| 2163 | * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2164 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2165 | * <p><b>Full capability</b> - |
| 2166 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2167 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2168 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2169 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2170 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2171 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2172 | * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2173 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2174 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2175 | public static final Key<Long> SENSOR_EXPOSURE_TIME = |
| 2176 | new Key<Long>("android.sensor.exposureTime", long.class); |
| 2177 | |
| 2178 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2179 | * <p>Duration from start of frame exposure to |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2180 | * start of next frame exposure.</p> |
| 2181 | * <p>The maximum frame rate that can be supported by a camera subsystem is |
| 2182 | * a function of many factors:</p> |
| 2183 | * <ul> |
| 2184 | * <li>Requested resolutions of output image streams</li> |
| 2185 | * <li>Availability of binning / skipping modes on the imager</li> |
| 2186 | * <li>The bandwidth of the imager interface</li> |
| 2187 | * <li>The bandwidth of the various ISP processing blocks</li> |
| 2188 | * </ul> |
| 2189 | * <p>Since these factors can vary greatly between different ISPs and |
| 2190 | * sensors, the camera abstraction tries to represent the bandwidth |
| 2191 | * restrictions with as simple a model as possible.</p> |
| 2192 | * <p>The model presented has the following characteristics:</p> |
| 2193 | * <ul> |
| 2194 | * <li>The image sensor is always configured to output the smallest |
| 2195 | * resolution possible given the application's requested output stream |
| 2196 | * sizes. The smallest resolution is defined as being at least as large |
| 2197 | * as the largest requested output stream size; the camera pipeline must |
| 2198 | * never digitally upsample sensor data when the crop region covers the |
| 2199 | * whole sensor. In general, this means that if only small output stream |
| 2200 | * resolutions are configured, the sensor can provide a higher frame |
| 2201 | * rate.</li> |
| 2202 | * <li>Since any request may use any or all the currently configured |
| 2203 | * output streams, the sensor and ISP must be configured to support |
| 2204 | * scaling a single capture to all the streams at the same time. This |
| 2205 | * means the camera pipeline must be ready to produce the largest |
| 2206 | * requested output size without any delay. Therefore, the overall |
| 2207 | * frame rate of a given configured stream set is governed only by the |
| 2208 | * largest requested stream resolution.</li> |
| 2209 | * <li>Using more than one output stream in a request does not affect the |
| 2210 | * frame duration.</li> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2211 | * <li>Certain format-streams may need to do additional background processing |
| 2212 | * before data is consumed/produced by that stream. These processors |
| 2213 | * can run concurrently to the rest of the camera pipeline, but |
| 2214 | * cannot process more than 1 capture at a time.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2215 | * </ul> |
| 2216 | * <p>The necessary information for the application, given the model above, |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 2217 | * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field using |
| 2218 | * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }. |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2219 | * These are used to determine the maximum frame rate / minimum frame |
| 2220 | * duration that is possible for a given stream configuration.</p> |
| 2221 | * <p>Specifically, the application can use the following rules to |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2222 | * determine the minimum frame duration it can request from the camera |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2223 | * device:</p> |
| 2224 | * <ol> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2225 | * <li>Let the set of currently configured input/output streams |
| 2226 | * be called <code>S</code>.</li> |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 2227 | * <li>Find the minimum frame durations for each stream in <code>S</code>, by looking |
| 2228 | * it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration } |
| 2229 | * (with its respective size/format). Let this set of frame durations be |
| 2230 | * called <code>F</code>.</li> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2231 | * <li>For any given request <code>R</code>, the minimum frame duration allowed |
| 2232 | * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams |
| 2233 | * used in <code>R</code> be called <code>S_r</code>.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2234 | * </ol> |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 2235 | * <p>If none of the streams in <code>S_r</code> have a stall time (listed in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } |
| 2236 | * using its respective size/format), then the frame duration in <code>F</code> |
| 2237 | * determines the steady state frame rate that the application will get |
| 2238 | * if it uses <code>R</code> as a repeating request. Let this special kind of |
| 2239 | * request be called <code>Rsimple</code>.</p> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2240 | * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved |
| 2241 | * by a single capture of a new request <code>Rstall</code> (which has at least |
| 2242 | * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the |
| 2243 | * same minimum frame duration this will not cause a frame rate loss |
| 2244 | * if all buffers from the previous <code>Rstall</code> have already been |
| 2245 | * delivered.</p> |
| 2246 | * <p>For more details about stalling, see |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 2247 | * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2248 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to |
| 2249 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 2250 | * <p><b>Units</b>: Nanoseconds</p> |
| 2251 | * <p><b>Range of valid values:</b><br> |
| 2252 | * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, |
| 2253 | * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration |
| 2254 | * is capped to <code>max(duration, exposureTime + overhead)</code>.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2255 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2256 | * <p><b>Full capability</b> - |
| 2257 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2258 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2259 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2260 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2261 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2262 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 2263 | * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2264 | * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2265 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2266 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2267 | public static final Key<Long> SENSOR_FRAME_DURATION = |
| 2268 | new Key<Long>("android.sensor.frameDuration", long.class); |
| 2269 | |
| 2270 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2271 | * <p>The amount of gain applied to sensor data |
| 2272 | * before processing.</p> |
| 2273 | * <p>The sensitivity is the standard ISO sensitivity value, |
| 2274 | * as defined in ISO 12232:2006.</p> |
| 2275 | * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and |
| 2276 | * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device |
| 2277 | * is guaranteed to use only analog amplification for applying the gain.</p> |
| 2278 | * <p>If the camera device cannot apply the exact sensitivity |
| 2279 | * requested, it will reduce the gain to the nearest supported |
| 2280 | * value. The final sensitivity used will be available in the |
| 2281 | * output capture result.</p> |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 2282 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to |
| 2283 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2284 | * <p><b>Units</b>: ISO arithmetic units</p> |
| 2285 | * <p><b>Range of valid values:</b><br> |
| 2286 | * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2287 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2288 | * <p><b>Full capability</b> - |
| 2289 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2290 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2291 | * |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 2292 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2293 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2294 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2295 | * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE |
| 2296 | * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2297 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2298 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2299 | public static final Key<Integer> SENSOR_SENSITIVITY = |
| 2300 | new Key<Integer>("android.sensor.sensitivity", int.class); |
| 2301 | |
| 2302 | /** |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2303 | * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern |
| 2304 | * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p> |
| 2305 | * <p>Each color channel is treated as an unsigned 32-bit integer. |
| 2306 | * The camera device then uses the most significant X bits |
| 2307 | * that correspond to how many bits are in its Bayer raw sensor |
| 2308 | * output.</p> |
| 2309 | * <p>For example, a sensor with RAW10 Bayer output would use the |
| 2310 | * 10 most significant bits from each color channel.</p> |
| 2311 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2312 | * |
| 2313 | * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE |
| 2314 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2315 | @PublicKey |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2316 | public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = |
| 2317 | new Key<int[]>("android.sensor.testPatternData", int[].class); |
| 2318 | |
| 2319 | /** |
| 2320 | * <p>When enabled, the sensor sends a test pattern instead of |
| 2321 | * doing a real exposure from the camera.</p> |
| 2322 | * <p>When a test pattern is enabled, all manual sensor controls specified |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2323 | * by android.sensor.* will be ignored. All other controls should |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2324 | * work as normal.</p> |
| 2325 | * <p>For example, if manual flash is enabled, flash firing should still |
| 2326 | * occur (and that the test pattern remain unmodified, since the flash |
| 2327 | * would not actually affect it).</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2328 | * <p>Defaults to OFF.</p> |
| 2329 | * <p><b>Possible values:</b> |
| 2330 | * <ul> |
| 2331 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li> |
| 2332 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li> |
| 2333 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li> |
| 2334 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li> |
| 2335 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li> |
| 2336 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li> |
| 2337 | * </ul></p> |
| 2338 | * <p><b>Available values for this device:</b><br> |
| 2339 | * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p> |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2340 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2341 | * |
| 2342 | * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2343 | * @see #SENSOR_TEST_PATTERN_MODE_OFF |
| 2344 | * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR |
| 2345 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS |
| 2346 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY |
| 2347 | * @see #SENSOR_TEST_PATTERN_MODE_PN9 |
| 2348 | * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 |
| 2349 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2350 | @PublicKey |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2351 | public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = |
| 2352 | new Key<Integer>("android.sensor.testPatternMode", int.class); |
| 2353 | |
| 2354 | /** |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2355 | * <p>Quality of lens shading correction applied |
| 2356 | * to the image data.</p> |
| 2357 | * <p>When set to OFF mode, no lens shading correction will be applied by the |
| 2358 | * camera device, and an identity lens shading map data will be provided |
| 2359 | * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2360 | * shading map with size of <code>[ 4, 3 ]</code>, |
| 2361 | * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity |
| 2362 | * map shown below:</p> |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2363 | * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2364 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2365 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2366 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2367 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2368 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2369 | * </code></pre> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2370 | * <p>When set to other modes, lens shading correction will be applied by the camera |
| 2371 | * device. Applications can request lens shading map data by setting |
| 2372 | * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens |
| 2373 | * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map |
| 2374 | * data will be the one applied by the camera device for this capture request.</p> |
| 2375 | * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore |
| 2376 | * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and |
| 2377 | * AWB are in AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code> |
| 2378 | * OFF), to get best results, it is recommended that the applications wait for the AE and AWB |
| 2379 | * to be converged before using the returned shading map data.</p> |
| 2380 | * <p><b>Possible values:</b> |
| 2381 | * <ul> |
| 2382 | * <li>{@link #SHADING_MODE_OFF OFF}</li> |
| 2383 | * <li>{@link #SHADING_MODE_FAST FAST}</li> |
| 2384 | * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 2385 | * </ul></p> |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 2386 | * <p><b>Available values for this device:</b><br> |
| 2387 | * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2388 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2389 | * <p><b>Full capability</b> - |
| 2390 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2391 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2392 | * |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 2393 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2394 | * @see CaptureRequest#CONTROL_AWB_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2395 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 2396 | * @see CameraCharacteristics#SHADING_AVAILABLE_MODES |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2397 | * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2398 | * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE |
| 2399 | * @see #SHADING_MODE_OFF |
| 2400 | * @see #SHADING_MODE_FAST |
| 2401 | * @see #SHADING_MODE_HIGH_QUALITY |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2402 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2403 | @PublicKey |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2404 | public static final Key<Integer> SHADING_MODE = |
| 2405 | new Key<Integer>("android.shading.mode", int.class); |
| 2406 | |
| 2407 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2408 | * <p>Operating mode for the face detector |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2409 | * unit.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2410 | * <p>Whether face detection is enabled, and whether it |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2411 | * should output just the basic fields or the full set of |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2412 | * fields.</p> |
| 2413 | * <p><b>Possible values:</b> |
| 2414 | * <ul> |
| 2415 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li> |
| 2416 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li> |
| 2417 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li> |
| 2418 | * </ul></p> |
| 2419 | * <p><b>Available values for this device:</b><br> |
| 2420 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p> |
| 2421 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2422 | * |
| 2423 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2424 | * @see #STATISTICS_FACE_DETECT_MODE_OFF |
| 2425 | * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE |
| 2426 | * @see #STATISTICS_FACE_DETECT_MODE_FULL |
| 2427 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2428 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2429 | public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = |
| 2430 | new Key<Integer>("android.statistics.faceDetectMode", int.class); |
| 2431 | |
| 2432 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2433 | * <p>Operating mode for hot pixel map generation.</p> |
| 2434 | * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}. |
| 2435 | * If set to <code>false</code>, no hot pixel map will be returned.</p> |
| 2436 | * <p><b>Range of valid values:</b><br> |
| 2437 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2438 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 2439 | * |
| 2440 | * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP |
| 2441 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES |
| 2442 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2443 | @PublicKey |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 2444 | public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = |
| 2445 | new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); |
| 2446 | |
| 2447 | /** |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 2448 | * <p>Whether the camera device will output the lens |
| 2449 | * shading map in output result metadata.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2450 | * <p>When set to ON, |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2451 | * android.statistics.lensShadingMap will be provided in |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 2452 | * the output result metadata.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2453 | * <p>ON is always supported on devices with the RAW capability.</p> |
| 2454 | * <p><b>Possible values:</b> |
| 2455 | * <ul> |
| 2456 | * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li> |
| 2457 | * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li> |
| 2458 | * </ul></p> |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 2459 | * <p><b>Available values for this device:</b><br> |
| 2460 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2461 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2462 | * <p><b>Full capability</b> - |
| 2463 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2464 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2465 | * |
| 2466 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 2467 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES |
Eino-Ville Talvala | d96748b | 2013-09-12 11:11:27 -0700 | [diff] [blame] | 2468 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF |
| 2469 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON |
| 2470 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2471 | @PublicKey |
Eino-Ville Talvala | d96748b | 2013-09-12 11:11:27 -0700 | [diff] [blame] | 2472 | public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = |
| 2473 | new Key<Integer>("android.statistics.lensShadingMapMode", int.class); |
| 2474 | |
| 2475 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2476 | * <p>Tonemapping / contrast / gamma curve for the blue |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2477 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2478 | * CONTRAST_CURVE.</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2479 | * <p>See android.tonemap.curveRed for more details.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2480 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2481 | * <p><b>Full capability</b> - |
| 2482 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2483 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2484 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2485 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2486 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2487 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2488 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 2489 | public static final Key<float[]> TONEMAP_CURVE_BLUE = |
| 2490 | new Key<float[]>("android.tonemap.curveBlue", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2491 | |
| 2492 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2493 | * <p>Tonemapping / contrast / gamma curve for the green |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2494 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2495 | * CONTRAST_CURVE.</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2496 | * <p>See android.tonemap.curveRed for more details.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2497 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2498 | * <p><b>Full capability</b> - |
| 2499 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2500 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2501 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2502 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2503 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2504 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2505 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 2506 | public static final Key<float[]> TONEMAP_CURVE_GREEN = |
| 2507 | new Key<float[]>("android.tonemap.curveGreen", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2508 | |
| 2509 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2510 | * <p>Tonemapping / contrast / gamma curve for the red |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2511 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2512 | * CONTRAST_CURVE.</p> |
| 2513 | * <p>Each channel's curve is defined by an array of control points:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2514 | * <pre><code>android.tonemap.curveRed = |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2515 | * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] |
Zhijun He | 870922b | 2014-02-15 21:47:51 -0800 | [diff] [blame] | 2516 | * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2517 | * <p>These are sorted in order of increasing <code>Pin</code>; it is |
| 2518 | * required that input values 0.0 and 1.0 are included in the list to |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2519 | * define a complete mapping. For input values between control points, |
| 2520 | * the camera device must linearly interpolate between the control |
| 2521 | * points.</p> |
| 2522 | * <p>Each curve can have an independent number of points, and the number |
| 2523 | * of points can be less than max (that is, the request doesn't have to |
| 2524 | * always provide a curve with number of points equivalent to |
| 2525 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
| 2526 | * <p>A few examples, and their corresponding graphical mappings; these |
| 2527 | * only specify the red channel and the precision is limited to 4 |
| 2528 | * digits, for conciseness.</p> |
| 2529 | * <p>Linear mapping:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2530 | * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2531 | * </code></pre> |
| 2532 | * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> |
| 2533 | * <p>Invert mapping:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2534 | * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2535 | * </code></pre> |
| 2536 | * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> |
| 2537 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2538 | * <pre><code>android.tonemap.curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2539 | * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, |
| 2540 | * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, |
| 2541 | * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, |
| 2542 | * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2543 | * </code></pre> |
| 2544 | * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> |
| 2545 | * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2546 | * <pre><code>android.tonemap.curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2547 | * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, |
| 2548 | * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, |
| 2549 | * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, |
| 2550 | * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2551 | * </code></pre> |
| 2552 | * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2553 | * <p><b>Range of valid values:</b><br> |
| 2554 | * 0-1 on both input and output coordinates, normalized |
| 2555 | * as a floating-point value such that 0 == black and 1 == white.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2556 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2557 | * <p><b>Full capability</b> - |
| 2558 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2559 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2560 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2561 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2562 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2563 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2564 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2565 | */ |
| 2566 | public static final Key<float[]> TONEMAP_CURVE_RED = |
| 2567 | new Key<float[]>("android.tonemap.curveRed", float[].class); |
| 2568 | |
| 2569 | /** |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2570 | * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} |
| 2571 | * is CONTRAST_CURVE.</p> |
| 2572 | * <p>The tonemapCurve consist of three curves for each of red, green, and blue |
| 2573 | * channels respectively. The following example uses the red channel as an |
| 2574 | * example. The same logic applies to green and blue channel. |
| 2575 | * Each channel's curve is defined by an array of control points:</p> |
| 2576 | * <pre><code>curveRed = |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2577 | * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ] |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2578 | * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> |
| 2579 | * <p>These are sorted in order of increasing <code>Pin</code>; it is always |
| 2580 | * guaranteed that input values 0.0 and 1.0 are included in the list to |
| 2581 | * define a complete mapping. For input values between control points, |
| 2582 | * the camera device must linearly interpolate between the control |
| 2583 | * points.</p> |
| 2584 | * <p>Each curve can have an independent number of points, and the number |
| 2585 | * of points can be less than max (that is, the request doesn't have to |
| 2586 | * always provide a curve with number of points equivalent to |
| 2587 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
| 2588 | * <p>A few examples, and their corresponding graphical mappings; these |
| 2589 | * only specify the red channel and the precision is limited to 4 |
| 2590 | * digits, for conciseness.</p> |
| 2591 | * <p>Linear mapping:</p> |
| 2592 | * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ] |
| 2593 | * </code></pre> |
| 2594 | * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> |
| 2595 | * <p>Invert mapping:</p> |
| 2596 | * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ] |
| 2597 | * </code></pre> |
| 2598 | * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> |
| 2599 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
| 2600 | * <pre><code>curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2601 | * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812), |
| 2602 | * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072), |
| 2603 | * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685), |
| 2604 | * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ] |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2605 | * </code></pre> |
| 2606 | * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> |
| 2607 | * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> |
| 2608 | * <pre><code>curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2609 | * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845), |
| 2610 | * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130), |
| 2611 | * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721), |
| 2612 | * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ] |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2613 | * </code></pre> |
| 2614 | * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2615 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2616 | * <p><b>Full capability</b> - |
| 2617 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2618 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2619 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2620 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2621 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
| 2622 | * @see CaptureRequest#TONEMAP_MODE |
| 2623 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2624 | @PublicKey |
| 2625 | @SyntheticKey |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2626 | public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE = |
| 2627 | new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class); |
| 2628 | |
| 2629 | /** |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2630 | * <p>High-level global contrast/gamma/tonemapping control.</p> |
| 2631 | * <p>When switching to an application-defined contrast curve by setting |
| 2632 | * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined |
| 2633 | * per-channel with a set of <code>(in, out)</code> points that specify the |
| 2634 | * mapping from input high-bit-depth pixel value to the output |
| 2635 | * low-bit-depth value. Since the actual pixel ranges of both input |
| 2636 | * and output may change depending on the camera pipeline, the values |
| 2637 | * are specified by normalized floating-point numbers.</p> |
| 2638 | * <p>More-complex color mapping operations such as 3D color look-up |
| 2639 | * tables, selective chroma enhancement, or other non-linear color |
| 2640 | * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2641 | * CONTRAST_CURVE.</p> |
| 2642 | * <p>When using either FAST or HIGH_QUALITY, the camera device will |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2643 | * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}. |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2644 | * These values are always available, and as close as possible to the |
| 2645 | * actually used nonlinear/nonglobal transforms.</p> |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 2646 | * <p>If a request is sent with CONTRAST_CURVE with the camera device's |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2647 | * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be |
| 2648 | * roughly the same.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2649 | * <p><b>Possible values:</b> |
| 2650 | * <ul> |
| 2651 | * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li> |
| 2652 | * <li>{@link #TONEMAP_MODE_FAST FAST}</li> |
| 2653 | * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 2654 | * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li> |
| 2655 | * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2656 | * </ul></p> |
| 2657 | * <p><b>Available values for this device:</b><br> |
| 2658 | * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2659 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2660 | * <p><b>Full capability</b> - |
| 2661 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2662 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 2663 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2664 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2665 | * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2666 | * @see CaptureRequest#TONEMAP_CURVE |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2667 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2668 | * @see #TONEMAP_MODE_CONTRAST_CURVE |
| 2669 | * @see #TONEMAP_MODE_FAST |
| 2670 | * @see #TONEMAP_MODE_HIGH_QUALITY |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 2671 | * @see #TONEMAP_MODE_GAMMA_VALUE |
| 2672 | * @see #TONEMAP_MODE_PRESET_CURVE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2673 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2674 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2675 | public static final Key<Integer> TONEMAP_MODE = |
| 2676 | new Key<Integer>("android.tonemap.mode", int.class); |
| 2677 | |
| 2678 | /** |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 2679 | * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2680 | * GAMMA_VALUE</p> |
| 2681 | * <p>The tonemap curve will be defined the following formula: |
| 2682 | * * OUT = pow(IN, 1.0 / gamma) |
| 2683 | * where IN and OUT is the input pixel value scaled to range [0.0, 1.0], |
| 2684 | * pow is the power function and gamma is the gamma value specified by this |
| 2685 | * key.</p> |
| 2686 | * <p>The same curve will be applied to all color channels. The camera device |
| 2687 | * may clip the input gamma value to its supported range. The actual applied |
| 2688 | * value will be returned in capture result.</p> |
| 2689 | * <p>The valid range of gamma value varies on different devices, but values |
| 2690 | * within [1.0, 5.0] are guaranteed not to be clipped.</p> |
| 2691 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2692 | * |
| 2693 | * @see CaptureRequest#TONEMAP_MODE |
| 2694 | */ |
| 2695 | @PublicKey |
| 2696 | public static final Key<Float> TONEMAP_GAMMA = |
| 2697 | new Key<Float>("android.tonemap.gamma", float.class); |
| 2698 | |
| 2699 | /** |
| 2700 | * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2701 | * PRESET_CURVE</p> |
| 2702 | * <p>The tonemap curve will be defined by specified standard.</p> |
| 2703 | * <p>sRGB (approximated by 16 control points):</p> |
| 2704 | * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> |
| 2705 | * <p>Rec. 709 (approximated by 16 control points):</p> |
| 2706 | * <p><img alt="Rec. 709 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p> |
| 2707 | * <p>Note that above figures show a 16 control points approximation of preset |
| 2708 | * curves. Camera devices may apply a different approximation to the curve.</p> |
| 2709 | * <p><b>Possible values:</b> |
| 2710 | * <ul> |
| 2711 | * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li> |
| 2712 | * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li> |
| 2713 | * </ul></p> |
| 2714 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2715 | * |
| 2716 | * @see CaptureRequest#TONEMAP_MODE |
| 2717 | * @see #TONEMAP_PRESET_CURVE_SRGB |
| 2718 | * @see #TONEMAP_PRESET_CURVE_REC709 |
| 2719 | */ |
| 2720 | @PublicKey |
| 2721 | public static final Key<Integer> TONEMAP_PRESET_CURVE = |
| 2722 | new Key<Integer>("android.tonemap.presetCurve", int.class); |
| 2723 | |
| 2724 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2725 | * <p>This LED is nominally used to indicate to the user |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2726 | * that the camera is powered on and may be streaming images back to the |
| 2727 | * Application Processor. In certain rare circumstances, the OS may |
| 2728 | * disable this when video is processed locally and not transmitted to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2729 | * any untrusted applications.</p> |
| 2730 | * <p>In particular, the LED <em>must</em> always be on when the data could be |
| 2731 | * transmitted off the device. The LED <em>should</em> always be on whenever |
| 2732 | * data is stored locally on the device.</p> |
| 2733 | * <p>The LED <em>may</em> be off if a trusted application is using the data that |
| 2734 | * doesn't violate the above rules.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2735 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2736 | * @hide |
| 2737 | */ |
| 2738 | public static final Key<Boolean> LED_TRANSMIT = |
| 2739 | new Key<Boolean>("android.led.transmit", boolean.class); |
| 2740 | |
| 2741 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2742 | * <p>Whether black-level compensation is locked |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 2743 | * to its current values, or is free to vary.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2744 | * <p>When set to <code>true</code> (ON), the values used for black-level |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 2745 | * compensation will not change until the lock is set to |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2746 | * <code>false</code> (OFF).</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2747 | * <p>Since changes to certain capture parameters (such as |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2748 | * exposure time) may require resetting of black level |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 2749 | * compensation, the camera device must report whether setting |
| 2750 | * the black level lock was successful in the output result |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2751 | * metadata.</p> |
| 2752 | * <p>For example, if a sequence of requests is as follows:</p> |
| 2753 | * <ul> |
| 2754 | * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li> |
| 2755 | * <li>Request 2: Exposure = 10ms, Black level lock = ON</li> |
| 2756 | * <li>Request 3: Exposure = 10ms, Black level lock = ON</li> |
| 2757 | * <li>Request 4: Exposure = 20ms, Black level lock = ON</li> |
| 2758 | * <li>Request 5: Exposure = 20ms, Black level lock = ON</li> |
| 2759 | * <li>Request 6: Exposure = 20ms, Black level lock = ON</li> |
| 2760 | * </ul> |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 2761 | * <p>And the exposure change in Request 4 requires the camera |
| 2762 | * device to reset the black level offsets, then the output |
| 2763 | * result metadata is expected to be:</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2764 | * <ul> |
| 2765 | * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li> |
| 2766 | * <li>Result 2: Exposure = 10ms, Black level lock = ON</li> |
| 2767 | * <li>Result 3: Exposure = 10ms, Black level lock = ON</li> |
| 2768 | * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li> |
| 2769 | * <li>Result 5: Exposure = 20ms, Black level lock = ON</li> |
| 2770 | * <li>Result 6: Exposure = 20ms, Black level lock = ON</li> |
| 2771 | * </ul> |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 2772 | * <p>This indicates to the application that on frame 4, black |
| 2773 | * levels were reset due to exposure value changes, and pixel |
| 2774 | * values may not be consistent across captures.</p> |
| 2775 | * <p>The camera device will maintain the lock to the extent |
| 2776 | * possible, only overriding the lock to OFF when changes to |
| 2777 | * other request parameters require a black level recalculation |
| 2778 | * or reset.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2779 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2780 | * <p><b>Full capability</b> - |
| 2781 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2782 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2783 | * |
| 2784 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2785 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2786 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2787 | public static final Key<Boolean> BLACK_LEVEL_LOCK = |
| 2788 | new Key<Boolean>("android.blackLevel.lock", boolean.class); |
| 2789 | |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2790 | /** |
| 2791 | * <p>The amount of exposure time increase factor applied to the original output |
| 2792 | * frame by the application processing before sending for reprocessing.</p> |
| 2793 | * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING |
| 2794 | * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p> |
| 2795 | * <p>For some YUV reprocessing use cases, the application may choose to filter the original |
| 2796 | * output frames to effectively reduce the noise to the same level as a frame that was |
| 2797 | * captured with longer exposure time. To be more specific, assuming the original captured |
| 2798 | * images were captured with a sensitivity of S and an exposure time of T, the model in |
| 2799 | * the camera device is that the amount of noise in the image would be approximately what |
| 2800 | * would be expected if the original capture parameters had been a sensitivity of |
| 2801 | * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather |
| 2802 | * than S and T respectively. If the captured images were processed by the application |
| 2803 | * before being sent for reprocessing, then the application may have used image processing |
| 2804 | * algorithms and/or multi-frame image fusion to reduce the noise in the |
| 2805 | * application-processed images (input images). By using the effectiveExposureFactor |
| 2806 | * control, the application can communicate to the camera device the actual noise level |
| 2807 | * improvement in the application-processed image. With this information, the camera |
| 2808 | * device can select appropriate noise reduction and edge enhancement parameters to avoid |
| 2809 | * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge |
| 2810 | * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p> |
| 2811 | * <p>For example, for multi-frame image fusion use case, the application may fuse |
| 2812 | * multiple output frames together to a final frame for reprocessing. When N image are |
| 2813 | * fused into 1 image for reprocessing, the exposure time increase factor could be up to |
| 2814 | * square root of N (based on a simple photon shot noise model). The camera device will |
| 2815 | * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to |
| 2816 | * produce the best quality images.</p> |
| 2817 | * <p>This is relative factor, 1.0 indicates the application hasn't processed the input |
| 2818 | * buffer in a way that affects its effective exposure time.</p> |
| 2819 | * <p>This control is only effective for YUV reprocessing capture request. For noise |
| 2820 | * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>. |
| 2821 | * Similarly, for edge enhancement reprocessing, it is only effective when |
| 2822 | * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p> |
| 2823 | * <p><b>Units</b>: Relative exposure time increase factor.</p> |
| 2824 | * <p><b>Range of valid values:</b><br> |
| 2825 | * >= 1.0</p> |
| 2826 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Zhijun He | 513f7c3 | 2015-04-24 18:23:54 -0700 | [diff] [blame] | 2827 | * <p><b>Limited capability</b> - |
| 2828 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2829 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2830 | * |
| 2831 | * @see CaptureRequest#EDGE_MODE |
Zhijun He | 513f7c3 | 2015-04-24 18:23:54 -0700 | [diff] [blame] | 2832 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2833 | * @see CaptureRequest#NOISE_REDUCTION_MODE |
| 2834 | * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES |
| 2835 | */ |
| 2836 | @PublicKey |
| 2837 | public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR = |
| 2838 | new Key<Float>("android.reprocess.effectiveExposureFactor", float.class); |
| 2839 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2840 | /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 2841 | * End generated code |
| 2842 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2843 | |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2844 | |
| 2845 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2846 | } |