Open default camera of a given type

This commit is contained in:
Kamil Trzcinski
2022-07-12 21:59:02 +02:00
parent 1857cd8d77
commit 4e641dea1e
3 changed files with 37 additions and 16 deletions

View File

@ -9,7 +9,13 @@
static int camera_configure_input_v4l2(camera_t *camera)
{
camera->camera = device_v4l2_open(camera->name, camera->options.path);
const char *path = camera->options.path;
if (!*path) {
path = "/dev/video0";
}
camera->camera = device_v4l2_open(camera->name, path);
if (!camera->camera) {
LOG_INFO(camera, "Listing available v4l2 devices:");
system("v4l2-ctl --list-devices");