Allow to configure options

This commit is contained in:
Kamil Trzcinski
2022-04-07 23:01:58 +02:00
parent 31a1f91e72
commit 386ad37b40
6 changed files with 136 additions and 21 deletions

View File

@ -246,20 +246,3 @@ int device_set_fps(device_t *dev, int desired_fps)
error:
return -1;
}
int device_set_option(device_t *dev, const char *name, uint32_t id, int32_t value)
{
struct v4l2_control ctl = {0};
if (!dev) {
return -1;
}
ctl.id = id;
ctl.value = value;
E_LOG_DEBUG(dev, "Configuring option %s (%08x) = %d", name, id, value);
E_XIOCTL(dev, dev->subdev_fd >= 0 ? dev->subdev_fd : dev->fd, VIDIOC_S_CTRL, &ctl, "Can't set option %s", name);
return 0;
error:
return -1;
}