From 94e3eb4ffe584ad77a13a56d48d06282ad972ba0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 24 Apr 2019 20:47:47 +0200 Subject: video/kinect: don't list when device not present --- tracker-kinect-face/camera_kinect_ir.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tracker-kinect-face/camera_kinect_ir.cpp') 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 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) -- cgit v1.2.3