mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-21 05:52:06 +08:00
camerad: cleanup CameraBuf::acquire (#25737)
* cleanup * add that back * less indent Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -116,30 +116,24 @@ bool CameraBuf::acquire() {
|
||||
|
||||
if (camera_bufs_metadata[cur_buf_idx].frame_id == -1) {
|
||||
LOGE("no frame data? wtf");
|
||||
release();
|
||||
return false;
|
||||
}
|
||||
|
||||
cur_frame_data = camera_bufs_metadata[cur_buf_idx];
|
||||
cur_yuv_buf = vipc_server->get_buffer(yuv_type);
|
||||
cl_mem camrabuf_cl = camera_bufs[cur_buf_idx].buf_cl;
|
||||
cl_event event;
|
||||
|
||||
double start_time = millis_since_boot();
|
||||
|
||||
cur_camera_buf = &camera_bufs[cur_buf_idx];
|
||||
|
||||
debayer->queue(q, camrabuf_cl, cur_yuv_buf->buf_cl, rgb_width, rgb_height, &event);
|
||||
|
||||
double start_time = millis_since_boot();
|
||||
cl_event event;
|
||||
debayer->queue(q, camera_bufs[cur_buf_idx].buf_cl, cur_yuv_buf->buf_cl, rgb_width, rgb_height, &event);
|
||||
clWaitForEvents(1, &event);
|
||||
CL_CHECK(clReleaseEvent(event));
|
||||
|
||||
cur_frame_data.processing_time = (millis_since_boot() - start_time) / 1000.0;
|
||||
|
||||
VisionIpcBufExtra extra = {
|
||||
cur_frame_data.frame_id,
|
||||
cur_frame_data.timestamp_sof,
|
||||
cur_frame_data.timestamp_eof,
|
||||
cur_frame_data.frame_id,
|
||||
cur_frame_data.timestamp_sof,
|
||||
cur_frame_data.timestamp_eof,
|
||||
};
|
||||
cur_yuv_buf->set_frame_id(cur_frame_data.frame_id);
|
||||
vipc_server->send(cur_yuv_buf, &extra);
|
||||
@@ -147,10 +141,6 @@ bool CameraBuf::acquire() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void CameraBuf::release() {
|
||||
// Empty
|
||||
}
|
||||
|
||||
void CameraBuf::queue(size_t buf_idx) {
|
||||
safe_queue.push(buf_idx);
|
||||
}
|
||||
@@ -328,7 +318,6 @@ void *processing_thread(MultiCameraState *cameras, CameraState *cs, process_thre
|
||||
// this takes 10ms???
|
||||
publish_thumbnail(cameras->pm, &(cs->buf));
|
||||
}
|
||||
cs->buf.release();
|
||||
++cnt;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -102,7 +102,6 @@ public:
|
||||
~CameraBuf();
|
||||
void init(cl_device_id device_id, cl_context context, CameraState *s, VisionIpcServer * v, int frame_cnt, VisionStreamType yuv_type);
|
||||
bool acquire();
|
||||
void release();
|
||||
void queue(size_t buf_idx);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user