spa: v4l2: Fix v4l2 SPA not working on camera with relative controls

Some V4L2 controls like focus, pan or tilt can be relative (change
the lens / angle relative to previous positions) these return EACCES
when calling VIDIOC_G_CTRL on them.

Fix the v4l2 SPA not working on cameras with relative controls,
such as e.g. the Logitech QuickCam Orbit MP.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Hans de Goede 2024-09-16 15:12:16 +02:00
parent ec5684302c
commit 0e63bd902f

View file

@ -1324,6 +1324,11 @@ spa_v4l2_update_controls(struct impl *this)
spa_zero(control);
control.id = c->ctrl_id;
if (xioctl(dev->fd, VIDIOC_G_CTRL, &control) < 0) {
/* Write only controls like relative pan/tilt return EACCES */
if (errno == EACCES) {
c->value = 0;
continue;
}
res = -errno;
goto done;
}