mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 17:03:56 +08:00
* refactor add function get_camerabuf_by_type remove cl_free use camera_id move front stuff into frontview_thread bigger refactor more typo rename camerabuf *c to *b cleanup header files remove wideview_thread camera_qcom.c to c++ fix SConscript camera_process_buf space sendrgb same with before do autoexposure in processing_thread correct sendrgb add camera_common.cc move yuv_transform to CameraBuf * use C to keep consitent * rebase master * rebase master * continue refactor * refactor all camera related data&function out of main done * cleanup * -use buf.rgb_width&height * remoe , * rebase master * remove unused std::vector * add func common_camera_process_front * fix max * fix sendrgb * less crap being logged * fix indents * add back thumbnails * thumbnail fixed on tici * junk junk junk * unify api * fix ptr ref * lol! * cleanup * more simplified * typos * remove terminate * use standard polling * ops_thread refactor, too much code! * fix build * ok * assert * listen * incl more * wq! * fix more build * macos * fix exp targets * front is different * const * bye * remath * remove irrelevant * do ops in a thread * fix init * return null * QCOM2 ops * qcom2 build * missing comma Co-authored-by: deanlee <deanlee3@gmail.com> Co-authored-by: Comma Device <device@comma.ai>
38 lines
694 B
C
38 lines
694 B
C
#pragma once
|
|
|
|
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
|
|
#ifdef __APPLE__
|
|
#include <OpenCL/cl.h>
|
|
#else
|
|
#include <CL/cl.h>
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct VisionBuf {
|
|
size_t len;
|
|
size_t mmap_len;
|
|
void* addr;
|
|
int handle;
|
|
int fd;
|
|
|
|
cl_context ctx;
|
|
cl_device_id device_id;
|
|
cl_mem buf_cl;
|
|
cl_command_queue copy_q;
|
|
} VisionBuf;
|
|
|
|
#define VISIONBUF_SYNC_FROM_DEVICE 0
|
|
#define VISIONBUF_SYNC_TO_DEVICE 1
|
|
|
|
VisionBuf visionbuf_allocate(size_t len);
|
|
VisionBuf visionbuf_allocate_cl(size_t len, cl_device_id device_id, cl_context ctx);
|
|
void visionbuf_sync(const VisionBuf* buf, int dir);
|
|
void visionbuf_free(const VisionBuf* buf);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|