The libcamera
starts
This commit is contained in:
@ -40,7 +40,19 @@ camera_t *camera_open(camera_options_t *options)
|
||||
camera->name = "CAMERA";
|
||||
camera->options = *options;
|
||||
|
||||
camera->camera = device_v4l2_open(camera->name, camera->options.path);
|
||||
switch (camera->options.type) {
|
||||
case CAMERA_V4L2:
|
||||
camera->camera = device_v4l2_open(camera->name, camera->options.path);
|
||||
break;
|
||||
|
||||
case CAMERA_LIBCAMERA:
|
||||
camera->camera = device_libcamera_open(camera->name, camera->options.path);
|
||||
break;
|
||||
|
||||
default:
|
||||
E_LOG_ERROR(camera, "Unsupported camera type");
|
||||
}
|
||||
|
||||
if (!camera->camera) {
|
||||
goto error;
|
||||
}
|
||||
|
@ -9,10 +9,16 @@
|
||||
#define CAMERA_DEVICE_CAMERA 0
|
||||
#define CAMERA_OPTIONS_LENGTH 4096
|
||||
|
||||
typedef enum {
|
||||
CAMERA_V4L2 = 0,
|
||||
CAMERA_LIBCAMERA
|
||||
} camera_type_t;
|
||||
|
||||
typedef struct camera_options_s {
|
||||
char path[256];
|
||||
unsigned width, height, format;
|
||||
unsigned nbufs, fps;
|
||||
camera_type_t type;
|
||||
bool allow_dma;
|
||||
float high_res_factor;
|
||||
float low_res_factor;
|
||||
|
Reference in New Issue
Block a user