#ifndef LC_INTERNAL_H
#define LC_INTERNAL_H
#include "types.h"
#include <libcamera/camera.h>
#include <libcamera/camera_manager.h>
#include <libcamera/controls.h>
#include <libcamera/framebuffer.h>
#include <libcamera/framebuffer_allocator.h>
#include <libcamera/request.h>
#include <libcamera/stream.h>
#include <memory>
#include <vector>
using namespace libcamera;
struct RequestCallbackWrapper {
lc_request_completed_cb cb = nullptr;
void* user_data = nullptr;
};
struct lc_camera_manager {
std::unique_ptr<CameraManager> cm;
};
struct lc_camera {
std::shared_ptr<Camera> camera;
RequestCallbackWrapper callback;
};
struct lc_camera_configuration {
CameraConfiguration* config;
};
struct lc_stream_configuration {
StreamConfiguration* sc;
};
struct lc_request {
Request* request;
};
struct lc_frame_buffer {
FrameBuffer* fb;
};
struct lc_frame_buffer_allocator {
std::unique_ptr<FrameBufferAllocator> alloc;
};
struct lc_stream {
Stream* stream;
};
struct lc_control_list {
ControlList* list;
bool owned;
};
inline StreamRole to_stream_role(lc_stream_role_t role) {
switch (role) {
case LC_STREAM_ROLE_RAW:
return StreamRole::Raw;
case LC_STREAM_ROLE_STILL_CAPTURE:
return StreamRole::StillCapture;
case LC_STREAM_ROLE_VIDEO_RECORDING:
return StreamRole::VideoRecording;
case LC_STREAM_ROLE_VIEWFINDER:
return StreamRole::Viewfinder;
default:
return StreamRole::Viewfinder;
}
}
#endif