From d97dae923b91cefcae24b4d6cf116acabf7088f4 Mon Sep 17 00:00:00 2001 From: deanlee Date: Thu, 19 Sep 2024 16:45:48 +0800 Subject: [PATCH] add exposure_val_percent to FrameMetadata --- system/camerad/cameras/camera_common.h | 1 + system/camerad/cameras/camera_qcom2.cc | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/camerad/cameras/camera_common.h b/system/camerad/cameras/camera_common.h index d1f0b0d0e1f0e1..3f177ca2d7ed41 100644 --- a/system/camerad/cameras/camera_common.h +++ b/system/camerad/cameras/camera_common.h @@ -36,6 +36,7 @@ typedef struct FrameMetadata { float gain; float measured_grey_fraction; float target_grey_fraction; + float exposure_val_percent; float processing_time; } FrameMetadata; diff --git a/system/camerad/cameras/camera_qcom2.cc b/system/camerad/cameras/camera_qcom2.cc index 3b2b9db3307f7e..eb2e686f5b8215 100644 --- a/system/camerad/cameras/camera_qcom2.cc +++ b/system/camerad/cameras/camera_qcom2.cc @@ -113,6 +113,7 @@ void CameraState::handle_camera_event(void *evdat) { meta_data.integ_lines = exposure_time; meta_data.measured_grey_fraction = measured_grey_fraction; meta_data.target_grey_fraction = target_grey_fraction; + meta_data.exposure_val_percent = util::map_val(cur_ev[meta_data.frame_id % 3], ci->min_ev, ci->max_ev, 0.0f, 100.0f); exp_lock.unlock(); // dispatch @@ -292,9 +293,7 @@ void CameraState::run() { framed.setMeasuredGreyFraction(buf.cur_frame_data.measured_grey_fraction); framed.setTargetGreyFraction(buf.cur_frame_data.target_grey_fraction); framed.setProcessingTime(buf.cur_frame_data.processing_time); - - const float ev = cur_ev[buf.cur_frame_data.frame_id % 3]; - const float perc = util::map_val(ev, sensor->min_ev, sensor->max_ev, 0.0f, 100.0f); + framed.setExposureValPercent(buf.cur_frame_data.exposure_val_percent); framed.setExposureValPercent(perc); framed.setSensor(sensor->image_sensor);