diff options
author | Stanislaw Halik <sthalik@tehran.lain.pl> | 2019-04-25 12:52:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-25 12:52:09 +0000 |
commit | d243571221aad5fcadbe1842e8a89b520a2b01fe (patch) | |
tree | c7f6d2af3e928dde6a570afbdb6f9eaa3fe34933 /tracker-kinect-face/camera_kinect_ir.cpp | |
parent | 145b8cd856592322b13edcc7f7ac2690415425bc (diff) | |
parent | 94e3eb4ffe584ad77a13a56d48d06282ad972ba0 (diff) |
Merge pull request #934 from opentrack/pr/kinect-detection
video/kinect: don't list when device not present
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 b881d51f..4d442bf2 100644 --- a/tracker-kinect-face/camera_kinect_ir.cpp +++ b/tracker-kinect-face/camera_kinect_ir.cpp @@ -36,7 +36,12 @@ namespace Kinect { std::vector<QString> CamerasProvider::camera_names() const { - return { KKinectIRSensor }; + IKinectSensor* ptr; + BOOLEAN b; + if (SUCCEEDED(GetDefaultKinectSensor(&ptr)) && SUCCEEDED(ptr->get_IsAvailable(&b)) && b) + return { KKinectIRSensor }; + else + return {}; } bool CamerasProvider::can_show_dialog(const QString& camera_name) |