From ab7ff545c56a7077d5bbd03a96e9418db94e459b Mon Sep 17 00:00:00 2001 From: Robbe Derks Date: Fri, 2 Sep 2022 07:18:44 +0200 Subject: [PATCH] camerad: read param to see if we want manual gain (#25642) * also read params to determine if we want manual gains * check for larger than 0 Co-authored-by: Comma Device old-commit-hash: 7ecc0409bd767392074a37cdd0b7e44ed9953296 --- system/camerad/cameras/camera_qcom2.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/system/camerad/cameras/camera_qcom2.cc b/system/camerad/cameras/camera_qcom2.cc index c06aeb4360..a86218c06e 100644 --- a/system/camerad/cameras/camera_qcom2.cc +++ b/system/camerad/cameras/camera_qcom2.cc @@ -1101,14 +1101,18 @@ void CameraState::set_camera_exposure(float grey_frac) { } else if (enable_dc_gain && target_grey > 0.3) { enable_dc_gain = false; } + + std::string gain_bytes, time_bytes; if (env_ctrl_exp_from_params) { + gain_bytes = Params().get("CameraDebugExpGain"); + time_bytes = Params().get("CameraDebugExpTime"); + } + + if (gain_bytes.size() > 0 && time_bytes.size() > 0) { // Override gain and exposure time - if (buf.cur_frame_data.frame_id % 5 == 0) { - std::string gain_bytes = Params().get("CameraDebugExpGain"); - std::string time_bytes = Params().get("CameraDebugExpTime"); - gain_idx = std::stoi(gain_bytes); - exposure_time = std::stoi(time_bytes); - } + gain_idx = std::stoi(gain_bytes); + exposure_time = std::stoi(time_bytes); + new_g = gain_idx; new_t = exposure_time; enable_dc_gain = false;