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