|
|
|
@ -91,38 +91,36 @@ struct MultiCameraState; |
|
|
|
|
struct CameraState; |
|
|
|
|
|
|
|
|
|
class CameraBuf { |
|
|
|
|
public: |
|
|
|
|
private: |
|
|
|
|
VisionIpcServer *vipc_server; |
|
|
|
|
CameraState *camera_state; |
|
|
|
|
cl_kernel krnl_debayer; |
|
|
|
|
cl_command_queue q; |
|
|
|
|
|
|
|
|
|
RGBToYUVState rgb_to_yuv_state; |
|
|
|
|
|
|
|
|
|
mat3 yuv_transform; |
|
|
|
|
|
|
|
|
|
FrameMetadata yuv_metas[YUV_COUNT]; |
|
|
|
|
|
|
|
|
|
VisionStreamType rgb_type, yuv_type; |
|
|
|
|
int rgb_width, rgb_height, rgb_stride; |
|
|
|
|
|
|
|
|
|
FrameMetadata cur_frame_data; |
|
|
|
|
|
|
|
|
|
VisionBuf *cur_rgb_buf; |
|
|
|
|
VisionBuf *cur_yuv_buf; |
|
|
|
|
|
|
|
|
|
int cur_buf_idx; |
|
|
|
|
|
|
|
|
|
std::mutex frame_queue_mutex; |
|
|
|
|
std::condition_variable frame_queue_cv; |
|
|
|
|
std::queue<size_t> frame_queue; |
|
|
|
|
|
|
|
|
|
std::unique_ptr<VisionBuf[]> camera_bufs; |
|
|
|
|
std::unique_ptr<FrameMetadata[]> camera_bufs_metadata; |
|
|
|
|
|
|
|
|
|
int frame_buf_count; |
|
|
|
|
|
|
|
|
|
release_cb release_callback; |
|
|
|
|
|
|
|
|
|
public: |
|
|
|
|
cl_command_queue q; |
|
|
|
|
FrameMetadata cur_frame_data; |
|
|
|
|
VisionBuf *cur_rgb_buf; |
|
|
|
|
VisionBuf *cur_yuv_buf; |
|
|
|
|
std::unique_ptr<VisionBuf[]> camera_bufs; |
|
|
|
|
std::unique_ptr<FrameMetadata[]> camera_bufs_metadata; |
|
|
|
|
int rgb_width, rgb_height, rgb_stride; |
|
|
|
|
|
|
|
|
|
mat3 yuv_transform; |
|
|
|
|
|
|
|
|
|
CameraBuf() = default; |
|
|
|
|
~CameraBuf(); |
|
|
|
|
void init(cl_device_id device_id, cl_context context, CameraState *s, VisionIpcServer * v, int frame_cnt, VisionStreamType rgb_type, VisionStreamType yuv_type, release_cb release_callback=nullptr); |
|
|
|
|