Move dev->fd to dev->v4l2.dev_fd

This commit is contained in:
Kamil Trzcinski
2022-04-10 12:02:54 +02:00
parent ce439fc1ee
commit ec50191992
8 changed files with 28 additions and 29 deletions

View File

@ -15,7 +15,7 @@ int v4l2_device_set_option_by_id(device_t *dev, const char *name, uint32_t id, i
ctl.id = id;
ctl.value = value;
E_LOG_DEBUG(dev, "Configuring option %s (%08x) = %d", name, id, value);
E_XIOCTL(dev, dev->v4l2.subdev_fd >= 0 ? dev->v4l2.subdev_fd : dev->fd, VIDIOC_S_CTRL, &ctl, "Can't set option %s", name);
E_XIOCTL(dev, dev->v4l2.subdev_fd >= 0 ? dev->v4l2.subdev_fd : dev->v4l2.dev_fd, VIDIOC_S_CTRL, &ctl, "Can't set option %s", name);
return 0;
error:
return -1;
@ -155,7 +155,7 @@ int v4l2_device_set_option(device_t *dev, const char *key, const char *value)
if (dev->v4l2.subdev_fd >= 0)
ret = v4l2_device_set_option_string_fd(dev, dev->v4l2.subdev_fd, keyp, valuep);
if (ret <= 0)
ret = v4l2_device_set_option_string_fd(dev, dev->fd, keyp, valuep);
ret = v4l2_device_set_option_string_fd(dev, dev->v4l2.dev_fd, keyp, valuep);
free(keyp);
free(valuep);