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