From 2f718d28e4d04e174530c983800da9c6e052ca7a Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Fri, 26 Feb 2021 21:42:27 +0800 Subject: [PATCH] camerad: remove param pix_ptr from set_exposure_target (#20157) --- selfdrive/camerad/cameras/camera_common.cc | 6 +++--- selfdrive/camerad/cameras/camera_common.h | 2 +- selfdrive/camerad/cameras/camera_qcom.cc | 2 +- selfdrive/camerad/cameras/camera_qcom2.cc | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/selfdrive/camerad/cameras/camera_common.cc b/selfdrive/camerad/cameras/camera_common.cc index df472d5b4..2542d3938 100644 --- a/selfdrive/camerad/cameras/camera_common.cc +++ b/selfdrive/camerad/cameras/camera_common.cc @@ -290,9 +290,9 @@ static void publish_thumbnail(PubMaster *pm, const CameraBuf *b) { free(thumbnail_buffer); } -void set_exposure_target(CameraState *c, const uint8_t *pix_ptr, int x_start, int x_end, int x_skip, int y_start, int y_end, int y_skip) { +void set_exposure_target(CameraState *c, int x_start, int x_end, int x_skip, int y_start, int y_end, int y_skip) { const CameraBuf *b = &c->buf; - + const uint8_t *pix_ptr = b->cur_yuv_buf->y; uint32_t lum_binning[256] = {0}; unsigned int lum_total = 0; for (int y = y_start; y < y_end; y += y_skip) { @@ -414,7 +414,7 @@ void common_process_driver_camera(SubMaster *sm, PubMaster *pm, CameraState *c, #endif } - set_exposure_target(c, (const uint8_t *)b->cur_yuv_buf->y, x_min, x_max, 2, y_min, y_max, skip); + set_exposure_target(c, x_min, x_max, 2, y_min, y_max, skip); } MessageBuilder msg; diff --git a/selfdrive/camerad/cameras/camera_common.h b/selfdrive/camerad/cameras/camera_common.h index 9e26ef4d5..470169a42 100644 --- a/selfdrive/camerad/cameras/camera_common.h +++ b/selfdrive/camerad/cameras/camera_common.h @@ -128,6 +128,6 @@ typedef void (*process_thread_cb)(MultiCameraState *s, CameraState *c, int cnt); void fill_frame_data(cereal::FrameData::Builder &framed, const FrameMetadata &frame_data); kj::Array get_frame_image(const CameraBuf *b); -void set_exposure_target(CameraState *c, const uint8_t *pix_ptr, int x_start, int x_end, int x_skip, int y_start, int y_end, int y_skip); +void set_exposure_target(CameraState *c, int x_start, int x_end, int x_skip, int y_start, int y_end, int y_skip); std::thread start_process_thread(MultiCameraState *cameras, CameraState *cs, process_thread_cb callback); void common_process_driver_camera(SubMaster *sm, PubMaster *pm, CameraState *c, int cnt); diff --git a/selfdrive/camerad/cameras/camera_qcom.cc b/selfdrive/camerad/cameras/camera_qcom.cc index 051854b3f..51790e089 100644 --- a/selfdrive/camerad/cameras/camera_qcom.cc +++ b/selfdrive/camerad/cameras/camera_qcom.cc @@ -1670,7 +1670,7 @@ void process_road_camera(MultiCameraState *s, CameraState *c, int cnt) { if (cnt % 3 == 0) { const int x = 290, y = 322, width = 560, height = 314; const int skip = 1; - set_exposure_target(c, (const uint8_t *)b->cur_yuv_buf->y, x, x + width, skip, y, y + height, skip); + set_exposure_target(c, x, x + width, skip, y, y + height, skip); } } diff --git a/selfdrive/camerad/cameras/camera_qcom2.cc b/selfdrive/camerad/cameras/camera_qcom2.cc index 6deabe4fe..a80b8e1b1 100644 --- a/selfdrive/camerad/cameras/camera_qcom2.cc +++ b/selfdrive/camerad/cameras/camera_qcom2.cc @@ -1115,7 +1115,7 @@ void process_road_camera(MultiCameraState *s, CameraState *c, int cnt) { if (cnt % 3 == 0) { const auto [x, y, w, h] = (c == &s->wide_road_cam) ? std::tuple(96, 250, 1734, 524) : std::tuple(96, 160, 1734, 986); const int skip = 2; - set_exposure_target(c, (const uint8_t *)b->cur_yuv_buf->y, x, x + w, skip, y, y + h, skip); + set_exposure_target(c, x, x + w, skip, y, y + h, skip); } }