From e0704e97ea8907b13c769e0d2958829f94e65a96 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 7 Jul 2021 03:45:05 +0300 Subject: cam: Support using multiple cameras concurrently To allow testing capture from multiple cameras concurrently, turn the --camera option into an array option, and create one CameraSession per specified camera. The code is adapted to iterate over the sessions vector instead of handling a single session. Thanks to all the refactoring previously performed, changes are minimal. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/cam/camera_session.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/cam/camera_session.cpp') diff --git a/src/cam/camera_session.cpp b/src/cam/camera_session.cpp index 90261a8c..0d49fc1a 100644 --- a/src/cam/camera_session.cpp +++ b/src/cam/camera_session.cpp @@ -250,9 +250,13 @@ int CameraSession::startCapture() } if (captureLimit_) - std::cout << "Capture " << captureLimit_ << " frames" << std::endl; + std::cout << "cam" << cameraIndex_ + << ": Capture " << captureLimit_ << " frames" + << std::endl; else - std::cout << "Capture until user interrupts by SIGINT" << std::endl; + std::cout << "cam" << cameraIndex_ + << ": Capture until user interrupts by SIGINT" + << std::endl; return 0; } -- cgit v1.2.1