Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIDIOC_G_CTRL cannot always be translated to VIDIOC_G_EXT_CTRLS #2

Open
Gnurou opened this issue Feb 8, 2024 · 0 comments
Open

VIDIOC_G_CTRL cannot always be translated to VIDIOC_G_EXT_CTRLS #2

Gnurou opened this issue Feb 8, 2024 · 0 comments

Comments

@Gnurou
Copy link
Collaborator

Gnurou commented Feb 8, 2024

Right now we are wrapping calls to G_CTRL into G_EXT_CTRLS in order to limit the number of ioctls we need to support.

This works most of the time, except when quering a 64-bit control: in this case G_CTRL is supposed to return -EINVAL because the value type of v4l2_ctrl is 32-bit and thus cannot hold the requested control's value (same for string and class controls). The following code in v4l2-compliance is what enforces this:

		if (qctrl.type == V4L2_CTRL_TYPE_INTEGER64 ||
		    qctrl.type == V4L2_CTRL_TYPE_STRING ||
		    qctrl.type == V4L2_CTRL_TYPE_CTRL_CLASS) {
			ret = doioctl(node, VIDIOC_G_CTRL, &ctrl);
			if (ret != EINVAL &&
			    !((qctrl.flags & V4L2_CTRL_FLAG_WRITE_ONLY) && ret == EACCES))

So it seems like we have to forward the G_CTRL and S_CTRL ioctls to the host in order to handle this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant