From 89395a7a3f33cc6ac7a0df3fdbcc73bf56cdecc6 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 12 Dec 2023 13:53:27 +0800 Subject: [PATCH] camerad/CameraBuf: rename yuv_type to stream_type (#30695) old-commit-hash: 62670e66bfb93f2d203abcb675f93ccac39d768a --- system/camerad/cameras/camera_common.cc | 8 ++++---- system/camerad/cameras/camera_common.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/system/camerad/cameras/camera_common.cc b/system/camerad/cameras/camera_common.cc index e36766ca2d..645a6f305c 100644 --- a/system/camerad/cameras/camera_common.cc +++ b/system/camerad/cameras/camera_common.cc @@ -61,9 +61,9 @@ private: cl_kernel krnl_; }; -void CameraBuf::init(cl_device_id device_id, cl_context context, CameraState *s, VisionIpcServer * v, int frame_cnt, VisionStreamType init_yuv_type) { +void CameraBuf::init(cl_device_id device_id, cl_context context, CameraState *s, VisionIpcServer * v, int frame_cnt, VisionStreamType type) { vipc_server = v; - this->yuv_type = init_yuv_type; + stream_type = type; frame_buf_count = frame_cnt; const SensorInfo *ci = s->ci.get(); @@ -87,7 +87,7 @@ void CameraBuf::init(cl_device_id device_id, cl_context context, CameraState *s, assert(nv12_height/2 == VENUS_UV_SCANLINES(COLOR_FMT_NV12, rgb_height)); size_t nv12_size = 2346 * nv12_width; // comes from v4l2_format.fmt.pix_mp.plane_fmt[0].sizeimage size_t nv12_uv_offset = nv12_width * nv12_height; - vipc_server->create_buffers_with_sizes(yuv_type, YUV_BUFFER_COUNT, false, rgb_width, rgb_height, nv12_size, nv12_width, nv12_uv_offset); + vipc_server->create_buffers_with_sizes(stream_type, YUV_BUFFER_COUNT, false, rgb_width, rgb_height, nv12_size, nv12_width, nv12_uv_offset); LOGD("created %d YUV vipc buffers with size %dx%d", YUV_BUFFER_COUNT, nv12_width, nv12_height); debayer = new Debayer(device_id, context, this, s, nv12_width, nv12_uv_offset); @@ -113,7 +113,7 @@ bool CameraBuf::acquire() { } cur_frame_data = camera_bufs_metadata[cur_buf_idx]; - cur_yuv_buf = vipc_server->get_buffer(yuv_type); + cur_yuv_buf = vipc_server->get_buffer(stream_type); cur_camera_buf = &camera_bufs[cur_buf_idx]; double start_time = millis_since_boot(); diff --git a/system/camerad/cameras/camera_common.h b/system/camerad/cameras/camera_common.h index e93d357b8d..9ebe018408 100644 --- a/system/camerad/cameras/camera_common.h +++ b/system/camerad/cameras/camera_common.h @@ -55,7 +55,7 @@ class CameraBuf { private: VisionIpcServer *vipc_server; Debayer *debayer = nullptr; - VisionStreamType yuv_type; + VisionStreamType stream_type; int cur_buf_idx; SafeQueue safe_queue; int frame_buf_count; @@ -71,7 +71,7 @@ public: CameraBuf() = default; ~CameraBuf(); - void init(cl_device_id device_id, cl_context context, CameraState *s, VisionIpcServer * v, int frame_cnt, VisionStreamType yuv_type); + void init(cl_device_id device_id, cl_context context, CameraState *s, VisionIpcServer * v, int frame_cnt, VisionStreamType type); bool acquire(); void queue(size_t buf_idx); };