28 lines
1.4 KiB
Diff
28 lines
1.4 KiB
Diff
|
diff -uprN opencv-3.3.1/modules/videoio/src/cap_v4l.cpp opencv-3.3_csi/modules/videoio/src/cap_v4l.cpp
|
||
|
--- opencv-3.3.1/modules/videoio/src/cap_v4l.cpp 2017-10-23 23:41:12.000000000 +0800
|
||
|
+++ opencv-3.3_csi/modules/videoio/src/cap_v4l.cpp 2018-01-08 17:36:53.120761322 +0800
|
||
|
@@ -439,11 +439,11 @@ static int try_init_v4l2(CvCaptureCAM_V4
|
||
|
|
||
|
/* Query information about current input */
|
||
|
capture->inp = v4l2_input();
|
||
|
- capture->inp.index = deviceIndex;
|
||
|
- if (-1 == ioctl (capture->deviceHandle, VIDIOC_ENUMINPUT, &capture->inp))
|
||
|
+ capture->inp.index = 0;
|
||
|
+ if (-1 == ioctl (capture->deviceHandle, VIDIOC_S_INPUT, &capture->inp))
|
||
|
{
|
||
|
#ifndef NDEBUG
|
||
|
- fprintf(stderr, "(DEBUG) try_init_v4l2 VIDIOC_ENUMINPUT \"%s\": %s\n", deviceName, strerror(errno));
|
||
|
+ fprintf(stderr, "(DEBUG) try_init_v4l2 VIDIOC_S_INPUT \"%s\": %s\n", deviceName, strerror(errno));
|
||
|
#endif
|
||
|
icvCloseCAM_V4L(capture);
|
||
|
return 0;
|
||
|
@@ -646,7 +646,7 @@ static int _capture_V4L2 (CvCaptureCAM_V
|
||
|
capture->inp.index = CHANNEL_NUMBER;
|
||
|
/* Set only channel number to CHANNEL_NUMBER */
|
||
|
/* V4L2 have a status field from selected video mode */
|
||
|
- if (-1 == ioctl (capture->deviceHandle, VIDIOC_ENUMINPUT, &capture->inp))
|
||
|
+ if (-1 == ioctl (capture->deviceHandle, VIDIOC_S_INPUT, &capture->inp))
|
||
|
{
|
||
|
fprintf (stderr, "VIDEOIO ERROR: V4L2: Aren't able to set channel number\n");
|
||
|
icvCloseCAM_V4L (capture);
|