Skip to content

VIDIOC_G_CTRL cannot always be translated to VIDIOC_G_EXT_CTRLS #2

@Gnurou

Description

@Gnurou

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions