| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 1 | /* | 
 | 2 |  * Copyright (C) 2015 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 |  | 
 | 17 | //#define LOG_NDEBUG 0 | 
 | 18 | #define LOG_TAG "ACameraMetadata" | 
 | 19 |  | 
 | 20 | #include "ACameraMetadata.h" | 
 | 21 | #include <utils/Vector.h> | 
| Yin-Chia Yeh | c360382 | 2016-01-18 22:11:19 -0800 | [diff] [blame] | 22 | #include <system/graphics.h> | 
| Colin Cross | 7e8d4ba | 2017-05-04 16:17:42 -0700 | [diff] [blame] | 23 | #include <media/NdkImage.h> | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 24 |  | 
 | 25 | using namespace android; | 
 | 26 |  | 
 | 27 | /** | 
 | 28 |  * ACameraMetadata Implementation | 
 | 29 |  */ | 
 | 30 | ACameraMetadata::ACameraMetadata(camera_metadata_t* buffer, ACAMERA_METADATA_TYPE type) : | 
 | 31 |         mData(buffer), mType(type) { | 
| Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 32 |     if (mType == ACM_CHARACTERISTICS) { | 
 | 33 |         filterUnsupportedFeatures(); | 
| Yin-Chia Yeh | c360382 | 2016-01-18 22:11:19 -0800 | [diff] [blame] | 34 |         filterStreamConfigurations(); | 
| Yin-Chia Yeh | e57e9a2 | 2018-08-23 15:36:41 -0700 | [diff] [blame] | 35 |         filterDurations(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS); | 
 | 36 |         filterDurations(ANDROID_SCALER_AVAILABLE_STALL_DURATIONS); | 
 | 37 |         filterDurations(ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS); | 
 | 38 |         filterDurations(ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS); | 
| Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 39 |     } | 
 | 40 |     // TODO: filter request/result keys | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 41 | } | 
 | 42 |  | 
 | 43 | bool | 
 | 44 | ACameraMetadata::isNdkSupportedCapability(int32_t capability) { | 
 | 45 |     switch (capability) { | 
 | 46 |         case ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE: | 
 | 47 |         case ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR: | 
 | 48 |         case ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING: | 
 | 49 |         case ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW: | 
 | 50 |         case ANDROID_REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS: | 
 | 51 |         case ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE: | 
 | 52 |         case ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT: | 
 | 53 |             return true; | 
 | 54 |         case ANDROID_REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING: | 
 | 55 |         case ANDROID_REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING: | 
 | 56 |         case ANDROID_REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO: | 
 | 57 |             return false; | 
 | 58 |         default: | 
 | 59 |             // Newly defined capabilities will be unsupported by default (blacklist) | 
 | 60 |             // TODO: Should we do whitelist or blacklist here? | 
 | 61 |             ALOGE("%s: Unknonwn capability %d", __FUNCTION__, capability); | 
 | 62 |             return false; | 
 | 63 |     } | 
 | 64 | } | 
 | 65 |  | 
 | 66 | void | 
 | 67 | ACameraMetadata::filterUnsupportedFeatures() { | 
 | 68 |     // Hide unsupported capabilities (reprocessing) | 
 | 69 |     camera_metadata_entry entry = mData.find(ANDROID_REQUEST_AVAILABLE_CAPABILITIES); | 
| Yin-Chia Yeh | c360382 | 2016-01-18 22:11:19 -0800 | [diff] [blame] | 70 |     if (entry.count == 0 || entry.type != TYPE_BYTE) { | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 71 |         ALOGE("%s: malformed available capability key! count %zu, type %d", | 
 | 72 |                 __FUNCTION__, entry.count, entry.type); | 
 | 73 |         return; | 
 | 74 |     } | 
 | 75 |  | 
 | 76 |     Vector<uint8_t> capabilities; | 
 | 77 |     capabilities.setCapacity(entry.count); | 
 | 78 |     for (size_t i = 0; i < entry.count; i++) { | 
 | 79 |         uint8_t capability = entry.data.u8[i]; | 
 | 80 |         if (isNdkSupportedCapability(capability)) { | 
 | 81 |             capabilities.push(capability); | 
 | 82 |         } | 
 | 83 |     } | 
 | 84 |     mData.update(ANDROID_REQUEST_AVAILABLE_CAPABILITIES, capabilities); | 
| Yin-Chia Yeh | c360382 | 2016-01-18 22:11:19 -0800 | [diff] [blame] | 85 | } | 
 | 86 |  | 
 | 87 |  | 
 | 88 | void | 
| Yin-Chia Yeh | e57e9a2 | 2018-08-23 15:36:41 -0700 | [diff] [blame] | 89 | ACameraMetadata::filterDurations(uint32_t tag) { | 
 | 90 |     const int STREAM_CONFIGURATION_SIZE = 4; | 
 | 91 |     const int STREAM_FORMAT_OFFSET = 0; | 
 | 92 |     const int STREAM_WIDTH_OFFSET = 1; | 
 | 93 |     const int STREAM_HEIGHT_OFFSET = 2; | 
 | 94 |     const int STREAM_DURATION_OFFSET = 3; | 
 | 95 |     camera_metadata_entry entry = mData.find(tag); | 
 | 96 |     if (entry.count == 0 || entry.count % 4 || entry.type != TYPE_INT64) { | 
 | 97 |         ALOGE("%s: malformed duration key %d! count %zu, type %d", | 
 | 98 |                 __FUNCTION__, tag, entry.count, entry.type); | 
 | 99 |         return; | 
 | 100 |     } | 
 | 101 |     Vector<int64_t> filteredDurations; | 
 | 102 |     filteredDurations.setCapacity(entry.count * 2); | 
 | 103 |  | 
 | 104 |     for (size_t i=0; i < entry.count; i += STREAM_CONFIGURATION_SIZE) { | 
 | 105 |         int64_t format = entry.data.i64[i + STREAM_FORMAT_OFFSET]; | 
 | 106 |         int64_t width = entry.data.i64[i + STREAM_WIDTH_OFFSET]; | 
 | 107 |         int64_t height = entry.data.i64[i + STREAM_HEIGHT_OFFSET]; | 
 | 108 |         int64_t duration = entry.data.i32[i + STREAM_DURATION_OFFSET]; | 
 | 109 |  | 
 | 110 |         // Leave the unfiltered format in so apps depending on previous wrong | 
 | 111 |         // filter behavior continue to work | 
 | 112 |         filteredDurations.push_back(format); | 
 | 113 |         filteredDurations.push_back(width); | 
 | 114 |         filteredDurations.push_back(height); | 
 | 115 |         filteredDurations.push_back(duration); | 
 | 116 |  | 
 | 117 |         // Translate HAL formats to NDK format | 
 | 118 |         switch (tag) { | 
 | 119 |             case ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS: | 
 | 120 |             case ANDROID_SCALER_AVAILABLE_STALL_DURATIONS: | 
 | 121 |                 if (format == HAL_PIXEL_FORMAT_BLOB) { | 
 | 122 |                     format = AIMAGE_FORMAT_JPEG; | 
 | 123 |                     filteredDurations.push_back(format); | 
 | 124 |                     filteredDurations.push_back(width); | 
 | 125 |                     filteredDurations.push_back(height); | 
 | 126 |                     filteredDurations.push_back(duration); | 
 | 127 |                 } | 
 | 128 |                 break; | 
 | 129 |             case ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS: | 
 | 130 |             case ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS: | 
 | 131 |                 if (format == HAL_PIXEL_FORMAT_BLOB) { | 
 | 132 |                     format = AIMAGE_FORMAT_DEPTH_POINT_CLOUD; | 
 | 133 |                     filteredDurations.push_back(format); | 
 | 134 |                     filteredDurations.push_back(width); | 
 | 135 |                     filteredDurations.push_back(height); | 
 | 136 |                     filteredDurations.push_back(duration); | 
 | 137 |                 } else if (format == HAL_PIXEL_FORMAT_Y16) { | 
 | 138 |                     format = AIMAGE_FORMAT_DEPTH16; | 
 | 139 |                     filteredDurations.push_back(format); | 
 | 140 |                     filteredDurations.push_back(width); | 
 | 141 |                     filteredDurations.push_back(height); | 
 | 142 |                     filteredDurations.push_back(duration); | 
 | 143 |                 } | 
 | 144 |                 break; | 
 | 145 |             default: | 
 | 146 |                 // Should not reach here | 
 | 147 |                 ALOGE("%s: Unkown tag 0x%x", __FUNCTION__, tag); | 
 | 148 |         } | 
 | 149 |     } | 
 | 150 |  | 
 | 151 |     mData.update(tag, filteredDurations); | 
 | 152 | } | 
 | 153 |  | 
 | 154 | void | 
| Yin-Chia Yeh | c360382 | 2016-01-18 22:11:19 -0800 | [diff] [blame] | 155 | ACameraMetadata::filterStreamConfigurations() { | 
 | 156 |     const int STREAM_CONFIGURATION_SIZE = 4; | 
 | 157 |     const int STREAM_FORMAT_OFFSET = 0; | 
 | 158 |     const int STREAM_WIDTH_OFFSET = 1; | 
 | 159 |     const int STREAM_HEIGHT_OFFSET = 2; | 
 | 160 |     const int STREAM_IS_INPUT_OFFSET = 3; | 
 | 161 |     camera_metadata_entry entry = mData.find(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS); | 
 | 162 |     if (entry.count == 0 || entry.count % 4 || entry.type != TYPE_INT32) { | 
 | 163 |         ALOGE("%s: malformed available stream configuration key! count %zu, type %d", | 
 | 164 |                 __FUNCTION__, entry.count, entry.type); | 
 | 165 |         return; | 
 | 166 |     } | 
 | 167 |  | 
 | 168 |     Vector<int32_t> filteredStreamConfigs; | 
 | 169 |     filteredStreamConfigs.setCapacity(entry.count); | 
 | 170 |  | 
 | 171 |     for (size_t i=0; i < entry.count; i += STREAM_CONFIGURATION_SIZE) { | 
 | 172 |         int32_t format = entry.data.i32[i + STREAM_FORMAT_OFFSET]; | 
 | 173 |         int32_t width = entry.data.i32[i + STREAM_WIDTH_OFFSET]; | 
 | 174 |         int32_t height = entry.data.i32[i + STREAM_HEIGHT_OFFSET]; | 
 | 175 |         int32_t isInput = entry.data.i32[i + STREAM_IS_INPUT_OFFSET]; | 
 | 176 |         if (isInput == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT) { | 
 | 177 |             // Hide input streams | 
 | 178 |             continue; | 
 | 179 |         } | 
 | 180 |         // Translate HAL formats to NDK format | 
 | 181 |         if (format == HAL_PIXEL_FORMAT_BLOB) { | 
 | 182 |             format = AIMAGE_FORMAT_JPEG; | 
 | 183 |         } | 
 | 184 |         filteredStreamConfigs.push_back(format); | 
 | 185 |         filteredStreamConfigs.push_back(width); | 
 | 186 |         filteredStreamConfigs.push_back(height); | 
 | 187 |         filteredStreamConfigs.push_back(isInput); | 
 | 188 |     } | 
 | 189 |  | 
 | 190 |     mData.update(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, filteredStreamConfigs); | 
 | 191 |  | 
 | 192 |     entry = mData.find(ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS); | 
 | 193 |     Vector<int32_t> filteredDepthStreamConfigs; | 
 | 194 |     filteredDepthStreamConfigs.setCapacity(entry.count); | 
 | 195 |  | 
 | 196 |     for (size_t i=0; i < entry.count; i += STREAM_CONFIGURATION_SIZE) { | 
 | 197 |         int32_t format = entry.data.i32[i + STREAM_FORMAT_OFFSET]; | 
 | 198 |         int32_t width = entry.data.i32[i + STREAM_WIDTH_OFFSET]; | 
 | 199 |         int32_t height = entry.data.i32[i + STREAM_HEIGHT_OFFSET]; | 
 | 200 |         int32_t isInput = entry.data.i32[i + STREAM_IS_INPUT_OFFSET]; | 
 | 201 |         if (isInput == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT) { | 
 | 202 |             // Hide input streams | 
 | 203 |             continue; | 
 | 204 |         } | 
 | 205 |         // Translate HAL formats to NDK format | 
 | 206 |         if (format == HAL_PIXEL_FORMAT_BLOB) { | 
 | 207 |             format = AIMAGE_FORMAT_DEPTH_POINT_CLOUD; | 
 | 208 |         } else if (format == HAL_PIXEL_FORMAT_Y16) { | 
 | 209 |             format = AIMAGE_FORMAT_DEPTH16; | 
 | 210 |         } | 
 | 211 |  | 
 | 212 |         filteredDepthStreamConfigs.push_back(format); | 
 | 213 |         filteredDepthStreamConfigs.push_back(width); | 
 | 214 |         filteredDepthStreamConfigs.push_back(height); | 
 | 215 |         filteredDepthStreamConfigs.push_back(isInput); | 
 | 216 |     } | 
 | 217 |     mData.update(ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS, filteredDepthStreamConfigs); | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 218 | } | 
 | 219 |  | 
 | 220 | bool | 
 | 221 | ACameraMetadata::isVendorTag(const uint32_t tag) { | 
 | 222 |     uint32_t tag_section = tag >> 16; | 
 | 223 |     if (tag_section >= VENDOR_SECTION) { | 
 | 224 |         return true; | 
 | 225 |     } | 
 | 226 |     return false; | 
 | 227 | } | 
 | 228 |  | 
 | 229 | camera_status_t | 
 | 230 | ACameraMetadata::getConstEntry(uint32_t tag, ACameraMetadata_const_entry* entry) const { | 
 | 231 |     if (entry == nullptr) { | 
 | 232 |         return ACAMERA_ERROR_INVALID_PARAMETER; | 
 | 233 |     } | 
 | 234 |  | 
| Yin-Chia Yeh | 8aac03f | 2016-03-03 15:45:23 -0800 | [diff] [blame] | 235 |     Mutex::Autolock _l(mLock); | 
 | 236 |  | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 237 |     camera_metadata_ro_entry rawEntry = mData.find(tag); | 
 | 238 |     if (rawEntry.count == 0) { | 
 | 239 |         ALOGE("%s: cannot find metadata tag %d", __FUNCTION__, tag); | 
 | 240 |         return ACAMERA_ERROR_METADATA_NOT_FOUND; | 
 | 241 |     } | 
 | 242 |     entry->tag = tag; | 
 | 243 |     entry->type = rawEntry.type; | 
 | 244 |     entry->count = rawEntry.count; | 
 | 245 |     entry->data.u8 = rawEntry.data.u8; | 
 | 246 |     return ACAMERA_OK; | 
 | 247 | } | 
 | 248 |  | 
 | 249 | camera_status_t | 
 | 250 | ACameraMetadata::update(uint32_t tag, uint32_t count, const uint8_t* data) { | 
 | 251 |     return updateImpl<uint8_t>(tag, count, data); | 
 | 252 | } | 
 | 253 |  | 
 | 254 | camera_status_t | 
 | 255 | ACameraMetadata::update(uint32_t tag, uint32_t count, const int32_t* data) { | 
 | 256 |     return updateImpl<int32_t>(tag, count, data); | 
 | 257 | } | 
 | 258 |  | 
 | 259 | camera_status_t | 
 | 260 | ACameraMetadata::update(uint32_t tag, uint32_t count, const float* data) { | 
 | 261 |     return updateImpl<float>(tag, count, data); | 
 | 262 | } | 
 | 263 |  | 
 | 264 | camera_status_t | 
 | 265 | ACameraMetadata::update(uint32_t tag, uint32_t count, const double* data) { | 
 | 266 |     return updateImpl<double>(tag, count, data); | 
 | 267 | } | 
 | 268 |  | 
 | 269 | camera_status_t | 
 | 270 | ACameraMetadata::update(uint32_t tag, uint32_t count, const int64_t* data) { | 
 | 271 |     return updateImpl<int64_t>(tag, count, data); | 
 | 272 | } | 
 | 273 |  | 
 | 274 | camera_status_t | 
 | 275 | ACameraMetadata::update(uint32_t tag, uint32_t count, const ACameraMetadata_rational* data) { | 
 | 276 |     return updateImpl<camera_metadata_rational_t>(tag, count, data); | 
 | 277 | } | 
 | 278 |  | 
| Yin-Chia Yeh | 8aac03f | 2016-03-03 15:45:23 -0800 | [diff] [blame] | 279 | camera_status_t | 
 | 280 | ACameraMetadata::getTags(/*out*/int32_t* numTags, | 
 | 281 |                          /*out*/const uint32_t** tags) const { | 
 | 282 |     Mutex::Autolock _l(mLock); | 
 | 283 |     if (mTags.size() == 0) { | 
 | 284 |         size_t entry_count = mData.entryCount(); | 
 | 285 |         mTags.setCapacity(entry_count); | 
 | 286 |         const camera_metadata_t* rawMetadata = mData.getAndLock(); | 
 | 287 |         for (size_t i = 0; i < entry_count; i++) { | 
 | 288 |             camera_metadata_ro_entry_t entry; | 
 | 289 |             int ret = get_camera_metadata_ro_entry(rawMetadata, i, &entry); | 
 | 290 |             if (ret != 0) { | 
 | 291 |                 ALOGE("%s: error reading metadata index %zu", __FUNCTION__, i); | 
 | 292 |                 return ACAMERA_ERROR_UNKNOWN; | 
 | 293 |             } | 
 | 294 |             // Hide system key from users | 
 | 295 |             if (sSystemTags.count(entry.tag) == 0) { | 
 | 296 |                 mTags.push_back(entry.tag); | 
 | 297 |             } | 
 | 298 |         } | 
 | 299 |         mData.unlock(rawMetadata); | 
 | 300 |     } | 
 | 301 |  | 
 | 302 |     *numTags = mTags.size(); | 
 | 303 |     *tags = mTags.array(); | 
 | 304 |     return ACAMERA_OK; | 
 | 305 | } | 
 | 306 |  | 
 | 307 | const CameraMetadata& | 
| Emilian Peev | 5fbe0ba | 2017-10-20 15:45:45 +0100 | [diff] [blame] | 308 | ACameraMetadata::getInternalData() const { | 
| Yin-Chia Yeh | 8aac03f | 2016-03-03 15:45:23 -0800 | [diff] [blame] | 309 |     return mData; | 
 | 310 | } | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 311 |  | 
 | 312 | // TODO: some of key below should be hidden from user | 
 | 313 | // ex: ACAMERA_REQUEST_ID and ACAMERA_REPROCESS_EFFECTIVE_EXPOSURE_FACTOR | 
 | 314 | /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ | 
 | 315 |  * The key entries below this point are generated from metadata | 
 | 316 |  * definitions in /system/media/camera/docs. Do not modify by hand or | 
 | 317 |  * modify the comment blocks at the start or end. | 
 | 318 |  *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ | 
 | 319 |  | 
 | 320 | bool | 
 | 321 | ACameraMetadata::isCaptureRequestTag(const uint32_t tag) { | 
 | 322 |     // Skip check for vendor keys | 
 | 323 |     if (isVendorTag(tag)) { | 
 | 324 |         return true; | 
 | 325 |     } | 
 | 326 |  | 
 | 327 |     switch (tag) { | 
 | 328 |         case ACAMERA_COLOR_CORRECTION_MODE: | 
 | 329 |         case ACAMERA_COLOR_CORRECTION_TRANSFORM: | 
 | 330 |         case ACAMERA_COLOR_CORRECTION_GAINS: | 
 | 331 |         case ACAMERA_COLOR_CORRECTION_ABERRATION_MODE: | 
 | 332 |         case ACAMERA_CONTROL_AE_ANTIBANDING_MODE: | 
 | 333 |         case ACAMERA_CONTROL_AE_EXPOSURE_COMPENSATION: | 
 | 334 |         case ACAMERA_CONTROL_AE_LOCK: | 
 | 335 |         case ACAMERA_CONTROL_AE_MODE: | 
 | 336 |         case ACAMERA_CONTROL_AE_REGIONS: | 
 | 337 |         case ACAMERA_CONTROL_AE_TARGET_FPS_RANGE: | 
 | 338 |         case ACAMERA_CONTROL_AE_PRECAPTURE_TRIGGER: | 
 | 339 |         case ACAMERA_CONTROL_AF_MODE: | 
 | 340 |         case ACAMERA_CONTROL_AF_REGIONS: | 
 | 341 |         case ACAMERA_CONTROL_AF_TRIGGER: | 
 | 342 |         case ACAMERA_CONTROL_AWB_LOCK: | 
 | 343 |         case ACAMERA_CONTROL_AWB_MODE: | 
 | 344 |         case ACAMERA_CONTROL_AWB_REGIONS: | 
 | 345 |         case ACAMERA_CONTROL_CAPTURE_INTENT: | 
 | 346 |         case ACAMERA_CONTROL_EFFECT_MODE: | 
 | 347 |         case ACAMERA_CONTROL_MODE: | 
 | 348 |         case ACAMERA_CONTROL_SCENE_MODE: | 
 | 349 |         case ACAMERA_CONTROL_VIDEO_STABILIZATION_MODE: | 
 | 350 |         case ACAMERA_CONTROL_POST_RAW_SENSITIVITY_BOOST: | 
| Chien-Yu Chen | c0dede9 | 2017-01-11 11:10:28 -0800 | [diff] [blame] | 351 |         case ACAMERA_CONTROL_ENABLE_ZSL: | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 352 |         case ACAMERA_EDGE_MODE: | 
 | 353 |         case ACAMERA_FLASH_MODE: | 
 | 354 |         case ACAMERA_HOT_PIXEL_MODE: | 
 | 355 |         case ACAMERA_JPEG_GPS_COORDINATES: | 
 | 356 |         case ACAMERA_JPEG_GPS_PROCESSING_METHOD: | 
 | 357 |         case ACAMERA_JPEG_GPS_TIMESTAMP: | 
 | 358 |         case ACAMERA_JPEG_ORIENTATION: | 
 | 359 |         case ACAMERA_JPEG_QUALITY: | 
 | 360 |         case ACAMERA_JPEG_THUMBNAIL_QUALITY: | 
 | 361 |         case ACAMERA_JPEG_THUMBNAIL_SIZE: | 
 | 362 |         case ACAMERA_LENS_APERTURE: | 
 | 363 |         case ACAMERA_LENS_FILTER_DENSITY: | 
 | 364 |         case ACAMERA_LENS_FOCAL_LENGTH: | 
 | 365 |         case ACAMERA_LENS_FOCUS_DISTANCE: | 
 | 366 |         case ACAMERA_LENS_OPTICAL_STABILIZATION_MODE: | 
 | 367 |         case ACAMERA_NOISE_REDUCTION_MODE: | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 368 |         case ACAMERA_SCALER_CROP_REGION: | 
 | 369 |         case ACAMERA_SENSOR_EXPOSURE_TIME: | 
 | 370 |         case ACAMERA_SENSOR_FRAME_DURATION: | 
 | 371 |         case ACAMERA_SENSOR_SENSITIVITY: | 
 | 372 |         case ACAMERA_SENSOR_TEST_PATTERN_DATA: | 
 | 373 |         case ACAMERA_SENSOR_TEST_PATTERN_MODE: | 
 | 374 |         case ACAMERA_SHADING_MODE: | 
 | 375 |         case ACAMERA_STATISTICS_FACE_DETECT_MODE: | 
 | 376 |         case ACAMERA_STATISTICS_HOT_PIXEL_MAP_MODE: | 
 | 377 |         case ACAMERA_STATISTICS_LENS_SHADING_MAP_MODE: | 
| Chien-Yu Chen | 5ca4a9b | 2018-01-18 12:23:50 -0800 | [diff] [blame] | 378 |         case ACAMERA_STATISTICS_OIS_DATA_MODE: | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 379 |         case ACAMERA_TONEMAP_CURVE_BLUE: | 
 | 380 |         case ACAMERA_TONEMAP_CURVE_GREEN: | 
 | 381 |         case ACAMERA_TONEMAP_CURVE_RED: | 
 | 382 |         case ACAMERA_TONEMAP_MODE: | 
 | 383 |         case ACAMERA_TONEMAP_GAMMA: | 
 | 384 |         case ACAMERA_TONEMAP_PRESET_CURVE: | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 385 |         case ACAMERA_BLACK_LEVEL_LOCK: | 
| Eino-Ville Talvala | 2d96092 | 2018-03-13 19:46:23 -0700 | [diff] [blame] | 386 |         case ACAMERA_DISTORTION_CORRECTION_MODE: | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 387 |             return true; | 
 | 388 |         default: | 
 | 389 |             return false; | 
 | 390 |     } | 
 | 391 | } | 
 | 392 |  | 
| Yin-Chia Yeh | 8aac03f | 2016-03-03 15:45:23 -0800 | [diff] [blame] | 393 | // System tags that should be hidden from users | 
 | 394 | std::unordered_set<uint32_t> ACameraMetadata::sSystemTags ({ | 
 | 395 |     ANDROID_CONTROL_SCENE_MODE_OVERRIDES, | 
 | 396 |     ANDROID_CONTROL_AE_PRECAPTURE_ID, | 
 | 397 |     ANDROID_CONTROL_AF_TRIGGER_ID, | 
 | 398 |     ANDROID_DEMOSAIC_MODE, | 
 | 399 |     ANDROID_EDGE_STRENGTH, | 
 | 400 |     ANDROID_FLASH_FIRING_POWER, | 
 | 401 |     ANDROID_FLASH_FIRING_TIME, | 
 | 402 |     ANDROID_FLASH_COLOR_TEMPERATURE, | 
 | 403 |     ANDROID_FLASH_MAX_ENERGY, | 
 | 404 |     ANDROID_FLASH_INFO_CHARGE_DURATION, | 
 | 405 |     ANDROID_JPEG_MAX_SIZE, | 
 | 406 |     ANDROID_JPEG_SIZE, | 
 | 407 |     ANDROID_NOISE_REDUCTION_STRENGTH, | 
 | 408 |     ANDROID_QUIRKS_METERING_CROP_REGION, | 
 | 409 |     ANDROID_QUIRKS_TRIGGER_AF_WITH_AUTO, | 
 | 410 |     ANDROID_QUIRKS_USE_ZSL_FORMAT, | 
 | 411 |     ANDROID_REQUEST_INPUT_STREAMS, | 
 | 412 |     ANDROID_REQUEST_METADATA_MODE, | 
 | 413 |     ANDROID_REQUEST_OUTPUT_STREAMS, | 
 | 414 |     ANDROID_REQUEST_TYPE, | 
 | 415 |     ANDROID_REQUEST_MAX_NUM_REPROCESS_STREAMS, | 
 | 416 |     ANDROID_SCALER_AVAILABLE_RAW_MIN_DURATIONS, | 
 | 417 |     ANDROID_SCALER_AVAILABLE_RAW_SIZES, | 
 | 418 |     ANDROID_SENSOR_BASE_GAIN_FACTOR, | 
 | 419 |     ANDROID_SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS, | 
 | 420 |     ANDROID_SENSOR_TEMPERATURE, | 
 | 421 |     ANDROID_SENSOR_PROFILE_HUE_SAT_MAP, | 
 | 422 |     ANDROID_SENSOR_PROFILE_TONE_CURVE, | 
 | 423 |     ANDROID_SENSOR_OPAQUE_RAW_SIZE, | 
 | 424 |     ANDROID_SHADING_STRENGTH, | 
 | 425 |     ANDROID_STATISTICS_HISTOGRAM_MODE, | 
 | 426 |     ANDROID_STATISTICS_SHARPNESS_MAP_MODE, | 
 | 427 |     ANDROID_STATISTICS_HISTOGRAM, | 
 | 428 |     ANDROID_STATISTICS_SHARPNESS_MAP, | 
 | 429 |     ANDROID_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT, | 
 | 430 |     ANDROID_STATISTICS_INFO_MAX_HISTOGRAM_COUNT, | 
 | 431 |     ANDROID_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE, | 
 | 432 |     ANDROID_STATISTICS_INFO_SHARPNESS_MAP_SIZE, | 
| Yin-Chia Yeh | 2be96a2 | 2018-09-17 11:51:24 -0700 | [diff] [blame^] | 433 |     ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, | 
| Yin-Chia Yeh | 8aac03f | 2016-03-03 15:45:23 -0800 | [diff] [blame] | 434 |     ANDROID_DEPTH_MAX_DEPTH_SAMPLES, | 
 | 435 | }); | 
 | 436 |  | 
| Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 437 | /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ | 
 | 438 |  * End generated code | 
 | 439 |  *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ |