Skip to contentSkip to conversation

Range values for V4L2_CID_* commands

DISCUSSION Lucas 2 participants 3 messages Jul 10, 2020 Media (V4L/DVB)

lore
Share & tools
lore

Lucas

author
#0 lore raw

Hello, how do I obtain the accepted range of values for each V4L2_CID command? Take V4L2_CID_BRIGHTNESS as an example, how do I know what is the maximum and minimum values accepted for it? I have tried to use 'v4l2_ioctl(fd, VIDIOC_G_CTRL, &query);' thinking that would be stored in the maximum and minimum members for the struct v4l2_queryctrl but that does not appear to be the case as the values for those members are always zero.

Thank you.

#1 lore raw
Quoted 7 lines · Lucas

Hello, how do I obtain the accepted range of values for each V4L2_CID command? Take V4L2_CID_BRIGHTNESS as an example, how do I know what is the maximum and minimum values accepted for it? I have tried to use 'v4l2_ioctl(fd, VIDIOC_G_CTRL, &query);' thinking that would be stored in the maximum and minimum members for the struct v4l2_queryctrl but that does not appear to be the case as the values for those members are always zero.

Use VIDIOC_QUERYCTRL for that. See:

https://linuxtv.org/downloads/v4l-dvb-apis-new/userspace-api/v4l/vidioc-queryctrl.html

Regards,

Hans

author
#2 lore raw

Thank you kind sir.

Quoted 15 lines · Hans Verkuil
Quoted 7 lines · Lucas

Hello, how do I obtain the accepted range of values for each V4L2_CID command? Take V4L2_CID_BRIGHTNESS as an example, how do I know what is the maximum and minimum values accepted for it? I have tried to use 'v4l2_ioctl(fd, VIDIOC_G_CTRL, &query);' thinking that would be stored in the maximum and minimum members for the struct v4l2_queryctrl but that does not appear to be the case as the values for those members are always zero.

Use VIDIOC_QUERYCTRL for that. See:

https://linuxtv.org/downloads/v4l-dvb-apis-new/userspace-api/v4l/vidioc-queryctrl.html

Regards,

Hans