[libcamera-devel] [PATCH v8 5/9] libcamera: camera_sensor: Add accessors for sensor ID
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Wed Aug 5 14:50:36 CEST 2020
Hi Niklas,
Thank you for the patch.
On Wed, Aug 05, 2020 at 12:48:56PM +0200, Niklas Söderlund wrote:
> Add an accessors so that the sensor ID can be used outside CameraSensor.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
> ---
> include/libcamera/internal/camera_sensor.h | 1 +
> src/libcamera/camera_sensor.cpp | 10 ++++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h
> index 0f65fca46877e89a..b9eba89f00fba882 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 695c4ad0028d5c4c..2c2db051f8e264c7 100644
> --- a/src/libcamera/camera_sensor.cpp
> +++ b/src/libcamera/camera_sensor.cpp
> @@ -291,6 +291,16 @@ int CameraSensor::init()
> * \return The sensor model name
> */
>
> +/**
> + * \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 satisfy the requirements to be used as a camera ID.
s/satisfy/satisfies/
> + *
> + * \return The sensor ID
> + */
> +
> /**
> * \fn CameraSensor::entity()
> * \brief Retrieve the sensor media entity
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list