|
|
|
@ -453,8 +453,8 @@ int V4L2_Base::init_mmap(char *errmsg)
|
|
|
|
|
buf.memory = V4L2_MEMORY_MMAP;
|
|
|
|
|
buf.index = n_buffers;
|
|
|
|
|
|
|
|
|
|
if (-1 == xioctl (fd, VIDIOC_TQUERYBUF, &buf))
|
|
|
|
|
return errno_exit ("VIDIOC_TQUERYBUF", errmsg);
|
|
|
|
|
if (-1 == xioctl (fd, VIDIOC_QUERYBUF, &buf))
|
|
|
|
|
return errno_exit ("VIDIOC_QUERYBUF", errmsg);
|
|
|
|
|
|
|
|
|
|
buffers[n_buffers].length = buf.length;
|
|
|
|
|
buffers[n_buffers].start =
|
|
|
|
@ -514,7 +514,7 @@ int V4L2_Base::init_device(char *errmsg, int pixelFormat , int width, int height
|
|
|
|
|
{
|
|
|
|
|
unsigned int min;
|
|
|
|
|
|
|
|
|
|
if (-1 == xioctl (fd, VIDIOC_TQUERYCAP, &cap))
|
|
|
|
|
if (-1 == xioctl (fd, VIDIOC_QUERYCAP, &cap))
|
|
|
|
|
{
|
|
|
|
|
if (EINVAL == errno) {
|
|
|
|
|
fprintf (stderr, "%s is no V4L2 device\n",
|
|
|
|
@ -522,7 +522,7 @@ int V4L2_Base::init_device(char *errmsg, int pixelFormat , int width, int height
|
|
|
|
|
snprintf(errmsg, ERRMSGSIZ, "%s is no V4L2 device\n", dev_name);
|
|
|
|
|
return -1;
|
|
|
|
|
} else {
|
|
|
|
|
return errno_exit ("VIDIOC_TQUERYCAP", errmsg);
|
|
|
|
|
return errno_exit ("VIDIOC_QUERYCAP", errmsg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -953,7 +953,7 @@ void V4L2_Base::enumerate_ctrl (void)
|
|
|
|
|
|
|
|
|
|
for (queryctrl.id = V4L2_CID_BASE; queryctrl.id < V4L2_CID_LASTP1; queryctrl.id++)
|
|
|
|
|
{
|
|
|
|
|
if (0 == xioctl (fd, VIDIOC_TQUERYCTRL, &queryctrl))
|
|
|
|
|
if (0 == xioctl (fd, VIDIOC_QUERYCTRL, &queryctrl))
|
|
|
|
|
{
|
|
|
|
|
cerr << "Control " << queryctrl.name << endl;
|
|
|
|
|
|
|
|
|
@ -969,14 +969,14 @@ void V4L2_Base::enumerate_ctrl (void)
|
|
|
|
|
if (errno == EINVAL)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
errno_exit("VIDIOC_TQUERYCTRL", errmsg);
|
|
|
|
|
errno_exit("VIDIOC_QUERYCTRL", errmsg);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (queryctrl.id = V4L2_CID_PRIVATE_BASE; ; queryctrl.id++)
|
|
|
|
|
{
|
|
|
|
|
if (0 == xioctl (fd, VIDIOC_TQUERYCTRL, &queryctrl))
|
|
|
|
|
if (0 == xioctl (fd, VIDIOC_QUERYCTRL, &queryctrl))
|
|
|
|
|
{
|
|
|
|
|
cerr << "Private Control " << queryctrl.name << endl;
|
|
|
|
|
|
|
|
|
@ -989,7 +989,7 @@ void V4L2_Base::enumerate_ctrl (void)
|
|
|
|
|
if (errno == EINVAL)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
errno_exit ("VIDIOC_TQUERYCTRL", errmsg);
|
|
|
|
|
errno_exit ("VIDIOC_QUERYCTRL", errmsg);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1007,12 +1007,12 @@ void V4L2_Base::enumerate_menu (void)
|
|
|
|
|
|
|
|
|
|
for (querymenu.index = queryctrl.minimum; querymenu.index <= queryctrl.maximum; querymenu.index++)
|
|
|
|
|
{
|
|
|
|
|
if (0 == xioctl (fd, VIDIOC_TQUERYMENU, &querymenu))
|
|
|
|
|
if (0 == xioctl (fd, VIDIOC_QUERYMENU, &querymenu))
|
|
|
|
|
{
|
|
|
|
|
cerr << " " << querymenu.name << endl;
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
errno_exit("VIDIOC_TQUERYMENU", errmsg);
|
|
|
|
|
errno_exit("VIDIOC_QUERYMENU", errmsg);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1027,10 +1027,10 @@ int V4L2_Base::query_ctrl(unsigned int ctrl_id, double & ctrl_min, double & ctr
|
|
|
|
|
|
|
|
|
|
queryctrl.id = ctrl_id;
|
|
|
|
|
|
|
|
|
|
if (-1 == ioctl (fd, VIDIOC_TQUERYCTRL, &queryctrl))
|
|
|
|
|
if (-1 == ioctl (fd, VIDIOC_QUERYCTRL, &queryctrl))
|
|
|
|
|
{
|
|
|
|
|
if (errno != EINVAL)
|
|
|
|
|
return errno_exit ("VIDIOC_TQUERYCTRL", errmsg);
|
|
|
|
|
return errno_exit ("VIDIOC_QUERYCTRL", errmsg);
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -1074,7 +1074,7 @@ int V4L2_Base::queryINTControls(INumberVectorProperty *nvp)
|
|
|
|
|
|
|
|
|
|
for (queryctrl.id = V4L2_CID_BASE; queryctrl.id < V4L2_CID_LASTP1; queryctrl.id++)
|
|
|
|
|
{
|
|
|
|
|
if (0 == ioctl (fd, VIDIOC_TQUERYCTRL, &queryctrl))
|
|
|
|
|
if (0 == ioctl (fd, VIDIOC_QUERYCTRL, &queryctrl))
|
|
|
|
|
{
|
|
|
|
|
if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
|
|
|
|
|
{
|
|
|
|
@ -1113,13 +1113,13 @@ int V4L2_Base::queryINTControls(INumberVectorProperty *nvp)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} else if (errno != EINVAL)
|
|
|
|
|
return errno_exit ("VIDIOC_TQUERYCTRL", errmsg);
|
|
|
|
|
return errno_exit ("VIDIOC_QUERYCTRL", errmsg);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (queryctrl.id = V4L2_CID_PRIVATE_BASE; ; queryctrl.id++)
|
|
|
|
|
{
|
|
|
|
|
if (0 == ioctl (fd, VIDIOC_TQUERYCTRL, &queryctrl))
|
|
|
|
|
if (0 == ioctl (fd, VIDIOC_QUERYCTRL, &queryctrl))
|
|
|
|
|
{
|
|
|
|
|
if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
|
|
|
|
|
{
|
|
|
|
|