Skip to content

Commit

Permalink
mocha: CameraWrapper fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dargons10 committed Aug 21, 2020
1 parent 5e525ef commit 0378a28
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion camera/Camera3Wrapper.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 7 additions & 3 deletions camera/CameraWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 3 additions & 2 deletions camera/CameraWrapper.h
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -14,7 +14,9 @@
* limitations under the License.
*/

#include <utils/threads.h>
#include <utils/String8.h>
#include <cutils/properties.h>
#include <hardware/hardware.h>
#include <hardware/camera.h>
#include <camera/Camera.h>
Expand All @@ -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);

0 comments on commit 0378a28

Please sign in to comment.