[libcamera-devel] [PATCH 10/10] DO NOT MERGE: Reports camera properties in cam

Jacopo Mondi jacopo at jmondi.org
Wed Dec 4 14:21:06 CET 2019


Running cam -l lists the camera properties registered by the pipeline
handler.

In example, for the VIMC pipelinehandler:

Available cameras:
1: Integrated Camera: Integrated C
2: VIMC Sensor B
Rotation: 0
Location: 0

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/cam/main.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/cam/main.cpp b/src/cam/main.cpp
index a38cca959aca..8d37754773af 100644
--- a/src/cam/main.cpp
+++ b/src/cam/main.cpp
@@ -11,6 +11,7 @@
 #include <string.h>
 
 #include <libcamera/libcamera.h>
+#include <libcamera/property_ids.h>
 
 #include "capture.h"
 #include "event_loop.h"
@@ -309,6 +310,16 @@ int CamApp::run()
 		for (const std::shared_ptr<Camera> &cam : cm_->cameras()) {
 			std::cout << index << ": " << cam->name() << std::endl;
 			index++;
+
+			const ControlList &properties = cam->properties();
+			for (const auto &prop : properties) {
+				auto it = properties::properties.find(prop.first);
+				if (it == properties::properties.end())
+					continue;
+
+				std::cout << it->second->name() << ": " <<
+					prop.second.get<int32_t>() << "\n";
+			}
 		}
 	}
 
-- 
2.23.0



More information about the libcamera-devel mailing list