summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@tehran.lain.pl>2019-04-25 12:52:09 +0000
committerGitHub <noreply@github.com>2019-04-25 12:52:09 +0000
commitd243571221aad5fcadbe1842e8a89b520a2b01fe (patch)
treec7f6d2af3e928dde6a570afbdb6f9eaa3fe34933
parent145b8cd856592322b13edcc7f7ac2690415425bc (diff)
parent94e3eb4ffe584ad77a13a56d48d06282ad972ba0 (diff)
Merge pull request #934 from opentrack/pr/kinect-detection
video/kinect: don't list when device not present
-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)