From fa5c8233428c4e0096331e2702a03cfd7ae1c18e Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Thu, 20 Feb 2020 15:33:43 +0200
Subject: [PATCH] Allow camera device selection

---
 components/rgbd-sources/src/sources/stereovideo/local.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/components/rgbd-sources/src/sources/stereovideo/local.cpp b/components/rgbd-sources/src/sources/stereovideo/local.cpp
index c46369c53..dd1b10138 100644
--- a/components/rgbd-sources/src/sources/stereovideo/local.cpp
+++ b/components/rgbd-sources/src/sources/stereovideo/local.cpp
@@ -33,14 +33,16 @@ LocalSource::LocalSource(nlohmann::json &config)
 		: Configurable(config), timestamp_(0.0) {
 
 	nostereo_ = value("nostereo", false);
+	int device_left = value("device_left", 0);
+	int device_right = value("device_right", 1);
 
 	// Use cameras
 	camera_a_ = new VideoCapture;
 	LOG(INFO) << "Cameras check... ";
-	camera_a_->open(0);
+	camera_a_->open(device_left);
 
 	if (!nostereo_) {
-		camera_b_ = new VideoCapture(1);
+		camera_b_ = new VideoCapture(device_right);
 	} else {
 		camera_b_ = nullptr;
 	}
-- 
GitLab