diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-04-26 18:39:41 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-04-28 07:45:03 +0200 |
commit | a1b9cb908948375ec0cfd31b34c978b3ad842a29 (patch) | |
tree | a1c0b1d9a5a25269151ca760c2a26fcd460fece5 /tracker-kinect-face/camera_kinect_ir.cpp | |
parent | 537c5e0c082ba969ab9fc83a0104fbd90e3c7ce6 (diff) |
tracker/kinect: fix camera provider
Issue: #1461
Diffstat (limited to 'tracker-kinect-face/camera_kinect_ir.cpp')
-rw-r--r-- | tracker-kinect-face/camera_kinect_ir.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tracker-kinect-face/camera_kinect_ir.cpp b/tracker-kinect-face/camera_kinect_ir.cpp index e1ef2208..3a33fd14 100644 --- a/tracker-kinect-face/camera_kinect_ir.cpp +++ b/tracker-kinect-face/camera_kinect_ir.cpp @@ -48,7 +48,12 @@ namespace Kinect { std::vector<QString> CamerasProvider::camera_names() const { - if (camera_name_to_index("Kinect V2 Video Sensor") != -1) + auto list = get_camera_names(); + auto it = std::find_if(list.cbegin(), list.cend(), [](const auto& x) { + const auto& [name, idx] = x; + return name.startsWith("Kinect V2 Video Sensor ["); + }); + if (it != list.cend()) { // We found Kinect V2 Video Sensor therefore we have a kinect V2 connected. // Publish our Kinect V2 IR Sensor implementation then. |