diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-04-26 18:39:41 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-04-26 18:39:41 +0200 |
commit | 248bd81caceb21e3e278e340388425b9f102c34c (patch) | |
tree | f1bb44973778a037f3c44b57b6e0f811e3f9a319 | |
parent | 7a1a0b92b3322ec9a1fb9ae6dfb8ac0770b18a59 (diff) |
tracker/kinect: fix ir camera provider
-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. |