Skip to content

Commit

Permalink
bps is up
Browse files Browse the repository at this point in the history
  • Loading branch information
Comma Device committed Oct 12, 2024
1 parent 7150c14 commit f9b8802
Show file tree
Hide file tree
Showing 9 changed files with 445 additions and 21 deletions.
3 changes: 3 additions & 0 deletions system/camerad/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bps.h
blob.h
/includes/
2 changes: 2 additions & 0 deletions system/camerad/SConscript
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Import('env', 'arch', 'messaging', 'common', 'gpucommon', 'visionipc')

env['CPPPATH'].append("includes/")

libs = ['pthread', common, 'jpeg', 'OpenCL', messaging, visionipc, gpucommon]

camera_obj = env.Object(['cameras/camera_qcom2.cc', 'cameras/camera_common.cc', 'cameras/spectra.cc',
Expand Down
4 changes: 4 additions & 0 deletions system/camerad/cameras/camera_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,14 @@ void CameraBuf::init(cl_device_id device_id, cl_context context, SpectraCamera *
// RAW frame
const int frame_size = (sensor->frame_height + sensor->extra_height) * sensor->frame_stride;
camera_bufs = std::make_unique<VisionBuf[]>(frame_buf_count);
camera_bufs_raw = std::make_unique<VisionBuf[]>(frame_buf_count);
camera_bufs_metadata = std::make_unique<FrameMetadata[]>(frame_buf_count);

for (int i = 0; i < frame_buf_count; i++) {
camera_bufs[i].allocate(frame_size);
camera_bufs_raw[i].allocate(frame_size);
camera_bufs[i].init_cl(device_id, context);
camera_bufs_raw[i].init_cl(device_id, context);
}
LOGD("allocated %d CL buffers", frame_buf_count);

Expand All @@ -98,6 +101,7 @@ void CameraBuf::init(cl_device_id device_id, cl_context context, SpectraCamera *
CameraBuf::~CameraBuf() {
for (int i = 0; i < frame_buf_count; i++) {
camera_bufs[i].free();
camera_bufs_raw[i].free();
}
if (imgproc) delete imgproc;
}
Expand Down
1 change: 1 addition & 0 deletions system/camerad/cameras/camera_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class CameraBuf {
FrameMetadata cur_frame_data;
VisionBuf *cur_yuv_buf;
VisionBuf *cur_camera_buf;
std::unique_ptr<VisionBuf[]> camera_bufs_raw;
std::unique_ptr<VisionBuf[]> camera_bufs;
std::unique_ptr<FrameMetadata[]> camera_bufs_metadata;
int out_img_width, out_img_height;
Expand Down
Loading

0 comments on commit f9b8802

Please sign in to comment.