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

Niklas Söderlund niklas.soderlund at ragnatech.se
Fri Jan 8 16:28:54 CET 2021


Hi Jacopo,

Thanks for your feedback.

On 2020-12-17 15:12:16 +0100, Jacopo Mondi wrote:
> 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

I thin device is 'nicer' as what it does is retrieve the device which 
represents the sensor. That being said I don't feel strongly about it.  
And hopefully we can remove this method in the future and not expose it 
outside CameraSensor. This is only needed until we decide how to best 
integrate DelayedControls inside CameraSensro.

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

Thanks.

> 
> 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

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list