The libcamera
starts
This commit is contained in:
@ -60,12 +60,19 @@ option_value_t camera_formats[] = {
|
||||
{}
|
||||
};
|
||||
|
||||
option_value_t camera_type[] = {
|
||||
{ "v4l2", CAMERA_V4L2 },
|
||||
{ "libcamera", CAMERA_LIBCAMERA },
|
||||
{}
|
||||
};
|
||||
|
||||
option_t all_options[] = {
|
||||
DEFINE_OPTION_PTR(camera, path, string),
|
||||
DEFINE_OPTION(camera, width, uint),
|
||||
DEFINE_OPTION(camera, height, uint),
|
||||
DEFINE_OPTION_VALUES(camera, format, camera_formats),
|
||||
DEFINE_OPTION(camera, nbufs, uint),
|
||||
DEFINE_OPTION_VALUES(camera, type, camera_type),
|
||||
DEFINE_OPTION(camera, fps, uint),
|
||||
DEFINE_OPTION_DEFAULT(camera, allow_dma, bool, "1"),
|
||||
DEFINE_OPTION(camera, high_res_factor, float),
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "device/camera/camera.h"
|
||||
|
||||
log_options_t log_options = {
|
||||
.debug = false,
|
||||
.debug = true,
|
||||
.verbose = false
|
||||
};
|
||||
|
||||
@ -12,12 +12,17 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
device_t *dev = NULL;
|
||||
|
||||
dev = device_libcamera_open("CAMERA", "/dev/video0");
|
||||
dev = device_libcamera_open("CAMERA", "/base/soc/i2c0mux/i2c@1/imx519@1a");
|
||||
if (!dev) {
|
||||
printf("Failed to open libcamera\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (device_open_buffer_list(dev, true, 2328, 1748, V4L2_PIX_FMT_VYUY, 0, 4, true) < 0) {
|
||||
printf("Failed to open buffer list\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Opened libcamera\n");
|
||||
|
||||
device_close(dev);
|
||||
|
Reference in New Issue
Block a user