[libcamera-devel] [PATCH v4 5/8] libcamera: camera_sensor: Expose the camera device

Jacopo Mondi jacopo at jmondi.org
Thu Dec 17 15:12:16 CET 2020


On Tue, Dec 15, 2020 at 01:48:08AM +0100, Niklas Söderlund wrote:
> Expose the device backing the CameraSensor instance.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> * Changes since v3
> - New, needed to be able to move the DelayedControls handling out of
>   CameraSensor.
> ---
>  include/libcamera/internal/camera_sensor.h | 2 ++
>  src/libcamera/camera_sensor.cpp            | 6 ++++++
>  2 files changed, 8 insertions(+)
>
> diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h
> index f80d836161a564e7..a70e024aa327f69b 100644
> --- a/include/libcamera/internal/camera_sensor.h
> +++ b/include/libcamera/internal/camera_sensor.h
> @@ -61,6 +61,8 @@ public:
>  	ControlList getControls(const std::vector<uint32_t> &ids);
>  	int setControls(ControlList *ctrls);
>
> +	V4L2Subdevice *device() { return subdev_.get(); }
> +
>  	const ControlList &properties() const { return properties_; }
>  	int sensorInfo(CameraSensorInfo *info) const;
>
> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
> index 1628ba9c892b0eaf..df45b2b803617bfd 100644
> --- a/src/libcamera/camera_sensor.cpp
> +++ b/src/libcamera/camera_sensor.cpp
> @@ -486,6 +486,12 @@ ControlList CameraSensor::getControls(const std::vector<uint32_t> &ids)
>  	return subdev_->getControls(ids);
>  }
>
> +/**
> + * \fn CameraSensor::device()
> + * \brief Retrieve the camera sensor device
> + * \return The camera sensor device
> + */
> +

I wonder if subdevice() would be better.
A minor though

Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>

Thanks
  j

>  /**
>   * \fn CameraSensor::properties()
>   * \brief Retrieve the camera sensor properties
> --
> 2.29.2
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel


More information about the libcamera-devel mailing list