V4L2 Camera Driver Development Custom Controls

I could figure out how to achieve what I wanted by myself, so here is what I needed to do to set Sensor Ctrl Settings from my C++ userspace application:

struct v4l2_ext_controls ctrls;
struct v4l2_ext_control ctrl;
CLEAR(ctrl);
CLEAR(ctrls);
ctrls.controls = &ctrl;
ctrls.count = 1;
ctrls.which = V4L2_CTRL_WHICH_CUR_VAL;

ctrl.id = TEGRA_CAMERA_CID_EXPOSURE;
ctrl.value = ;
if (xioctl(fd, VIDIOC_S_EXT_CTRLS, &ctrls) == -1) {
     fprintf(stderr, "Error VIDIOC_S_EXT_CTRLS %s\n",strerror(errno));
 }

Thank you anyway for your help!

5 Likes