summaryrefslogtreecommitdiffhomepage
path: root/tracker-kinect-face/camera_kinect_ir.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-04-24 20:47:47 +0200
committerStanislaw Halik <sthalik@misaki.pl>2019-04-24 20:47:47 +0200
commit94e3eb4ffe584ad77a13a56d48d06282ad972ba0 (patch)
tree2a419231db499a210d4cd8847acf4f0bdd95c3bc /tracker-kinect-face/camera_kinect_ir.cpp
parenta424e89c6598f21705ea0fba68aa20e6dc766e01 (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.cpp7
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)