From 0378a28911a7c5acb9fce74f18fa48e7ad7d649c Mon Sep 17 00:00:00 2001 From: Dargons10 Date: Fri, 21 Aug 2020 23:46:10 +0200 Subject: [PATCH] mocha: CameraWrapper fix --- camera/Camera3Wrapper.h | 2 +- camera/CameraWrapper.cpp | 10 +++++++--- camera/CameraWrapper.h | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/camera/Camera3Wrapper.h b/camera/Camera3Wrapper.h index bf815ca..9e64110 100644 --- a/camera/Camera3Wrapper.h +++ b/camera/Camera3Wrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017, The LineageOS Project + * Copyright (C) 2015, The CyanogenMod Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/camera/CameraWrapper.cpp b/camera/CameraWrapper.cpp index 88fd261..d9e668b 100644 --- a/camera/CameraWrapper.cpp +++ b/camera/CameraWrapper.cpp @@ -185,15 +185,19 @@ static int camera_get_camera_info(int camera_id, struct camera_info *info) find_camera_metadata_entry(vendorInfo[camera_id], ANDROID_CONTROL_MAX_REGIONS, &found_entry); size_t del_index = found_entry.index; delete_camera_metadata_entry(vendorInfo[camera_id], del_index); - + find_camera_metadata_entry(vendorInfo[camera_id], ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS, &found_entry); del_index = found_entry.index; delete_camera_metadata_entry(vendorInfo[camera_id], del_index); int32_t max_regions[3] = {8,8,8}; add_camera_metadata_entry(vendorInfo[camera_id], ANDROID_CONTROL_MAX_REGIONS, max_regions, 3); - } - + + find_camera_metadata_entry(vendorInfo[camera_id], ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION, &found_entry); + found_entry.data.u8[0] = ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE; + add_camera_metadata_entry(vendorInfo[camera_id], ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION, &found_entry, found_entry.index); + } + info->static_camera_characteristics = vendorInfo[camera_id]; dump_camera_metadata(info->static_camera_characteristics, 1, 2); diff --git a/camera/CameraWrapper.h b/camera/CameraWrapper.h index 417a011..12c9082 100644 --- a/camera/CameraWrapper.h +++ b/camera/CameraWrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017, The LineageOS Project + * Copyright (C) 2015, The CyanogenMod Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ +#include #include +#include #include #include #include @@ -30,4 +32,3 @@ static int camera_get_camera_info(int camera_id, struct camera_info *info); static int camera_set_callbacks(const camera_module_callbacks_t *callbacks); static void camera_get_vendor_tag_ops(vendor_tag_ops_t* ops); static int camera_open_legacy(const struct hw_module_t* module, const char* id, uint32_t halVersion, struct hw_device_t** device); -static int camera_set_torch_mode(const char* camera_id, bool enabled);