summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-08-04 17:50:11 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-08-05 20:07:13 +0200
commit082a5b2dfe43d2b325a7ea470e46ee2f1f560993 (patch)
tree24f5b748cbae105b45b4a9bb27fa7bda5e9ab1a6
parentf23e6127ad073a99d4374929f95aac9d3f24dba8 (diff)
libcamera: camera_sensor: Add accessors for sensor ID
Add an accessors so that the sensor ID can be used outside CameraSensor. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--include/libcamera/internal/camera_sensor.h1
-rw-r--r--src/libcamera/camera_sensor.cpp10
2 files changed, 11 insertions, 0 deletions
diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h
index 0f65fca4..b9eba89f 100644
--- a/include/libcamera/internal/camera_sensor.h
+++ b/include/libcamera/internal/camera_sensor.h
@@ -47,6 +47,7 @@ public:
int init();
const std::string &model() const { return model_; }
+ const std::string &id() const { return id_; }
const MediaEntity *entity() const { return entity_; }
const std::vector<unsigned int> &mbusCodes() const { return mbusCodes_; }
const std::vector<Size> &sizes() const { return sizes_; }
diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 79b2bc40..d2679a4b 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -291,6 +291,16 @@ int CameraSensor::init()
*/
/**
+ * \fn CameraSensor::id()
+ * \brief Retrieve the sensor ID
+ *
+ * The sensor ID is a free-form string that uniquely identifies the sensor in
+ * the system. The ID satisfies the requirements to be used as a camera ID.
+ *
+ * \return The sensor ID
+ */
+
+/**
* \fn CameraSensor::entity()
* \brief Retrieve the sensor media entity
* \return The sensor media entity