[libcamera-devel,2/7] libcamera: camera_sensor: Set sensor model property

Message ID 20200806130937.2991606-3-niklas.soderlund@ragnatech.se
State Accepted
Headers show
Series
  • libcamera: Allow for user-friendly names in applications
Related show

Commit Message

Niklas Söderlund Aug. 6, 2020, 1:09 p.m. UTC
Set the sensor model property.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 src/libcamera/camera_sensor.cpp | 2 ++
 1 file changed, 2 insertions(+)

Comments

Laurent Pinchart Aug. 8, 2020, 8:20 p.m. UTC | #1
Hi Niklas,

Thank you for the patch.

On Thu, Aug 06, 2020 at 03:09:32PM +0200, Niklas Söderlund wrote:
> Set the sensor model property.

Patch 1/7 documents a camera model property, while this is a sensor
model. All this needs to be clarified. Same for patch 4/7.

> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> ---
>  src/libcamera/camera_sensor.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
> index d2679a4b80ce0d42..731ccf29de0ad442 100644
> --- a/src/libcamera/camera_sensor.cpp
> +++ b/src/libcamera/camera_sensor.cpp
> @@ -200,6 +200,8 @@ int CameraSensor::init()
>  	else
>  		model_ = entityName;
>  
> +	properties_.set(properties::Model, model_);
> +
>  	/* Create and open the subdev. */
>  	subdev_ = std::make_unique<V4L2Subdevice>(entity_);
>  	int ret = subdev_->open();
Niklas Söderlund Aug. 8, 2020, 9:02 p.m. UTC | #2
Hi Laurent,

Thanks for your feedback.

On 2020-08-08 23:20:25 +0300, Laurent Pinchart wrote:
> Hi Niklas,
> 
> Thank you for the patch.
> 
> On Thu, Aug 06, 2020 at 03:09:32PM +0200, Niklas Söderlund wrote:
> > Set the sensor model property.
> 
> Patch 1/7 documents a camera model property, while this is a sensor
> model. All this needs to be clarified. Same for patch 4/7.

We already do this with Location and Rotation, what makes Model 
different?

> 
> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> > ---
> >  src/libcamera/camera_sensor.cpp | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
> > index d2679a4b80ce0d42..731ccf29de0ad442 100644
> > --- a/src/libcamera/camera_sensor.cpp
> > +++ b/src/libcamera/camera_sensor.cpp
> > @@ -200,6 +200,8 @@ int CameraSensor::init()
> >  	else
> >  		model_ = entityName;
> >  
> > +	properties_.set(properties::Model, model_);
> > +
> >  	/* Create and open the subdev. */
> >  	subdev_ = std::make_unique<V4L2Subdevice>(entity_);
> >  	int ret = subdev_->open();
> 
> -- 
> Regards,
> 
> Laurent Pinchart
Laurent Pinchart Aug. 8, 2020, 9:26 p.m. UTC | #3
Hi Niklas,

On Sat, Aug 08, 2020 at 11:02:16PM +0200, Niklas Söderlund wrote:
> On 2020-08-08 23:20:25 +0300, Laurent Pinchart wrote:
> > On Thu, Aug 06, 2020 at 03:09:32PM +0200, Niklas Söderlund wrote:
> > > Set the sensor model property.
> > 
> > Patch 1/7 documents a camera model property, while this is a sensor
> > model. All this needs to be clarified. Same for patch 4/7.
> 
> We already do this with Location and Rotation, what makes Model 
> different?

The fact that they have more extensive documentation :-) The only
documentation of the Model property is "Camera model name". That's
pretty terse to know if this patch is right or not.

> > > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> > > ---
> > >  src/libcamera/camera_sensor.cpp | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
> > > index d2679a4b80ce0d42..731ccf29de0ad442 100644
> > > --- a/src/libcamera/camera_sensor.cpp
> > > +++ b/src/libcamera/camera_sensor.cpp
> > > @@ -200,6 +200,8 @@ int CameraSensor::init()
> > >  	else
> > >  		model_ = entityName;
> > >  
> > > +	properties_.set(properties::Model, model_);
> > > +
> > >  	/* Create and open the subdev. */
> > >  	subdev_ = std::make_unique<V4L2Subdevice>(entity_);
> > >  	int ret = subdev_->open();

Patch

diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index d2679a4b80ce0d42..731ccf29de0ad442 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -200,6 +200,8 @@  int CameraSensor::init()
 	else
 		model_ = entityName;
 
+	properties_.set(properties::Model, model_);
+
 	/* Create and open the subdev. */
 	subdev_ = std::make_unique<V4L2Subdevice>(entity_);
 	int ret = subdev_->open();