diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-04-24 20:47:47 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-04-24 20:47:47 +0200 |
commit | 94e3eb4ffe584ad77a13a56d48d06282ad972ba0 (patch) | |
tree | 2a419231db499a210d4cd8847acf4f0bdd95c3bc /tracker-kinect-face/camera_kinect_ir.cpp | |
parent | a424e89c6598f21705ea0fba68aa20e6dc766e01 (diff) |
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) |