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 |
| 811 | * {@link CameraCharacteristics#getPhysicalCameraIds} return a non-empty list of |
| 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 |
| 1460 | * camera device.</p> |
| 1461 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 1462 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 1463 | * region and output only the intersection rectangle as the metering region in the result |
| 1464 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 1465 | * not reported in the result metadata.</p> |
| 1466 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
| 1467 | * <p><b>Range of valid values:</b><br> |
| 1468 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
| 1469 | * {@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] | 1470 | * <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] | 1471 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1472 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1473 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1474 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1475 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1476 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 1477 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS = |
| 1478 | 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] | 1479 | |
| 1480 | /** |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1481 | * <p>Whether the camera device will trigger autofocus for this request.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1482 | * <p>This entry is normally set to IDLE, or is not |
| 1483 | * included at all in the request settings.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1484 | * <p>When included and set to START, the camera device will trigger the |
| 1485 | * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p> |
| 1486 | * <p>When set to CANCEL, the camera device will cancel any active trigger, |
| 1487 | * and return to its initial AF state.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1488 | * <p>Generally, applications should set this entry to START or CANCEL for only a |
| 1489 | * single capture, and then return it to IDLE (or not set at all). Specifying |
| 1490 | * START for multiple captures in a row means restarting the AF operation over |
| 1491 | * and over again.</p> |
| 1492 | * <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] | 1493 | * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} |
| 1494 | * simultaneously is allowed. However, since these triggers often require cooperation between |
| 1495 | * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a |
| 1496 | * focus sweep), the camera device may delay acting on a later trigger until the previous |
| 1497 | * trigger has been fully handled. This may lead to longer intervals between the trigger and |
| 1498 | * 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] | 1499 | * <p><b>Possible values:</b> |
| 1500 | * <ul> |
| 1501 | * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li> |
| 1502 | * <li>{@link #CONTROL_AF_TRIGGER_START START}</li> |
| 1503 | * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li> |
| 1504 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1505 | * <p>This key is available on all devices.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1506 | * |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 1507 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1508 | * @see CaptureResult#CONTROL_AF_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1509 | * @see #CONTROL_AF_TRIGGER_IDLE |
| 1510 | * @see #CONTROL_AF_TRIGGER_START |
| 1511 | * @see #CONTROL_AF_TRIGGER_CANCEL |
| 1512 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1513 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1514 | public static final Key<Integer> CONTROL_AF_TRIGGER = |
| 1515 | new Key<Integer>("android.control.afTrigger", int.class); |
| 1516 | |
| 1517 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1518 | * <p>Whether auto-white balance (AWB) is currently locked to its |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 1519 | * latest calculated values.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1520 | * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters, |
| 1521 | * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p> |
| 1522 | * <p>Since the camera device has a pipeline of in-flight requests, the settings that |
| 1523 | * get locked do not necessarily correspond to the settings that were present in the |
| 1524 | * latest capture result received from the camera device, since additional captures |
| 1525 | * and AWB updates may have occurred even before the result was sent out. If an |
| 1526 | * application is switching between automatic and manual control and wishes to eliminate |
| 1527 | * any flicker during the switch, the following procedure is recommended:</p> |
| 1528 | * <ol> |
| 1529 | * <li>Starting in auto-AWB mode:</li> |
| 1530 | * <li>Lock AWB</li> |
| 1531 | * <li>Wait for the first result to be output that has the AWB locked</li> |
| 1532 | * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li> |
| 1533 | * <li>Submit the capture request, proceed to run manual AWB as desired.</li> |
| 1534 | * </ol> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1535 | * <p>Note that AWB lock is only meaningful when |
| 1536 | * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes, |
| 1537 | * AWB is already fixed to a specific setting.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1538 | * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p> |
| 1539 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1540 | * |
| 1541 | * @see CaptureRequest#CONTROL_AWB_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1542 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1543 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1544 | public static final Key<Boolean> CONTROL_AWB_LOCK = |
| 1545 | new Key<Boolean>("android.control.awbLock", boolean.class); |
| 1546 | |
| 1547 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1548 | * <p>Whether auto-white balance (AWB) is currently setting the color |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1549 | * transform fields, and what its illumination target |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1550 | * is.</p> |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1551 | * <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] | 1552 | * <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] | 1553 | * routine is enabled, overriding the application's selected |
| 1554 | * {@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] | 1555 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} |
| 1556 | * is OFF, the behavior of AWB is device dependent. It is recommened to |
| 1557 | * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before |
| 1558 | * setting AE mode to OFF.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1559 | * <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] | 1560 | * routine is disabled. The application manually controls the white |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1561 | * 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] | 1562 | * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1563 | * <p>When set to any other modes, the camera device's auto-white |
| 1564 | * balance routine is disabled. The camera device uses each |
| 1565 | * particular illumination target for white balance |
| 1566 | * adjustment. The application's values for |
| 1567 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, |
| 1568 | * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 1569 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1570 | * <p><b>Possible values:</b> |
| 1571 | * <ul> |
| 1572 | * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li> |
| 1573 | * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li> |
| 1574 | * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li> |
| 1575 | * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li> |
| 1576 | * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li> |
| 1577 | * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li> |
| 1578 | * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li> |
| 1579 | * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li> |
| 1580 | * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li> |
| 1581 | * </ul></p> |
| 1582 | * <p><b>Available values for this device:</b><br> |
| 1583 | * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1584 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1585 | * |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1586 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1587 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
| 1588 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1589 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1590 | * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1591 | * @see CaptureRequest#CONTROL_AWB_LOCK |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1592 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1593 | * @see #CONTROL_AWB_MODE_OFF |
| 1594 | * @see #CONTROL_AWB_MODE_AUTO |
| 1595 | * @see #CONTROL_AWB_MODE_INCANDESCENT |
| 1596 | * @see #CONTROL_AWB_MODE_FLUORESCENT |
| 1597 | * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT |
| 1598 | * @see #CONTROL_AWB_MODE_DAYLIGHT |
| 1599 | * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT |
| 1600 | * @see #CONTROL_AWB_MODE_TWILIGHT |
| 1601 | * @see #CONTROL_AWB_MODE_SHADE |
| 1602 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1603 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1604 | public static final Key<Integer> CONTROL_AWB_MODE = |
| 1605 | new Key<Integer>("android.control.awbMode", int.class); |
| 1606 | |
| 1607 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1608 | * <p>List of metering areas to use for auto-white-balance illuminant |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 1609 | * estimation.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1610 | * <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] | 1611 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1612 | * <p>The maximum number of regions supported by the device is determined by the value |
| 1613 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1614 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 1615 | * 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] | 1616 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 1617 | * {@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] | 1618 | * bottom-right pixel in the active pixel array.</p> |
| 1619 | * <p>The weight must range from 0 to 1000, and represents a weight |
| 1620 | * for every pixel in the area. This means that a large metering area |
| 1621 | * with the same weight as a smaller area will have more effect in |
| 1622 | * the metering result. Metering areas can partially overlap and the |
| 1623 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1624 | * <p>The weights are relative to weights of other white balance metering regions, so if |
| 1625 | * only one region is used, all non-zero weights will have the same effect. A region with |
| 1626 | * 0 weight is ignored.</p> |
| 1627 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 1628 | * camera device.</p> |
| 1629 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 1630 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 1631 | * region and output only the intersection rectangle as the metering region in the result |
| 1632 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 1633 | * not reported in the result metadata.</p> |
| 1634 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
| 1635 | * <p><b>Range of valid values:</b><br> |
| 1636 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
| 1637 | * {@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] | 1638 | * <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] | 1639 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1640 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1641 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1642 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1643 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1644 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 1645 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS = |
| 1646 | 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] | 1647 | |
| 1648 | /** |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1649 | * <p>Information to the camera device 3A (auto-exposure, |
| 1650 | * auto-focus, auto-white balance) routines about the purpose |
| 1651 | * of this capture, to help the camera device to decide optimal 3A |
| 1652 | * strategy.</p> |
Zhijun He | e30adb7 | 2014-04-09 19:04:31 -0700 | [diff] [blame] | 1653 | * <p>This control (except for MANUAL) is only effective if |
| 1654 | * <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] | 1655 | * <p>All intents are supported by all devices, except that: |
| 1656 | * * ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains |
| 1657 | * PRIVATE_REPROCESSING or YUV_REPROCESSING. |
| 1658 | * * MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains |
| 1659 | * MANUAL_SENSOR. |
| 1660 | * * MOTION_TRACKING will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains |
| 1661 | * MOTION_TRACKING.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1662 | * <p><b>Possible values:</b> |
| 1663 | * <ul> |
| 1664 | * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li> |
| 1665 | * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li> |
| 1666 | * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li> |
| 1667 | * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li> |
| 1668 | * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li> |
| 1669 | * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> |
| 1670 | * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li> |
Eino-Ville Talvala | ec99efa | 2017-11-29 15:35:42 -0800 | [diff] [blame] | 1671 | * <li>{@link #CONTROL_CAPTURE_INTENT_MOTION_TRACKING MOTION_TRACKING}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1672 | * </ul></p> |
| 1673 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1674 | * |
| 1675 | * @see CaptureRequest#CONTROL_MODE |
Zhijun He | e30adb7 | 2014-04-09 19:04:31 -0700 | [diff] [blame] | 1676 | * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1677 | * @see #CONTROL_CAPTURE_INTENT_CUSTOM |
| 1678 | * @see #CONTROL_CAPTURE_INTENT_PREVIEW |
| 1679 | * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE |
| 1680 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD |
| 1681 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT |
| 1682 | * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG |
Zhijun He | e30adb7 | 2014-04-09 19:04:31 -0700 | [diff] [blame] | 1683 | * @see #CONTROL_CAPTURE_INTENT_MANUAL |
Eino-Ville Talvala | ec99efa | 2017-11-29 15:35:42 -0800 | [diff] [blame] | 1684 | * @see #CONTROL_CAPTURE_INTENT_MOTION_TRACKING |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1685 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1686 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1687 | public static final Key<Integer> CONTROL_CAPTURE_INTENT = |
| 1688 | new Key<Integer>("android.control.captureIntent", int.class); |
| 1689 | |
| 1690 | /** |
Ruben Brunk | 5f1dcfe | 2014-01-17 16:42:51 -0800 | [diff] [blame] | 1691 | * <p>A special color effect to apply.</p> |
| 1692 | * <p>When this mode is set, a color effect will be applied |
| 1693 | * to images produced by the camera device. The interpretation |
| 1694 | * and implementation of these color effects is left to the |
| 1695 | * implementor of the camera device, and should not be |
| 1696 | * depended on to be consistent (or present) across all |
| 1697 | * devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1698 | * <p><b>Possible values:</b> |
| 1699 | * <ul> |
| 1700 | * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li> |
| 1701 | * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li> |
| 1702 | * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li> |
| 1703 | * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li> |
| 1704 | * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li> |
| 1705 | * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li> |
| 1706 | * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li> |
| 1707 | * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li> |
| 1708 | * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li> |
| 1709 | * </ul></p> |
| 1710 | * <p><b>Available values for this device:</b><br> |
| 1711 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1712 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1713 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1714 | * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1715 | * @see #CONTROL_EFFECT_MODE_OFF |
| 1716 | * @see #CONTROL_EFFECT_MODE_MONO |
| 1717 | * @see #CONTROL_EFFECT_MODE_NEGATIVE |
| 1718 | * @see #CONTROL_EFFECT_MODE_SOLARIZE |
| 1719 | * @see #CONTROL_EFFECT_MODE_SEPIA |
| 1720 | * @see #CONTROL_EFFECT_MODE_POSTERIZE |
| 1721 | * @see #CONTROL_EFFECT_MODE_WHITEBOARD |
| 1722 | * @see #CONTROL_EFFECT_MODE_BLACKBOARD |
| 1723 | * @see #CONTROL_EFFECT_MODE_AQUA |
| 1724 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1725 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1726 | public static final Key<Integer> CONTROL_EFFECT_MODE = |
| 1727 | new Key<Integer>("android.control.effectMode", int.class); |
| 1728 | |
| 1729 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1730 | * <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] | 1731 | * routines.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1732 | * <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] | 1733 | * 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] | 1734 | * capture parameters itself.</p> |
| 1735 | * <p>When set to AUTO, the individual algorithm controls in |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1736 | * 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] | 1737 | * <p>When set to USE_SCENE_MODE, the individual controls in |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 1738 | * android.control.* are mostly disabled, and the camera device |
| 1739 | * implements one of the scene mode settings (such as ACTION, |
| 1740 | * SUNSET, or PARTY) as it wishes. The camera device scene mode |
| 1741 | * 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] | 1742 | * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference |
| 1743 | * is that this frame will not be used by camera device background 3A statistics |
| 1744 | * update, as if this frame is never captured. This mode can be used in the scenario |
| 1745 | * where the application doesn't want a 3A manual control capture to affect |
| 1746 | * the subsequent auto 3A capture results.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1747 | * <p><b>Possible values:</b> |
| 1748 | * <ul> |
| 1749 | * <li>{@link #CONTROL_MODE_OFF OFF}</li> |
| 1750 | * <li>{@link #CONTROL_MODE_AUTO AUTO}</li> |
| 1751 | * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li> |
| 1752 | * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li> |
| 1753 | * </ul></p> |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 1754 | * <p><b>Available values for this device:</b><br> |
| 1755 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1756 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1757 | * |
| 1758 | * @see CaptureRequest#CONTROL_AF_MODE |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 1759 | * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1760 | * @see #CONTROL_MODE_OFF |
| 1761 | * @see #CONTROL_MODE_AUTO |
| 1762 | * @see #CONTROL_MODE_USE_SCENE_MODE |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 1763 | * @see #CONTROL_MODE_OFF_KEEP_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1764 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1765 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1766 | public static final Key<Integer> CONTROL_MODE = |
| 1767 | new Key<Integer>("android.control.mode", int.class); |
| 1768 | |
| 1769 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1770 | * <p>Control for which scene mode is currently active.</p> |
| 1771 | * <p>Scene modes are custom camera modes optimized for a certain set of conditions and |
| 1772 | * capture settings.</p> |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1773 | * <p>This is the mode that that is active when |
Zhijun He | ee2ebde | 2015-06-16 19:58:11 -0700 | [diff] [blame] | 1774 | * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will |
| 1775 | * 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} |
| 1776 | * while in use.</p> |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1777 | * <p>The interpretation and implementation of these scene modes is left |
| 1778 | * to the implementor of the camera device. Their behavior will not be |
| 1779 | * consistent across all devices, and any given device may only implement |
| 1780 | * a subset of these modes.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1781 | * <p><b>Possible values:</b> |
| 1782 | * <ul> |
| 1783 | * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li> |
| 1784 | * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li> |
| 1785 | * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li> |
| 1786 | * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li> |
| 1787 | * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li> |
| 1788 | * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li> |
| 1789 | * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li> |
| 1790 | * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li> |
| 1791 | * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li> |
| 1792 | * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li> |
| 1793 | * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li> |
| 1794 | * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li> |
| 1795 | * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li> |
| 1796 | * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li> |
| 1797 | * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li> |
| 1798 | * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li> |
| 1799 | * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li> |
| 1800 | * <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] | 1801 | * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1802 | * </ul></p> |
| 1803 | * <p><b>Available values for this device:</b><br> |
| 1804 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1805 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1806 | * |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1807 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1808 | * @see CaptureRequest#CONTROL_AF_MODE |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1809 | * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1810 | * @see CaptureRequest#CONTROL_AWB_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1811 | * @see CaptureRequest#CONTROL_MODE |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1812 | * @see #CONTROL_SCENE_MODE_DISABLED |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1813 | * @see #CONTROL_SCENE_MODE_FACE_PRIORITY |
| 1814 | * @see #CONTROL_SCENE_MODE_ACTION |
| 1815 | * @see #CONTROL_SCENE_MODE_PORTRAIT |
| 1816 | * @see #CONTROL_SCENE_MODE_LANDSCAPE |
| 1817 | * @see #CONTROL_SCENE_MODE_NIGHT |
| 1818 | * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT |
| 1819 | * @see #CONTROL_SCENE_MODE_THEATRE |
| 1820 | * @see #CONTROL_SCENE_MODE_BEACH |
| 1821 | * @see #CONTROL_SCENE_MODE_SNOW |
| 1822 | * @see #CONTROL_SCENE_MODE_SUNSET |
| 1823 | * @see #CONTROL_SCENE_MODE_STEADYPHOTO |
| 1824 | * @see #CONTROL_SCENE_MODE_FIREWORKS |
| 1825 | * @see #CONTROL_SCENE_MODE_SPORTS |
| 1826 | * @see #CONTROL_SCENE_MODE_PARTY |
| 1827 | * @see #CONTROL_SCENE_MODE_CANDLELIGHT |
| 1828 | * @see #CONTROL_SCENE_MODE_BARCODE |
Zhijun He | e040418 | 2014-06-26 13:17:09 -0700 | [diff] [blame] | 1829 | * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO |
Eino-Ville Talvala | f4eac12 | 2014-12-05 11:10:15 -0800 | [diff] [blame] | 1830 | * @see #CONTROL_SCENE_MODE_HDR |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1831 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1832 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1833 | public static final Key<Integer> CONTROL_SCENE_MODE = |
| 1834 | new Key<Integer>("android.control.sceneMode", int.class); |
| 1835 | |
| 1836 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1837 | * <p>Whether video stabilization is |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1838 | * active.</p> |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 1839 | * <p>Video stabilization automatically warps images from |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1840 | * the camera in order to stabilize motion between consecutive frames.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1841 | * <p>If enabled, video stabilization can modify the |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 1842 | * {@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] | 1843 | * <p>Switching between different video stabilization modes may take several |
| 1844 | * frames to initialize, the camera device will report the current mode |
| 1845 | * in capture result metadata. For example, When "ON" mode is requested, |
| 1846 | * the video stabilization modes in the first several capture results may |
| 1847 | * still be "OFF", and it will become "ON" when the initialization is |
| 1848 | * done.</p> |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 1849 | * <p>In addition, not all recording sizes or frame rates may be supported for |
| 1850 | * stabilization by a device that reports stabilization support. It is guaranteed |
| 1851 | * that an output targeting a MediaRecorder or MediaCodec will be stabilized if |
| 1852 | * the recording resolution is less than or equal to 1920 x 1080 (width less than |
| 1853 | * or equal to 1920, height less than or equal to 1080), and the recording |
| 1854 | * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult |
| 1855 | * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return |
| 1856 | * OFF if the recording output is not stabilized, or if there are no output |
| 1857 | * Surface types that can be stabilized.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1858 | * <p>If a camera device supports both this mode and OIS |
| 1859 | * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may |
| 1860 | * produce undesirable interaction, so it is recommended not to enable |
| 1861 | * both at the same time.</p> |
| 1862 | * <p><b>Possible values:</b> |
| 1863 | * <ul> |
| 1864 | * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li> |
| 1865 | * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li> |
| 1866 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1867 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1868 | * |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 1869 | * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 1870 | * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1871 | * @see CaptureRequest#SCALER_CROP_REGION |
Zhijun He | 4793af5 | 2014-05-05 10:39:12 -0700 | [diff] [blame] | 1872 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF |
| 1873 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1874 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1875 | @PublicKey |
Zhijun He | 4793af5 | 2014-05-05 10:39:12 -0700 | [diff] [blame] | 1876 | public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE = |
| 1877 | new Key<Integer>("android.control.videoStabilizationMode", int.class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1878 | |
| 1879 | /** |
Yin-Chia Yeh | 33052d3 | 2016-04-11 16:39:02 -0700 | [diff] [blame] | 1880 | * <p>The amount of additional sensitivity boost applied to output images |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 1881 | * after RAW sensor data is captured.</p> |
| 1882 | * <p>Some camera devices support additional digital sensitivity boosting in the |
| 1883 | * camera processing pipeline after sensor RAW image is captured. |
| 1884 | * Such a boost will be applied to YUV/JPEG format output images but will not |
| 1885 | * 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] | 1886 | * <p>This key will be <code>null</code> for devices that do not support any RAW format |
| 1887 | * outputs. For devices that do support RAW format outputs, this key will always |
| 1888 | * present, and if a device does not support post RAW sensitivity boost, it will |
| 1889 | * list <code>100</code> in this key.</p> |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 1890 | * <p>If the camera device cannot apply the exact boost requested, it will reduce the |
| 1891 | * boost to the nearest supported value. |
| 1892 | * The final boost value used will be available in the output capture result.</p> |
| 1893 | * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images |
| 1894 | * of such device will have the total sensitivity of |
Yin-Chia Yeh | 67e61b6 | 2016-01-26 13:27:35 -0800 | [diff] [blame] | 1895 | * <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] | 1896 | * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p> |
| 1897 | * <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 |
| 1898 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 1899 | * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p> |
| 1900 | * <p><b>Range of valid values:</b><br> |
| 1901 | * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p> |
| 1902 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1903 | * |
| 1904 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1905 | * @see CaptureRequest#CONTROL_MODE |
| 1906 | * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST |
| 1907 | * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE |
| 1908 | * @see CaptureRequest#SENSOR_SENSITIVITY |
| 1909 | */ |
| 1910 | @PublicKey |
| 1911 | public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST = |
| 1912 | new Key<Integer>("android.control.postRawSensitivityBoost", int.class); |
| 1913 | |
| 1914 | /** |
Chien-Yu Chen | e449171 | 2017-01-11 11:14:06 -0800 | [diff] [blame] | 1915 | * <p>Allow camera device to enable zero-shutter-lag mode for requests with |
| 1916 | * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p> |
| 1917 | * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with |
| 1918 | * STILL_CAPTURE capture intent. The camera device may use images captured in the past to |
| 1919 | * produce output images for a zero-shutter-lag request. The result metadata including the |
| 1920 | * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images. |
| 1921 | * Therefore, the contents of the output images and the result metadata may be out of order |
| 1922 | * compared to previous regular requests. enableZsl does not affect requests with other |
| 1923 | * capture intents.</p> |
| 1924 | * <p>For example, when requests are submitted in the following order: |
| 1925 | * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW |
| 1926 | * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p> |
| 1927 | * <p>The output images for request B may have contents captured before the output images for |
| 1928 | * request A, and the result metadata for request B may be older than the result metadata for |
| 1929 | * request A.</p> |
Chien-Yu Chen | 1d72ee3 | 2017-04-18 15:23:06 -0700 | [diff] [blame] | 1930 | * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in |
| 1931 | * the past for requests with STILL_CAPTURE capture intent.</p> |
| 1932 | * <p>For applications targeting SDK versions O and newer, the value of enableZsl in |
| 1933 | * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always |
| 1934 | * <code>false</code> if present.</p> |
| 1935 | * <p>For applications targeting SDK versions older than O, the value of enableZsl in all |
| 1936 | * capture templates is always <code>false</code> if present.</p> |
Chien-Yu Chen | 8102638 | 2017-05-03 12:30:58 -0700 | [diff] [blame] | 1937 | * <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] | 1938 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1939 | * |
| 1940 | * @see CaptureRequest#CONTROL_CAPTURE_INTENT |
| 1941 | * @see CaptureResult#SENSOR_TIMESTAMP |
| 1942 | */ |
| 1943 | @PublicKey |
| 1944 | public static final Key<Boolean> CONTROL_ENABLE_ZSL = |
| 1945 | new Key<Boolean>("android.control.enableZsl", boolean.class); |
| 1946 | |
| 1947 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1948 | * <p>Operation mode for edge |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1949 | * enhancement.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1950 | * <p>Edge enhancement improves sharpness and details in the captured image. OFF means |
| 1951 | * no enhancement will be applied by the camera device.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1952 | * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 1953 | * will be applied. HIGH_QUALITY mode indicates that the |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1954 | * camera device will use the highest-quality enhancement algorithms, |
| 1955 | * 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] | 1956 | * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if |
| 1957 | * edge enhancement will slow down capture rate. Every output stream will have a similar |
| 1958 | * amount of enhancement applied.</p> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 1959 | * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular |
| 1960 | * buffer of high-resolution images during preview and reprocess image(s) from that buffer |
| 1961 | * into a final capture when triggered by the user. In this mode, the camera device applies |
| 1962 | * edge enhancement to low-resolution streams (below maximum recording resolution) to |
| 1963 | * maximize preview quality, but does not apply edge enhancement to high-resolution streams, |
| 1964 | * since those will be reprocessed later if necessary.</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 1965 | * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera |
| 1966 | * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively. |
Chien-Yu Chen | 9c9167e | 2015-07-14 16:38:25 -0700 | [diff] [blame] | 1967 | * The camera device may adjust its internal edge enhancement parameters for best |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 1968 | * 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] | 1969 | * <p><b>Possible values:</b> |
| 1970 | * <ul> |
| 1971 | * <li>{@link #EDGE_MODE_OFF OFF}</li> |
| 1972 | * <li>{@link #EDGE_MODE_FAST FAST}</li> |
| 1973 | * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 1974 | * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1975 | * </ul></p> |
| 1976 | * <p><b>Available values for this device:</b><br> |
| 1977 | * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1978 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1979 | * <p><b>Full capability</b> - |
| 1980 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1981 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 1982 | * |
| 1983 | * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1984 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 1985 | * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1986 | * @see #EDGE_MODE_OFF |
| 1987 | * @see #EDGE_MODE_FAST |
| 1988 | * @see #EDGE_MODE_HIGH_QUALITY |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 1989 | * @see #EDGE_MODE_ZERO_SHUTTER_LAG |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1990 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1991 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1992 | public static final Key<Integer> EDGE_MODE = |
| 1993 | new Key<Integer>("android.edge.mode", int.class); |
| 1994 | |
| 1995 | /** |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1996 | * <p>The desired mode for for the camera device's flash control.</p> |
| 1997 | * <p>This control is only effective when flash unit is available |
Zhijun He | 153ac10 | 2014-02-03 12:25:12 -0800 | [diff] [blame] | 1998 | * (<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] | 1999 | * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. |
| 2000 | * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, |
| 2001 | * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> |
| 2002 | * <p>When set to OFF, the camera device will not fire flash for this capture.</p> |
| 2003 | * <p>When set to SINGLE, the camera device will fire flash regardless of the camera |
| 2004 | * 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] | 2005 | * control should be used along with auto-exposure (AE) precapture metering sequence |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 2006 | * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> |
| 2007 | * <p>When set to TORCH, the flash will be on continuously. This mode can be used |
| 2008 | * 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] | 2009 | * <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] | 2010 | * <p><b>Possible values:</b> |
| 2011 | * <ul> |
| 2012 | * <li>{@link #FLASH_MODE_OFF OFF}</li> |
| 2013 | * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li> |
| 2014 | * <li>{@link #FLASH_MODE_TORCH TORCH}</li> |
| 2015 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2016 | * <p>This key is available on all devices.</p> |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 2017 | * |
| 2018 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2019 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 2020 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2021 | * @see CaptureResult#FLASH_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2022 | * @see #FLASH_MODE_OFF |
| 2023 | * @see #FLASH_MODE_SINGLE |
| 2024 | * @see #FLASH_MODE_TORCH |
| 2025 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2026 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2027 | public static final Key<Integer> FLASH_MODE = |
| 2028 | new Key<Integer>("android.flash.mode", int.class); |
| 2029 | |
| 2030 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2031 | * <p>Operational mode for hot pixel correction.</p> |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 2032 | * <p>Hotpixel correction interpolates out, or otherwise removes, pixels |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2033 | * that do not accurately measure the incoming light (i.e. pixels that |
| 2034 | * are stuck at an arbitrary value or are oversensitive).</p> |
| 2035 | * <p><b>Possible values:</b> |
| 2036 | * <ul> |
| 2037 | * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li> |
| 2038 | * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li> |
| 2039 | * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 2040 | * </ul></p> |
| 2041 | * <p><b>Available values for this device:</b><br> |
| 2042 | * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2043 | * <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] | 2044 | * |
| 2045 | * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 2046 | * @see #HOT_PIXEL_MODE_OFF |
| 2047 | * @see #HOT_PIXEL_MODE_FAST |
| 2048 | * @see #HOT_PIXEL_MODE_HIGH_QUALITY |
| 2049 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2050 | @PublicKey |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 2051 | public static final Key<Integer> HOT_PIXEL_MODE = |
| 2052 | new Key<Integer>("android.hotPixel.mode", int.class); |
| 2053 | |
| 2054 | /** |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2055 | * <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] | 2056 | * <p>Setting a location object in a request will include the GPS coordinates of the location |
| 2057 | * into any JPEG images captured based on the request. These coordinates can then be |
| 2058 | * viewed by anyone who receives the JPEG image.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2059 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2060 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2061 | @PublicKey |
| 2062 | @SyntheticKey |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2063 | public static final Key<android.location.Location> JPEG_GPS_LOCATION = |
| 2064 | new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class); |
| 2065 | |
| 2066 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2067 | * <p>GPS coordinates to include in output JPEG |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2068 | * EXIF.</p> |
| 2069 | * <p><b>Range of valid values:</b><br> |
| 2070 | * (-180 - 180], [-90,90], [-inf, inf]</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2071 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2072 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2073 | */ |
| 2074 | public static final Key<double[]> JPEG_GPS_COORDINATES = |
| 2075 | new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); |
| 2076 | |
| 2077 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2078 | * <p>32 characters describing GPS algorithm to |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2079 | * include in EXIF.</p> |
| 2080 | * <p><b>Units</b>: UTF-8 null-terminated string</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2081 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2082 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2083 | */ |
| 2084 | public static final Key<String> JPEG_GPS_PROCESSING_METHOD = |
| 2085 | new Key<String>("android.jpeg.gpsProcessingMethod", String.class); |
| 2086 | |
| 2087 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2088 | * <p>Time GPS fix was made to include in |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2089 | * EXIF.</p> |
| 2090 | * <p><b>Units</b>: UTC in seconds since January 1, 1970</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2091 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2092 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2093 | */ |
| 2094 | public static final Key<Long> JPEG_GPS_TIMESTAMP = |
| 2095 | new Key<Long>("android.jpeg.gpsTimestamp", long.class); |
| 2096 | |
| 2097 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2098 | * <p>The orientation for a JPEG image.</p> |
| 2099 | * <p>The clockwise rotation angle in degrees, relative to the orientation |
| 2100 | * to the camera, that the JPEG picture needs to be rotated by, to be viewed |
| 2101 | * upright.</p> |
| 2102 | * <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] | 2103 | * rotate the image data to match this orientation. When the image data is rotated, |
| 2104 | * the thumbnail data will also be rotated.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2105 | * <p>Note that this orientation is relative to the orientation of the camera sensor, given |
| 2106 | * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p> |
| 2107 | * <p>To translate from the device orientation given by the Android sensor APIs, the following |
| 2108 | * sample code may be used:</p> |
| 2109 | * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) { |
| 2110 | * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0; |
| 2111 | * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION); |
| 2112 | * |
| 2113 | * // Round device orientation to a multiple of 90 |
| 2114 | * deviceOrientation = (deviceOrientation + 45) / 90 * 90; |
| 2115 | * |
| 2116 | * // Reverse device orientation for front-facing cameras |
| 2117 | * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT; |
| 2118 | * if (facingFront) deviceOrientation = -deviceOrientation; |
| 2119 | * |
| 2120 | * // Calculate desired JPEG orientation relative to camera orientation to make |
| 2121 | * // the image upright relative to the device orientation |
| 2122 | * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360; |
| 2123 | * |
| 2124 | * return jpegOrientation; |
| 2125 | * } |
| 2126 | * </code></pre> |
| 2127 | * <p><b>Units</b>: Degrees in multiples of 90</p> |
| 2128 | * <p><b>Range of valid values:</b><br> |
| 2129 | * 0, 90, 180, 270</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2130 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2131 | * |
| 2132 | * @see CameraCharacteristics#SENSOR_ORIENTATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2133 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2134 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2135 | public static final Key<Integer> JPEG_ORIENTATION = |
| 2136 | new Key<Integer>("android.jpeg.orientation", int.class); |
| 2137 | |
| 2138 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2139 | * <p>Compression quality of the final JPEG |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2140 | * image.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2141 | * <p>85-95 is typical usage range.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2142 | * <p><b>Range of valid values:</b><br> |
| 2143 | * 1-100; larger is higher quality</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2144 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2145 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2146 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2147 | public static final Key<Byte> JPEG_QUALITY = |
| 2148 | new Key<Byte>("android.jpeg.quality", byte.class); |
| 2149 | |
| 2150 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2151 | * <p>Compression quality of JPEG |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2152 | * thumbnail.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2153 | * <p><b>Range of valid values:</b><br> |
| 2154 | * 1-100; larger is higher quality</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2155 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2156 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2157 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2158 | public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = |
| 2159 | new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); |
| 2160 | |
| 2161 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2162 | * <p>Resolution of embedded JPEG thumbnail.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2163 | * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, |
| 2164 | * but the captured JPEG will still be a valid image.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2165 | * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected |
| 2166 | * should have the same aspect ratio as the main JPEG output.</p> |
Zhijun He | 50f7243 | 2014-05-28 13:52:04 -0700 | [diff] [blame] | 2167 | * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect |
| 2168 | * ratio, the camera device creates the thumbnail by cropping it from the primary image. |
| 2169 | * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has |
| 2170 | * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to |
| 2171 | * generate the thumbnail image. The thumbnail image will always have a smaller Field |
| 2172 | * 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] | 2173 | * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested, |
| 2174 | * the camera device will handle thumbnail rotation in one of the following ways:</p> |
| 2175 | * <ul> |
| 2176 | * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag} |
| 2177 | * and keep jpeg and thumbnail image data unrotated.</li> |
| 2178 | * <li>Rotate the jpeg and thumbnail image data and not set |
| 2179 | * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this |
| 2180 | * case, LIMITED or FULL hardware level devices will report rotated thumnail size in |
| 2181 | * capture result, so the width and height will be interchanged if 90 or 270 degree |
| 2182 | * orientation is requested. LEGACY device will always report unrotated thumbnail |
| 2183 | * size.</li> |
| 2184 | * </ul> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2185 | * <p><b>Range of valid values:</b><br> |
| 2186 | * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2187 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2188 | * |
| 2189 | * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES |
Yin-Chia Yeh | 5988311 | 2015-06-22 15:51:40 -0700 | [diff] [blame] | 2190 | * @see CaptureRequest#JPEG_ORIENTATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2191 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2192 | @PublicKey |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 2193 | public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = |
| 2194 | 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] | 2195 | |
| 2196 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2197 | * <p>The desired lens aperture size, as a ratio of lens focal length to the |
| 2198 | * effective aperture diameter.</p> |
| 2199 | * <p>Setting this value is only supported on the camera devices that have a variable |
| 2200 | * aperture lens.</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 2201 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, |
| 2202 | * 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] | 2203 | * {@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] | 2204 | * to achieve manual exposure control.</p> |
| 2205 | * <p>The requested aperture value may take several frames to reach the |
| 2206 | * requested value; the camera device will report the current (intermediate) |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2207 | * aperture size in capture result metadata while the aperture is changing. |
| 2208 | * 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] | 2209 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of |
| 2210 | * the ON modes, this will be overridden by the camera device |
| 2211 | * auto-exposure algorithm, the overridden values are then provided |
| 2212 | * back to the user in the corresponding result.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2213 | * <p><b>Units</b>: The f-number (f/N)</p> |
| 2214 | * <p><b>Range of valid values:</b><br> |
| 2215 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2216 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2217 | * <p><b>Full capability</b> - |
| 2218 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2219 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 2220 | * |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 2221 | * @see CaptureRequest#CONTROL_AE_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2222 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 2223 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2224 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 2225 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 2226 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 2227 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2228 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2229 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2230 | public static final Key<Float> LENS_APERTURE = |
| 2231 | new Key<Float>("android.lens.aperture", float.class); |
| 2232 | |
| 2233 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2234 | * <p>The desired setting for the lens neutral density filter(s).</p> |
| 2235 | * <p>This control will not be supported on most camera devices.</p> |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 2236 | * <p>Lens filters are typically used to lower the amount of light the |
| 2237 | * sensor is exposed to (measured in steps of EV). As used here, an EV |
| 2238 | * step is the standard logarithmic representation, which are |
| 2239 | * non-negative, and inversely proportional to the amount of light |
| 2240 | * hitting the sensor. For example, setting this to 0 would result |
| 2241 | * in no reduction of the incoming light, and setting this to 2 would |
| 2242 | * mean that the filter is set to reduce incoming light by two stops |
| 2243 | * (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] | 2244 | * <p>It may take several frames before the lens filter density changes |
| 2245 | * to the requested value. While the filter density is still changing, |
| 2246 | * {@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] | 2247 | * <p><b>Units</b>: Exposure Value (EV)</p> |
| 2248 | * <p><b>Range of valid values:</b><br> |
| 2249 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2250 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2251 | * <p><b>Full capability</b> - |
| 2252 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2253 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 2254 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2255 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 2256 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2257 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2258 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2259 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2260 | public static final Key<Float> LENS_FILTER_DENSITY = |
| 2261 | new Key<Float>("android.lens.filterDensity", float.class); |
| 2262 | |
| 2263 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2264 | * <p>The desired lens focal length; used for optical zoom.</p> |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2265 | * <p>This setting controls the physical focal length of the camera |
| 2266 | * device's lens. Changing the focal length changes the field of |
| 2267 | * view of the camera device, and is usually used for optical zoom.</p> |
| 2268 | * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this |
| 2269 | * setting won't be applied instantaneously, and it may take several |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2270 | * frames before the lens can change to the requested focal length. |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2271 | * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will |
| 2272 | * be set to MOVING.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2273 | * <p>Optical zoom will not be supported on most devices.</p> |
| 2274 | * <p><b>Units</b>: Millimeters</p> |
| 2275 | * <p><b>Range of valid values:</b><br> |
| 2276 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2277 | * <p>This key is available on all devices.</p> |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2278 | * |
| 2279 | * @see CaptureRequest#LENS_APERTURE |
| 2280 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2281 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2282 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2283 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2284 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2285 | public static final Key<Float> LENS_FOCAL_LENGTH = |
| 2286 | new Key<Float>("android.lens.focalLength", float.class); |
| 2287 | |
| 2288 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2289 | * <p>Desired distance to plane of sharpest focus, |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2290 | * measured from frontmost surface of the lens.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2291 | * <p>This control can be used for setting manual focus, on devices that support |
| 2292 | * the MANUAL_SENSOR capability and have a variable-focus lens (see |
| 2293 | * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}).</p> |
| 2294 | * <p>A value of <code>0.0f</code> means infinity focus. The value set will be clamped to |
| 2295 | * <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] | 2296 | * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied |
| 2297 | * instantaneously, and it may take several frames before the lens |
| 2298 | * can move to the requested focus distance. While the lens is still moving, |
| 2299 | * {@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] | 2300 | * <p>LEGACY devices support at most setting this to <code>0.0f</code> |
| 2301 | * for infinity focus.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2302 | * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p> |
| 2303 | * <p><b>Range of valid values:</b><br> |
| 2304 | * >= 0</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2305 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2306 | * <p><b>Full capability</b> - |
| 2307 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2308 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2309 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2310 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2311 | * @see CaptureRequest#LENS_FOCAL_LENGTH |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2312 | * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2313 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
| 2314 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2315 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2316 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2317 | public static final Key<Float> LENS_FOCUS_DISTANCE = |
| 2318 | new Key<Float>("android.lens.focusDistance", float.class); |
| 2319 | |
| 2320 | /** |
Ruben Brunk | 00849b3 | 2014-01-17 18:30:23 -0800 | [diff] [blame] | 2321 | * <p>Sets whether the camera device uses optical image stabilization (OIS) |
| 2322 | * when capturing images.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2323 | * <p>OIS is used to compensate for motion blur due to small |
| 2324 | * movements of the camera during capture. Unlike digital image |
| 2325 | * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS |
| 2326 | * makes use of mechanical elements to stabilize the camera |
| 2327 | * sensor, and thus allows for longer exposure times before |
| 2328 | * camera shake becomes apparent.</p> |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 2329 | * <p>Switching between different optical stabilization modes may take several |
| 2330 | * frames to initialize, the camera device will report the current mode in |
| 2331 | * capture result metadata. For example, When "ON" mode is requested, the |
| 2332 | * optical stabilization modes in the first several capture results may still |
| 2333 | * 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] | 2334 | * <p>If a camera device supports both OIS and digital image stabilization |
| 2335 | * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable |
| 2336 | * 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] | 2337 | * <p>Not all devices will support OIS; see |
| 2338 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for |
| 2339 | * available controls.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2340 | * <p><b>Possible values:</b> |
| 2341 | * <ul> |
| 2342 | * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li> |
| 2343 | * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li> |
| 2344 | * </ul></p> |
| 2345 | * <p><b>Available values for this device:</b><br> |
| 2346 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2347 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2348 | * <p><b>Limited capability</b> - |
| 2349 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2350 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2351 | * |
| 2352 | * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2353 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2354 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2355 | * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF |
| 2356 | * @see #LENS_OPTICAL_STABILIZATION_MODE_ON |
| 2357 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2358 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2359 | public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = |
| 2360 | new Key<Integer>("android.lens.opticalStabilizationMode", int.class); |
| 2361 | |
| 2362 | /** |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2363 | * <p>Mode of operation for the noise reduction algorithm.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2364 | * <p>The noise reduction algorithm attempts to improve image quality by removing |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2365 | * excessive noise added by the capture process, especially in dark conditions.</p> |
| 2366 | * <p>OFF means no noise reduction will be applied by the camera device, for both raw and |
| 2367 | * YUV domain.</p> |
| 2368 | * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove |
| 2369 | * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF. |
| 2370 | * This mode is optional, may not be support by all devices. The application should check |
| 2371 | * {@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] | 2372 | * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering |
| 2373 | * will be applied. HIGH_QUALITY mode indicates that the camera device |
| 2374 | * will use the highest-quality noise filtering algorithms, |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2375 | * 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] | 2376 | * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if |
| 2377 | * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate. |
| 2378 | * 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] | 2379 | * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular |
| 2380 | * buffer of high-resolution images during preview and reprocess image(s) from that buffer |
| 2381 | * into a final capture when triggered by the user. In this mode, the camera device applies |
| 2382 | * noise reduction to low-resolution streams (below maximum recording resolution) to maximize |
| 2383 | * preview quality, but does not apply noise reduction to high-resolution streams, since |
| 2384 | * those will be reprocessed later if necessary.</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2385 | * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device |
| 2386 | * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device |
| 2387 | * may adjust the noise reduction parameters for best image quality based on the |
| 2388 | * {@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] | 2389 | * <p><b>Possible values:</b> |
| 2390 | * <ul> |
| 2391 | * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li> |
| 2392 | * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li> |
| 2393 | * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2394 | * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2395 | * <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] | 2396 | * </ul></p> |
| 2397 | * <p><b>Available values for this device:</b><br> |
| 2398 | * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2399 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2400 | * <p><b>Full capability</b> - |
| 2401 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2402 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2403 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2404 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2405 | * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2406 | * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2407 | * @see #NOISE_REDUCTION_MODE_OFF |
| 2408 | * @see #NOISE_REDUCTION_MODE_FAST |
| 2409 | * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2410 | * @see #NOISE_REDUCTION_MODE_MINIMAL |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2411 | * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2412 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2413 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2414 | public static final Key<Integer> NOISE_REDUCTION_MODE = |
| 2415 | new Key<Integer>("android.noiseReduction.mode", int.class); |
| 2416 | |
| 2417 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2418 | * <p>An application-specified ID for the current |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2419 | * request. Must be maintained unchanged in output |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2420 | * frame</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2421 | * <p><b>Units</b>: arbitrary integer assigned by application</p> |
| 2422 | * <p><b>Range of valid values:</b><br> |
| 2423 | * Any int</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2424 | * <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] | 2425 | * @hide |
| 2426 | */ |
| 2427 | public static final Key<Integer> REQUEST_ID = |
| 2428 | new Key<Integer>("android.request.id", int.class); |
| 2429 | |
| 2430 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2431 | * <p>The desired region of the sensor to read out for this capture.</p> |
| 2432 | * <p>This control can be used to implement digital zoom.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2433 | * <p>The crop region coordinate system is based off |
| 2434 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the |
| 2435 | * top-left corner of the sensor active array.</p> |
| 2436 | * <p>Output streams use this rectangle to produce their output, |
| 2437 | * cropping to a smaller region if necessary to maintain the |
| 2438 | * stream's aspect ratio, then scaling the sensor input to |
| 2439 | * match the output's configured resolution.</p> |
| 2440 | * <p>The crop region is applied after the RAW to other color |
| 2441 | * space (e.g. YUV) conversion. Since raw streams |
| 2442 | * (e.g. RAW16) don't have the conversion stage, they are not |
| 2443 | * croppable. The crop region will be ignored by raw streams.</p> |
Zhijun He | 9e6d188 | 2014-05-22 16:47:35 -0700 | [diff] [blame] | 2444 | * <p>For non-raw streams, any additional per-stream cropping will |
| 2445 | * be done to maximize the final pixel area of the stream.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2446 | * <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] | 2447 | * ratio, then 4:3 streams will use the exact crop |
| 2448 | * region. 16:9 streams will further crop vertically |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2449 | * (letterbox).</p> |
| 2450 | * <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] | 2451 | * outputs will crop horizontally (pillarbox), and 16:9 |
| 2452 | * streams will match exactly. These additional crops will |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2453 | * be centered within the crop region.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2454 | * <p>The width and height of the crop region cannot |
| 2455 | * be set to be smaller than |
| 2456 | * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and |
| 2457 | * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p> |
| 2458 | * <p>The camera device may adjust the crop region to account |
| 2459 | * for rounding and other hardware requirements; the final |
| 2460 | * crop region used will be included in the output capture |
| 2461 | * result.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2462 | * <p><b>Units</b>: Pixel coordinates relative to |
| 2463 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2464 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 2465 | * |
| 2466 | * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2467 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2468 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2469 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2470 | public static final Key<android.graphics.Rect> SCALER_CROP_REGION = |
| 2471 | new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); |
| 2472 | |
| 2473 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2474 | * <p>Duration each pixel is exposed to |
| 2475 | * light.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2476 | * <p>If the sensor can't expose this exact duration, it will shorten the |
| 2477 | * duration exposed to the nearest possible value (rather than expose longer). |
| 2478 | * The final exposure time used will be available in the output capture result.</p> |
| 2479 | * <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 |
| 2480 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 2481 | * <p><b>Units</b>: Nanoseconds</p> |
| 2482 | * <p><b>Range of valid values:</b><br> |
| 2483 | * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2484 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2485 | * <p><b>Full capability</b> - |
| 2486 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2487 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2488 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2489 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2490 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2491 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2492 | * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2493 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2494 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2495 | public static final Key<Long> SENSOR_EXPOSURE_TIME = |
| 2496 | new Key<Long>("android.sensor.exposureTime", long.class); |
| 2497 | |
| 2498 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2499 | * <p>Duration from start of frame exposure to |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2500 | * start of next frame exposure.</p> |
| 2501 | * <p>The maximum frame rate that can be supported by a camera subsystem is |
| 2502 | * a function of many factors:</p> |
| 2503 | * <ul> |
| 2504 | * <li>Requested resolutions of output image streams</li> |
| 2505 | * <li>Availability of binning / skipping modes on the imager</li> |
| 2506 | * <li>The bandwidth of the imager interface</li> |
| 2507 | * <li>The bandwidth of the various ISP processing blocks</li> |
| 2508 | * </ul> |
| 2509 | * <p>Since these factors can vary greatly between different ISPs and |
| 2510 | * sensors, the camera abstraction tries to represent the bandwidth |
| 2511 | * restrictions with as simple a model as possible.</p> |
| 2512 | * <p>The model presented has the following characteristics:</p> |
| 2513 | * <ul> |
| 2514 | * <li>The image sensor is always configured to output the smallest |
| 2515 | * resolution possible given the application's requested output stream |
| 2516 | * sizes. The smallest resolution is defined as being at least as large |
| 2517 | * as the largest requested output stream size; the camera pipeline must |
| 2518 | * never digitally upsample sensor data when the crop region covers the |
| 2519 | * whole sensor. In general, this means that if only small output stream |
| 2520 | * resolutions are configured, the sensor can provide a higher frame |
| 2521 | * rate.</li> |
| 2522 | * <li>Since any request may use any or all the currently configured |
| 2523 | * output streams, the sensor and ISP must be configured to support |
| 2524 | * scaling a single capture to all the streams at the same time. This |
| 2525 | * means the camera pipeline must be ready to produce the largest |
| 2526 | * requested output size without any delay. Therefore, the overall |
| 2527 | * frame rate of a given configured stream set is governed only by the |
| 2528 | * largest requested stream resolution.</li> |
| 2529 | * <li>Using more than one output stream in a request does not affect the |
| 2530 | * frame duration.</li> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2531 | * <li>Certain format-streams may need to do additional background processing |
| 2532 | * before data is consumed/produced by that stream. These processors |
| 2533 | * can run concurrently to the rest of the camera pipeline, but |
| 2534 | * cannot process more than 1 capture at a time.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2535 | * </ul> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2536 | * <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] | 2537 | * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }. |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2538 | * These are used to determine the maximum frame rate / minimum frame duration that is |
| 2539 | * possible for a given stream configuration.</p> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2540 | * <p>Specifically, the application can use the following rules to |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 2541 | * determine the minimum frame duration it can request from the camera |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2542 | * device:</p> |
| 2543 | * <ol> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2544 | * <li>Let the set of currently configured input/output streams be called <code>S</code>.</li> |
| 2545 | * <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 } |
| 2546 | * (with its respective size/format). Let this set of frame durations be called <code>F</code>.</li> |
| 2547 | * <li>For any given request <code>R</code>, the minimum frame duration allowed for <code>R</code> is the maximum |
| 2548 | * 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] | 2549 | * </ol> |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 2550 | * <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] | 2551 | * using its respective size/format), then the frame duration in <code>F</code> determines the steady |
| 2552 | * state frame rate that the application will get if it uses <code>R</code> as a repeating request. Let |
| 2553 | * this special kind of request be called <code>Rsimple</code>.</p> |
| 2554 | * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved by a single capture of a |
| 2555 | * new request <code>Rstall</code> (which has at least one in-use stream with a non-0 stall time) and if |
| 2556 | * <code>Rstall</code> has the same minimum frame duration this will not cause a frame rate loss if all |
| 2557 | * buffers from the previous <code>Rstall</code> have already been delivered.</p> |
| 2558 | * <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] | 2559 | * <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 |
| 2560 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 2561 | * <p><b>Units</b>: Nanoseconds</p> |
| 2562 | * <p><b>Range of valid values:</b><br> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2563 | * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, {@link android.hardware.camera2.params.StreamConfigurationMap }. |
| 2564 | * The duration is capped to <code>max(duration, exposureTime + overhead)</code>.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2565 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2566 | * <p><b>Full capability</b> - |
| 2567 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2568 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 2569 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2570 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2571 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2572 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2573 | * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2574 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2575 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2576 | public static final Key<Long> SENSOR_FRAME_DURATION = |
| 2577 | new Key<Long>("android.sensor.frameDuration", long.class); |
| 2578 | |
| 2579 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2580 | * <p>The amount of gain applied to sensor data |
| 2581 | * before processing.</p> |
| 2582 | * <p>The sensitivity is the standard ISO sensitivity value, |
| 2583 | * as defined in ISO 12232:2006.</p> |
| 2584 | * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and |
| 2585 | * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device |
| 2586 | * is guaranteed to use only analog amplification for applying the gain.</p> |
| 2587 | * <p>If the camera device cannot apply the exact sensitivity |
| 2588 | * requested, it will reduce the gain to the nearest supported |
| 2589 | * value. The final sensitivity used will be available in the |
| 2590 | * output capture result.</p> |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 2591 | * <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 |
| 2592 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2593 | * <p><b>Units</b>: ISO arithmetic units</p> |
| 2594 | * <p><b>Range of valid values:</b><br> |
| 2595 | * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2596 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2597 | * <p><b>Full capability</b> - |
| 2598 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2599 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2600 | * |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 2601 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2602 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2603 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2604 | * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE |
| 2605 | * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2606 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2607 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2608 | public static final Key<Integer> SENSOR_SENSITIVITY = |
| 2609 | new Key<Integer>("android.sensor.sensitivity", int.class); |
| 2610 | |
| 2611 | /** |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2612 | * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern |
| 2613 | * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p> |
| 2614 | * <p>Each color channel is treated as an unsigned 32-bit integer. |
| 2615 | * The camera device then uses the most significant X bits |
| 2616 | * that correspond to how many bits are in its Bayer raw sensor |
| 2617 | * output.</p> |
| 2618 | * <p>For example, a sensor with RAW10 Bayer output would use the |
| 2619 | * 10 most significant bits from each color channel.</p> |
| 2620 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2621 | * |
| 2622 | * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE |
| 2623 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2624 | @PublicKey |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2625 | public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = |
| 2626 | new Key<int[]>("android.sensor.testPatternData", int[].class); |
| 2627 | |
| 2628 | /** |
| 2629 | * <p>When enabled, the sensor sends a test pattern instead of |
| 2630 | * doing a real exposure from the camera.</p> |
| 2631 | * <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] | 2632 | * by android.sensor.* will be ignored. All other controls should |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2633 | * work as normal.</p> |
| 2634 | * <p>For example, if manual flash is enabled, flash firing should still |
| 2635 | * occur (and that the test pattern remain unmodified, since the flash |
| 2636 | * would not actually affect it).</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2637 | * <p>Defaults to OFF.</p> |
| 2638 | * <p><b>Possible values:</b> |
| 2639 | * <ul> |
| 2640 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li> |
| 2641 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li> |
| 2642 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li> |
| 2643 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li> |
| 2644 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li> |
| 2645 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li> |
| 2646 | * </ul></p> |
| 2647 | * <p><b>Available values for this device:</b><br> |
| 2648 | * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p> |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2649 | * <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] | 2650 | * |
| 2651 | * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2652 | * @see #SENSOR_TEST_PATTERN_MODE_OFF |
| 2653 | * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR |
| 2654 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS |
| 2655 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY |
| 2656 | * @see #SENSOR_TEST_PATTERN_MODE_PN9 |
| 2657 | * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 |
| 2658 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2659 | @PublicKey |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2660 | public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = |
| 2661 | new Key<Integer>("android.sensor.testPatternMode", int.class); |
| 2662 | |
| 2663 | /** |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2664 | * <p>Quality of lens shading correction applied |
| 2665 | * to the image data.</p> |
| 2666 | * <p>When set to OFF mode, no lens shading correction will be applied by the |
| 2667 | * camera device, and an identity lens shading map data will be provided |
| 2668 | * 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] | 2669 | * shading map with size of <code>[ 4, 3 ]</code>, |
| 2670 | * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity |
| 2671 | * map shown below:</p> |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2672 | * <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] | 2673 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2674 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2675 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 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 ] |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2678 | * </code></pre> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2679 | * <p>When set to other modes, lens shading correction will be applied by the camera |
| 2680 | * device. Applications can request lens shading map data by setting |
| 2681 | * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens |
| 2682 | * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map |
| 2683 | * data will be the one applied by the camera device for this capture request.</p> |
| 2684 | * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore |
| 2685 | * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and |
| 2686 | * 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> |
| 2687 | * OFF), to get best results, it is recommended that the applications wait for the AE and AWB |
| 2688 | * to be converged before using the returned shading map data.</p> |
| 2689 | * <p><b>Possible values:</b> |
| 2690 | * <ul> |
| 2691 | * <li>{@link #SHADING_MODE_OFF OFF}</li> |
| 2692 | * <li>{@link #SHADING_MODE_FAST FAST}</li> |
| 2693 | * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 2694 | * </ul></p> |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 2695 | * <p><b>Available values for this device:</b><br> |
| 2696 | * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2697 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2698 | * <p><b>Full capability</b> - |
| 2699 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2700 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2701 | * |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 2702 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2703 | * @see CaptureRequest#CONTROL_AWB_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2704 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 2705 | * @see CameraCharacteristics#SHADING_AVAILABLE_MODES |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2706 | * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2707 | * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE |
| 2708 | * @see #SHADING_MODE_OFF |
| 2709 | * @see #SHADING_MODE_FAST |
| 2710 | * @see #SHADING_MODE_HIGH_QUALITY |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2711 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2712 | @PublicKey |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2713 | public static final Key<Integer> SHADING_MODE = |
| 2714 | new Key<Integer>("android.shading.mode", int.class); |
| 2715 | |
| 2716 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2717 | * <p>Operating mode for the face detector |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2718 | * unit.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2719 | * <p>Whether face detection is enabled, and whether it |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2720 | * should output just the basic fields or the full set of |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2721 | * fields.</p> |
| 2722 | * <p><b>Possible values:</b> |
| 2723 | * <ul> |
| 2724 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li> |
| 2725 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li> |
| 2726 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li> |
| 2727 | * </ul></p> |
| 2728 | * <p><b>Available values for this device:</b><br> |
| 2729 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p> |
| 2730 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2731 | * |
| 2732 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2733 | * @see #STATISTICS_FACE_DETECT_MODE_OFF |
| 2734 | * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE |
| 2735 | * @see #STATISTICS_FACE_DETECT_MODE_FULL |
| 2736 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2737 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2738 | public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = |
| 2739 | new Key<Integer>("android.statistics.faceDetectMode", int.class); |
| 2740 | |
| 2741 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2742 | * <p>Operating mode for hot pixel map generation.</p> |
| 2743 | * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}. |
| 2744 | * If set to <code>false</code>, no hot pixel map will be returned.</p> |
| 2745 | * <p><b>Range of valid values:</b><br> |
| 2746 | * {@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] | 2747 | * <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] | 2748 | * |
| 2749 | * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP |
| 2750 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES |
| 2751 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2752 | @PublicKey |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 2753 | public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = |
| 2754 | new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); |
| 2755 | |
| 2756 | /** |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 2757 | * <p>Whether the camera device will output the lens |
| 2758 | * shading map in output result metadata.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2759 | * <p>When set to ON, |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2760 | * android.statistics.lensShadingMap will be provided in |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 2761 | * the output result metadata.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2762 | * <p>ON is always supported on devices with the RAW capability.</p> |
| 2763 | * <p><b>Possible values:</b> |
| 2764 | * <ul> |
| 2765 | * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li> |
| 2766 | * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li> |
| 2767 | * </ul></p> |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 2768 | * <p><b>Available values for this device:</b><br> |
| 2769 | * {@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] | 2770 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2771 | * <p><b>Full capability</b> - |
| 2772 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2773 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2774 | * |
| 2775 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 2776 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES |
Eino-Ville Talvala | d96748b | 2013-09-12 11:11:27 -0700 | [diff] [blame] | 2777 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF |
| 2778 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON |
| 2779 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2780 | @PublicKey |
Eino-Ville Talvala | d96748b | 2013-09-12 11:11:27 -0700 | [diff] [blame] | 2781 | public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = |
| 2782 | new Key<Integer>("android.statistics.lensShadingMapMode", int.class); |
| 2783 | |
| 2784 | /** |
Eino-Ville Talvala | 601e0f6 | 2018-02-05 16:25:40 -0800 | [diff] [blame] | 2785 | * <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] | 2786 | * result metadata.</p> |
| 2787 | * <p>When set to ON, |
| 2788 | * {@link CaptureResult#STATISTICS_OIS_TIMESTAMPS android.statistics.oisTimestamps}, android.statistics.oisShiftPixelX, |
Eino-Ville Talvala | 601e0f6 | 2018-02-05 16:25:40 -0800 | [diff] [blame] | 2789 | * and android.statistics.oisShiftPixelY provide OIS data in the output 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> |
| 2796 | * android.Statistics.info.availableOisDataModes</p> |
| 2797 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2798 | * |
| 2799 | * @see CaptureResult#STATISTICS_OIS_TIMESTAMPS |
| 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> |
| 2858 | * <p>A few examples, and their corresponding graphical mappings; these |
| 2859 | * only specify the red channel and the precision is limited to 4 |
| 2860 | * digits, for conciseness.</p> |
| 2861 | * <p>Linear mapping:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2862 | * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2863 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2864 | * <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] | 2865 | * <p>Invert mapping:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2866 | * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2867 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2868 | * <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] | 2869 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2870 | * <pre><code>android.tonemap.curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2871 | * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, |
| 2872 | * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, |
| 2873 | * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, |
| 2874 | * 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] | 2875 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2876 | * <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] | 2877 | * <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] | 2878 | * <pre><code>android.tonemap.curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2879 | * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, |
| 2880 | * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, |
| 2881 | * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, |
| 2882 | * 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] | 2883 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2884 | * <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] | 2885 | * <p><b>Range of valid values:</b><br> |
| 2886 | * 0-1 on both input and output coordinates, normalized |
| 2887 | * 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] | 2888 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2889 | * <p><b>Full capability</b> - |
| 2890 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2891 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2892 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2893 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2894 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2895 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2896 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2897 | */ |
| 2898 | public static final Key<float[]> TONEMAP_CURVE_RED = |
| 2899 | new Key<float[]>("android.tonemap.curveRed", float[].class); |
| 2900 | |
| 2901 | /** |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2902 | * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} |
| 2903 | * is CONTRAST_CURVE.</p> |
| 2904 | * <p>The tonemapCurve consist of three curves for each of red, green, and blue |
| 2905 | * channels respectively. The following example uses the red channel as an |
| 2906 | * example. The same logic applies to green and blue channel. |
| 2907 | * Each channel's curve is defined by an array of control points:</p> |
| 2908 | * <pre><code>curveRed = |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2909 | * [ 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] | 2910 | * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> |
| 2911 | * <p>These are sorted in order of increasing <code>Pin</code>; it is always |
| 2912 | * guaranteed that input values 0.0 and 1.0 are included in the list to |
| 2913 | * define a complete mapping. For input values between control points, |
| 2914 | * the camera device must linearly interpolate between the control |
| 2915 | * points.</p> |
| 2916 | * <p>Each curve can have an independent number of points, and the number |
| 2917 | * of points can be less than max (that is, the request doesn't have to |
| 2918 | * always provide a curve with number of points equivalent to |
| 2919 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
| 2920 | * <p>A few examples, and their corresponding graphical mappings; these |
| 2921 | * only specify the red channel and the precision is limited to 4 |
| 2922 | * digits, for conciseness.</p> |
| 2923 | * <p>Linear mapping:</p> |
| 2924 | * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ] |
| 2925 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2926 | * <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] | 2927 | * <p>Invert mapping:</p> |
| 2928 | * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ] |
| 2929 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2930 | * <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] | 2931 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
| 2932 | * <pre><code>curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2933 | * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812), |
| 2934 | * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072), |
| 2935 | * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685), |
| 2936 | * (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] | 2937 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2938 | * <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] | 2939 | * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> |
| 2940 | * <pre><code>curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2941 | * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845), |
| 2942 | * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130), |
| 2943 | * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721), |
| 2944 | * (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] | 2945 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2946 | * <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] | 2947 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2948 | * <p><b>Full capability</b> - |
| 2949 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2950 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2951 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2952 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2953 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
| 2954 | * @see CaptureRequest#TONEMAP_MODE |
| 2955 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2956 | @PublicKey |
| 2957 | @SyntheticKey |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2958 | public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE = |
| 2959 | new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class); |
| 2960 | |
| 2961 | /** |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2962 | * <p>High-level global contrast/gamma/tonemapping control.</p> |
| 2963 | * <p>When switching to an application-defined contrast curve by setting |
| 2964 | * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined |
| 2965 | * per-channel with a set of <code>(in, out)</code> points that specify the |
| 2966 | * mapping from input high-bit-depth pixel value to the output |
| 2967 | * low-bit-depth value. Since the actual pixel ranges of both input |
| 2968 | * and output may change depending on the camera pipeline, the values |
| 2969 | * are specified by normalized floating-point numbers.</p> |
| 2970 | * <p>More-complex color mapping operations such as 3D color look-up |
| 2971 | * tables, selective chroma enhancement, or other non-linear color |
| 2972 | * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2973 | * CONTRAST_CURVE.</p> |
| 2974 | * <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] | 2975 | * 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] | 2976 | * These values are always available, and as close as possible to the |
| 2977 | * actually used nonlinear/nonglobal transforms.</p> |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 2978 | * <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] | 2979 | * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be |
| 2980 | * roughly the same.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2981 | * <p><b>Possible values:</b> |
| 2982 | * <ul> |
| 2983 | * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li> |
| 2984 | * <li>{@link #TONEMAP_MODE_FAST FAST}</li> |
| 2985 | * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 2986 | * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li> |
| 2987 | * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2988 | * </ul></p> |
| 2989 | * <p><b>Available values for this device:</b><br> |
| 2990 | * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2991 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2992 | * <p><b>Full capability</b> - |
| 2993 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2994 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 2995 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2996 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2997 | * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2998 | * @see CaptureRequest#TONEMAP_CURVE |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2999 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3000 | * @see #TONEMAP_MODE_CONTRAST_CURVE |
| 3001 | * @see #TONEMAP_MODE_FAST |
| 3002 | * @see #TONEMAP_MODE_HIGH_QUALITY |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 3003 | * @see #TONEMAP_MODE_GAMMA_VALUE |
| 3004 | * @see #TONEMAP_MODE_PRESET_CURVE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3005 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3006 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3007 | public static final Key<Integer> TONEMAP_MODE = |
| 3008 | new Key<Integer>("android.tonemap.mode", int.class); |
| 3009 | |
| 3010 | /** |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 3011 | * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 3012 | * GAMMA_VALUE</p> |
| 3013 | * <p>The tonemap curve will be defined the following formula: |
| 3014 | * * OUT = pow(IN, 1.0 / gamma) |
| 3015 | * where IN and OUT is the input pixel value scaled to range [0.0, 1.0], |
| 3016 | * pow is the power function and gamma is the gamma value specified by this |
| 3017 | * key.</p> |
| 3018 | * <p>The same curve will be applied to all color channels. The camera device |
| 3019 | * may clip the input gamma value to its supported range. The actual applied |
| 3020 | * value will be returned in capture result.</p> |
| 3021 | * <p>The valid range of gamma value varies on different devices, but values |
| 3022 | * within [1.0, 5.0] are guaranteed not to be clipped.</p> |
| 3023 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3024 | * |
| 3025 | * @see CaptureRequest#TONEMAP_MODE |
| 3026 | */ |
| 3027 | @PublicKey |
| 3028 | public static final Key<Float> TONEMAP_GAMMA = |
| 3029 | new Key<Float>("android.tonemap.gamma", float.class); |
| 3030 | |
| 3031 | /** |
| 3032 | * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 3033 | * PRESET_CURVE</p> |
| 3034 | * <p>The tonemap curve will be defined by specified standard.</p> |
| 3035 | * <p>sRGB (approximated by 16 control points):</p> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3036 | * <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] | 3037 | * <p>Rec. 709 (approximated by 16 control points):</p> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3038 | * <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] | 3039 | * <p>Note that above figures show a 16 control points approximation of preset |
| 3040 | * curves. Camera devices may apply a different approximation to the curve.</p> |
| 3041 | * <p><b>Possible values:</b> |
| 3042 | * <ul> |
| 3043 | * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li> |
| 3044 | * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li> |
| 3045 | * </ul></p> |
| 3046 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3047 | * |
| 3048 | * @see CaptureRequest#TONEMAP_MODE |
| 3049 | * @see #TONEMAP_PRESET_CURVE_SRGB |
| 3050 | * @see #TONEMAP_PRESET_CURVE_REC709 |
| 3051 | */ |
| 3052 | @PublicKey |
| 3053 | public static final Key<Integer> TONEMAP_PRESET_CURVE = |
| 3054 | new Key<Integer>("android.tonemap.presetCurve", int.class); |
| 3055 | |
| 3056 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3057 | * <p>This LED is nominally used to indicate to the user |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3058 | * that the camera is powered on and may be streaming images back to the |
| 3059 | * Application Processor. In certain rare circumstances, the OS may |
| 3060 | * disable this when video is processed locally and not transmitted to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3061 | * any untrusted applications.</p> |
| 3062 | * <p>In particular, the LED <em>must</em> always be on when the data could be |
| 3063 | * transmitted off the device. The LED <em>should</em> always be on whenever |
| 3064 | * data is stored locally on the device.</p> |
| 3065 | * <p>The LED <em>may</em> be off if a trusted application is using the data that |
| 3066 | * doesn't violate the above rules.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3067 | * <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] | 3068 | * @hide |
| 3069 | */ |
| 3070 | public static final Key<Boolean> LED_TRANSMIT = |
| 3071 | new Key<Boolean>("android.led.transmit", boolean.class); |
| 3072 | |
| 3073 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3074 | * <p>Whether black-level compensation is locked |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 3075 | * to its current values, or is free to vary.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3076 | * <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] | 3077 | * compensation will not change until the lock is set to |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3078 | * <code>false</code> (OFF).</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3079 | * <p>Since changes to certain capture parameters (such as |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3080 | * exposure time) may require resetting of black level |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 3081 | * compensation, the camera device must report whether setting |
| 3082 | * the black level lock was successful in the output result |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3083 | * metadata.</p> |
| 3084 | * <p>For example, if a sequence of requests is as follows:</p> |
| 3085 | * <ul> |
| 3086 | * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li> |
| 3087 | * <li>Request 2: Exposure = 10ms, Black level lock = ON</li> |
| 3088 | * <li>Request 3: Exposure = 10ms, Black level lock = ON</li> |
| 3089 | * <li>Request 4: Exposure = 20ms, Black level lock = ON</li> |
| 3090 | * <li>Request 5: Exposure = 20ms, Black level lock = ON</li> |
| 3091 | * <li>Request 6: Exposure = 20ms, Black level lock = ON</li> |
| 3092 | * </ul> |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 3093 | * <p>And the exposure change in Request 4 requires the camera |
| 3094 | * device to reset the black level offsets, then the output |
| 3095 | * result metadata is expected to be:</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3096 | * <ul> |
| 3097 | * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li> |
| 3098 | * <li>Result 2: Exposure = 10ms, Black level lock = ON</li> |
| 3099 | * <li>Result 3: Exposure = 10ms, Black level lock = ON</li> |
| 3100 | * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li> |
| 3101 | * <li>Result 5: Exposure = 20ms, Black level lock = ON</li> |
| 3102 | * <li>Result 6: Exposure = 20ms, Black level lock = ON</li> |
| 3103 | * </ul> |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 3104 | * <p>This indicates to the application that on frame 4, black |
| 3105 | * levels were reset due to exposure value changes, and pixel |
| 3106 | * values may not be consistent across captures.</p> |
| 3107 | * <p>The camera device will maintain the lock to the extent |
| 3108 | * possible, only overriding the lock to OFF when changes to |
| 3109 | * other request parameters require a black level recalculation |
| 3110 | * or reset.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3111 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3112 | * <p><b>Full capability</b> - |
| 3113 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3114 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 3115 | * |
| 3116 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3117 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3118 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3119 | public static final Key<Boolean> BLACK_LEVEL_LOCK = |
| 3120 | new Key<Boolean>("android.blackLevel.lock", boolean.class); |
| 3121 | |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 3122 | /** |
| 3123 | * <p>The amount of exposure time increase factor applied to the original output |
| 3124 | * frame by the application processing before sending for reprocessing.</p> |
| 3125 | * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING |
| 3126 | * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p> |
| 3127 | * <p>For some YUV reprocessing use cases, the application may choose to filter the original |
| 3128 | * output frames to effectively reduce the noise to the same level as a frame that was |
| 3129 | * captured with longer exposure time. To be more specific, assuming the original captured |
| 3130 | * images were captured with a sensitivity of S and an exposure time of T, the model in |
| 3131 | * the camera device is that the amount of noise in the image would be approximately what |
| 3132 | * would be expected if the original capture parameters had been a sensitivity of |
| 3133 | * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather |
| 3134 | * than S and T respectively. If the captured images were processed by the application |
| 3135 | * before being sent for reprocessing, then the application may have used image processing |
| 3136 | * algorithms and/or multi-frame image fusion to reduce the noise in the |
| 3137 | * application-processed images (input images). By using the effectiveExposureFactor |
| 3138 | * control, the application can communicate to the camera device the actual noise level |
| 3139 | * improvement in the application-processed image. With this information, the camera |
| 3140 | * device can select appropriate noise reduction and edge enhancement parameters to avoid |
| 3141 | * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge |
| 3142 | * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p> |
| 3143 | * <p>For example, for multi-frame image fusion use case, the application may fuse |
| 3144 | * multiple output frames together to a final frame for reprocessing. When N image are |
| 3145 | * fused into 1 image for reprocessing, the exposure time increase factor could be up to |
| 3146 | * square root of N (based on a simple photon shot noise model). The camera device will |
| 3147 | * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to |
| 3148 | * produce the best quality images.</p> |
| 3149 | * <p>This is relative factor, 1.0 indicates the application hasn't processed the input |
| 3150 | * buffer in a way that affects its effective exposure time.</p> |
| 3151 | * <p>This control is only effective for YUV reprocessing capture request. For noise |
| 3152 | * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>. |
| 3153 | * Similarly, for edge enhancement reprocessing, it is only effective when |
| 3154 | * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p> |
| 3155 | * <p><b>Units</b>: Relative exposure time increase factor.</p> |
| 3156 | * <p><b>Range of valid values:</b><br> |
| 3157 | * >= 1.0</p> |
| 3158 | * <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] | 3159 | * <p><b>Limited capability</b> - |
| 3160 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 3161 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 3162 | * |
| 3163 | * @see CaptureRequest#EDGE_MODE |
Zhijun He | 513f7c3 | 2015-04-24 18:23:54 -0700 | [diff] [blame] | 3164 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 3165 | * @see CaptureRequest#NOISE_REDUCTION_MODE |
| 3166 | * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES |
| 3167 | */ |
| 3168 | @PublicKey |
| 3169 | public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR = |
| 3170 | new Key<Float>("android.reprocess.effectiveExposureFactor", float.class); |
| 3171 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3172 | /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 3173 | * End generated code |
| 3174 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3175 | |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3176 | |
| 3177 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3178 | } |