From 2e7c80a4f9d4f50a82c674863ce159856c748873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Sun, 2 Aug 2020 23:57:17 +0200 Subject: libcamera: camera: Rename name() to id() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename Camera::name() to camera::id() to better describe what it represents, a unique and stable ID for the camera. While at it improve the documentation for the camera ID to describe it needs to be stable for a camera between resets of the system. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/cam/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/cam') diff --git a/src/cam/main.cpp b/src/cam/main.cpp index 6761d638..fb7bcbd9 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -117,7 +117,7 @@ int CamApp::init(int argc, char **argv) return -EINVAL; } - std::cout << "Using camera " << camera_->name() << std::endl; + std::cout << "Using camera " << camera_->id() << std::endl; ret = prepareConfig(); if (ret) { @@ -174,7 +174,7 @@ int CamApp::parseOptions(int argc, char *argv[]) OptionsParser parser; parser.addOption(OptCamera, OptionString, - "Specify which camera to operate on, by name or by index", "camera", + "Specify which camera to operate on, by id or by index", "camera", ArgumentRequired, "camera"); parser.addOption(OptCapture, OptionInteger, "Capture until interrupted by user or until frames captured", @@ -323,12 +323,12 @@ int CamApp::infoConfiguration() void CamApp::cameraAdded(std::shared_ptr cam) { - std::cout << "Camera Added: " << cam->name() << std::endl; + std::cout << "Camera Added: " << cam->id() << std::endl; } void CamApp::cameraRemoved(std::shared_ptr cam) { - std::cout << "Camera Removed: " << cam->name() << std::endl; + std::cout << "Camera Removed: " << cam->id() << std::endl; } int CamApp::run() @@ -340,7 +340,7 @@ int CamApp::run() unsigned int index = 1; for (const std::shared_ptr &cam : cm_->cameras()) { - std::cout << index << ": " << cam->name() << std::endl; + std::cout << index << ": " << cam->id() << std::endl; index++; } } -- cgit v1.2.1