From 04a72110203d70338849e47a24b12d6b13fdfed6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 19 Jul 2015 13:31:22 +0200 Subject: camera names on linux work, finally --- opentrack/camera-names.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'opentrack/camera-names.hpp') diff --git a/opentrack/camera-names.hpp b/opentrack/camera-names.hpp index ee6d8ceb..fd869e6b 100644 --- a/opentrack/camera-names.hpp +++ b/opentrack/camera-names.hpp @@ -16,7 +16,8 @@ #ifdef __linux #include #include -#include +#include +#include #endif template @@ -89,13 +90,14 @@ QList get_camera_names() { int fd = open(buf, O_RDONLY); if (fd == -1) continue; - struct video_capability video_cap; - if(ioctl(fd, VIDIOCGCAP, &video_cap) == -1) + struct v4l2_capability video_cap; + if(ioctl(fd, VIDIOC_QUERYCAP, &video_cap) == -1) { + qDebug() << "VIDIOC_QUERYCAP" << errno; close(fd); continue; } - ret[ret.size()-1] = video_cap.name; + ret[ret.size()-1] = reinterpret_cast(video_cap.card); close(fd); } } -- cgit v1.2.3