Merge pull request #2443 from waveform80:issue-3554
This commit is contained in:
commit
f351540eda
@ -321,7 +321,6 @@ typedef struct CvCaptureCAM_V4L
|
|||||||
struct v4l2_control control;
|
struct v4l2_control control;
|
||||||
enum v4l2_buf_type type;
|
enum v4l2_buf_type type;
|
||||||
struct v4l2_queryctrl queryctrl;
|
struct v4l2_queryctrl queryctrl;
|
||||||
struct v4l2_querymenu querymenu;
|
|
||||||
|
|
||||||
/* V4L2 control variables */
|
/* V4L2 control variables */
|
||||||
v4l2_ctrl_range** v4l2_ctrl_ranges;
|
v4l2_ctrl_range** v4l2_ctrl_ranges;
|
||||||
@ -491,25 +490,6 @@ static int try_init_v4l2(CvCaptureCAM_V4L* capture, char *deviceName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void v4l2_scan_controls_enumerate_menu(CvCaptureCAM_V4L* capture)
|
|
||||||
{
|
|
||||||
// printf (" Menu items:\n");
|
|
||||||
CLEAR (capture->querymenu);
|
|
||||||
capture->querymenu.id = capture->queryctrl.id;
|
|
||||||
for (capture->querymenu.index = capture->queryctrl.minimum;
|
|
||||||
(int)capture->querymenu.index <= capture->queryctrl.maximum;
|
|
||||||
capture->querymenu.index++)
|
|
||||||
{
|
|
||||||
if (0 == xioctl (capture->deviceHandle, VIDIOC_QUERYMENU,
|
|
||||||
&capture->querymenu))
|
|
||||||
{
|
|
||||||
//printf (" %s\n", capture->querymenu.name);
|
|
||||||
} else {
|
|
||||||
perror ("VIDIOC_QUERYMENU");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void v4l2_free_ranges(CvCaptureCAM_V4L* capture) {
|
static void v4l2_free_ranges(CvCaptureCAM_V4L* capture) {
|
||||||
int i;
|
int i;
|
||||||
if (capture->v4l2_ctrl_ranges != NULL) {
|
if (capture->v4l2_ctrl_ranges != NULL) {
|
||||||
@ -590,9 +570,6 @@ static void v4l2_scan_controls(CvCaptureCAM_V4L* capture) {
|
|||||||
if(capture->queryctrl.flags & V4L2_CTRL_FLAG_DISABLED) {
|
if(capture->queryctrl.flags & V4L2_CTRL_FLAG_DISABLED) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (capture->queryctrl.type == V4L2_CTRL_TYPE_MENU) {
|
|
||||||
v4l2_scan_controls_enumerate_menu(capture);
|
|
||||||
}
|
|
||||||
if(capture->queryctrl.type != V4L2_CTRL_TYPE_INTEGER &&
|
if(capture->queryctrl.type != V4L2_CTRL_TYPE_INTEGER &&
|
||||||
capture->queryctrl.type != V4L2_CTRL_TYPE_BOOLEAN &&
|
capture->queryctrl.type != V4L2_CTRL_TYPE_BOOLEAN &&
|
||||||
capture->queryctrl.type != V4L2_CTRL_TYPE_MENU) {
|
capture->queryctrl.type != V4L2_CTRL_TYPE_MENU) {
|
||||||
@ -613,9 +590,6 @@ static void v4l2_scan_controls(CvCaptureCAM_V4L* capture) {
|
|||||||
if(capture->queryctrl.flags & V4L2_CTRL_FLAG_DISABLED) {
|
if(capture->queryctrl.flags & V4L2_CTRL_FLAG_DISABLED) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (capture->queryctrl.type == V4L2_CTRL_TYPE_MENU) {
|
|
||||||
v4l2_scan_controls_enumerate_menu(capture);
|
|
||||||
}
|
|
||||||
if(capture->queryctrl.type != V4L2_CTRL_TYPE_INTEGER &&
|
if(capture->queryctrl.type != V4L2_CTRL_TYPE_INTEGER &&
|
||||||
capture->queryctrl.type != V4L2_CTRL_TYPE_BOOLEAN &&
|
capture->queryctrl.type != V4L2_CTRL_TYPE_BOOLEAN &&
|
||||||
capture->queryctrl.type != V4L2_CTRL_TYPE_MENU) {
|
capture->queryctrl.type != V4L2_CTRL_TYPE_MENU) {
|
||||||
@ -637,9 +611,6 @@ static void v4l2_scan_controls(CvCaptureCAM_V4L* capture) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (capture->queryctrl.type == V4L2_CTRL_TYPE_MENU) {
|
|
||||||
v4l2_scan_controls_enumerate_menu(capture);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(capture->queryctrl.type != V4L2_CTRL_TYPE_INTEGER &&
|
if(capture->queryctrl.type != V4L2_CTRL_TYPE_INTEGER &&
|
||||||
capture->queryctrl.type != V4L2_CTRL_TYPE_BOOLEAN &&
|
capture->queryctrl.type != V4L2_CTRL_TYPE_BOOLEAN &&
|
||||||
|
@ -325,7 +325,6 @@ typedef struct CvCaptureCAM_V4L
|
|||||||
struct v4l2_control control;
|
struct v4l2_control control;
|
||||||
enum v4l2_buf_type type;
|
enum v4l2_buf_type type;
|
||||||
struct v4l2_queryctrl queryctrl;
|
struct v4l2_queryctrl queryctrl;
|
||||||
struct v4l2_querymenu querymenu;
|
|
||||||
|
|
||||||
struct timeval timestamp;
|
struct timeval timestamp;
|
||||||
|
|
||||||
@ -641,24 +640,6 @@ static int autosetup_capture_mode_v4l(CvCaptureCAM_V4L* capture)
|
|||||||
|
|
||||||
#ifdef HAVE_CAMV4L2
|
#ifdef HAVE_CAMV4L2
|
||||||
|
|
||||||
static void v4l2_scan_controls_enumerate_menu(CvCaptureCAM_V4L* capture)
|
|
||||||
{
|
|
||||||
// printf (" Menu items:\n");
|
|
||||||
CLEAR (capture->querymenu);
|
|
||||||
capture->querymenu.id = capture->queryctrl.id;
|
|
||||||
for (capture->querymenu.index = capture->queryctrl.minimum;
|
|
||||||
(int)capture->querymenu.index <= capture->queryctrl.maximum;
|
|
||||||
capture->querymenu.index++)
|
|
||||||
{
|
|
||||||
if (0 == ioctl (capture->deviceHandle, VIDIOC_QUERYMENU,
|
|
||||||
&capture->querymenu))
|
|
||||||
{
|
|
||||||
// printf (" %s\n", capture->querymenu.name);
|
|
||||||
} else {
|
|
||||||
perror ("VIDIOC_QUERYMENU");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void v4l2_scan_controls(CvCaptureCAM_V4L* capture)
|
static void v4l2_scan_controls(CvCaptureCAM_V4L* capture)
|
||||||
{
|
{
|
||||||
@ -723,8 +704,6 @@ static void v4l2_scan_controls(CvCaptureCAM_V4L* capture)
|
|||||||
capture->v4l2_exposure_max = capture->queryctrl.maximum;
|
capture->v4l2_exposure_max = capture->queryctrl.maximum;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (capture->queryctrl.type == V4L2_CTRL_TYPE_MENU)
|
|
||||||
v4l2_scan_controls_enumerate_menu(capture);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -793,9 +772,6 @@ static void v4l2_scan_controls(CvCaptureCAM_V4L* capture)
|
|||||||
capture->v4l2_exposure_max = capture->queryctrl.maximum;
|
capture->v4l2_exposure_max = capture->queryctrl.maximum;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (capture->queryctrl.type == V4L2_CTRL_TYPE_MENU)
|
|
||||||
v4l2_scan_controls_enumerate_menu(capture);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (errno == EINVAL)
|
if (errno == EINVAL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user