Loading services/camera/libcameraservice/FwkOnlyMetadataTags.h 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <array> #pragma once /** * ! Do not edit this file directly ! * * Generated automatically from fwk_only_metadata_tags.mako. To be included in libcameraservice * only by Camera3Device.cpp. */ namespace android { /** * Framework only CaptureRequest keys. To be used for filtering out keys in CaptureRequest * before sending to the HAL. */ constexpr std::array kFwkOnlyMetadataKeys = { ANDROID_CONTROL_AF_REGIONS_SET, ANDROID_CONTROL_AE_REGIONS_SET, ANDROID_CONTROL_AWB_REGIONS_SET, ANDROID_CONTROL_ZOOM_METHOD, ANDROID_SCALER_CROP_REGION_SET, ANDROID_EXTENSION_STRENGTH, }; } //namespace android services/camera/libcameraservice/device3/Camera3Device.cpp +2 −7 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ #include <com_android_window_flags.h> #include "CameraService.h" #include "FwkOnlyMetadataTags.h" #include "aidl/android/hardware/graphics/common/Dataspace.h" #include "aidl/AidlUtils.h" #include "device3/Camera3Device.h" Loading Loading @@ -3797,18 +3798,12 @@ bool Camera3Device::RequestThread::threadLoop() { } status_t Camera3Device::removeFwkOnlyKeys(CameraMetadata *request) { static const std::array<uint32_t, 5> kFwkOnlyKeys = { ANDROID_CONTROL_AF_REGIONS_SET, ANDROID_CONTROL_AE_REGIONS_SET, ANDROID_CONTROL_AWB_REGIONS_SET, ANDROID_SCALER_CROP_REGION_SET, ANDROID_CONTROL_ZOOM_METHOD}; if (request == nullptr) { ALOGE("%s request metadata nullptr", __FUNCTION__); return BAD_VALUE; } status_t res = OK; for (const auto &key : kFwkOnlyKeys) { for (const auto &key : kFwkOnlyMetadataKeys) { if (request->exists(key)) { res = request->erase(key); if (res != OK) { Loading Loading
services/camera/libcameraservice/FwkOnlyMetadataTags.h 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <array> #pragma once /** * ! Do not edit this file directly ! * * Generated automatically from fwk_only_metadata_tags.mako. To be included in libcameraservice * only by Camera3Device.cpp. */ namespace android { /** * Framework only CaptureRequest keys. To be used for filtering out keys in CaptureRequest * before sending to the HAL. */ constexpr std::array kFwkOnlyMetadataKeys = { ANDROID_CONTROL_AF_REGIONS_SET, ANDROID_CONTROL_AE_REGIONS_SET, ANDROID_CONTROL_AWB_REGIONS_SET, ANDROID_CONTROL_ZOOM_METHOD, ANDROID_SCALER_CROP_REGION_SET, ANDROID_EXTENSION_STRENGTH, }; } //namespace android
services/camera/libcameraservice/device3/Camera3Device.cpp +2 −7 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ #include <com_android_window_flags.h> #include "CameraService.h" #include "FwkOnlyMetadataTags.h" #include "aidl/android/hardware/graphics/common/Dataspace.h" #include "aidl/AidlUtils.h" #include "device3/Camera3Device.h" Loading Loading @@ -3797,18 +3798,12 @@ bool Camera3Device::RequestThread::threadLoop() { } status_t Camera3Device::removeFwkOnlyKeys(CameraMetadata *request) { static const std::array<uint32_t, 5> kFwkOnlyKeys = { ANDROID_CONTROL_AF_REGIONS_SET, ANDROID_CONTROL_AE_REGIONS_SET, ANDROID_CONTROL_AWB_REGIONS_SET, ANDROID_SCALER_CROP_REGION_SET, ANDROID_CONTROL_ZOOM_METHOD}; if (request == nullptr) { ALOGE("%s request metadata nullptr", __FUNCTION__); return BAD_VALUE; } status_t res = OK; for (const auto &key : kFwkOnlyKeys) { for (const auto &key : kFwkOnlyMetadataKeys) { if (request->exists(key)) { res = request->erase(key); if (res != OK) { Loading