summaryrefslogtreecommitdiffstats
path: root/src/gsttools
diff options
context:
space:
mode:
authorVaL Doroshchuk <valentyn.doroshchuk@qt.io>2017-10-02 14:45:04 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2017-10-09 08:57:24 +0000
commit09b41d0cfb09c01f9325ab0a65fa607c6537a5c6 (patch)
tree1d90103282694c4a866e2a67a7770bc0395f9351 /src/gsttools
parent78f66535da77348499a20d642f1845329869f58a (diff)
GStreamer: Fix V4L input query
The last ioctl argument expect a pointer to an integer, not the integer value itself. Also, the ioctl call will return 0 on success, or ENOTTY if the input can't be select, both indicating that the device is a camera. Task-number: QTBUG-62245 Change-Id: Ifcf2d30b11ae204036b43daae664f917aaed83ed Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/gsttools')
-rw-r--r--src/gsttools/qgstutils.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gsttools/qgstutils.cpp b/src/gsttools/qgstutils.cpp
index 96bd09f86..06181403e 100644
--- a/src/gsttools/qgstutils.cpp
+++ b/src/gsttools/qgstutils.cpp
@@ -642,7 +642,8 @@ QVector<QGstUtils::CameraInfo> QGstUtils::enumerateCameras(GstElementFactory *fa
memset(&input, 0, sizeof(input));
for (; ::ioctl(fd, VIDIOC_ENUMINPUT, &input) >= 0; ++input.index) {
if (input.type == V4L2_INPUT_TYPE_CAMERA || input.type == 0) {
- isCamera = ::ioctl(fd, VIDIOC_S_INPUT, input.index) != 0;
+ const int ret = ::ioctl(fd, VIDIOC_S_INPUT, &input.index);
+ isCamera = (ret == 0 || errno == ENOTTY);
break;
}
}