[libcamera-devel] [PATCH 2/3] libcamera: camera_sensor: Set default sensor location to Unknown

Niklas Söderlund niklas.soderlund at ragnatech.se
Thu Feb 11 14:24:19 CET 2021


Hi Paul,

Thanks for your work.

On 2021-02-11 17:55:26 +0900, Paul Elder wrote:
> Instead of choosing some arbitrary location for the sensor when its
> location is unknown, set it explicitly to unknown.
> 
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> ---
>  src/libcamera/camera_sensor.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
> index c9e8d49b..474055ba 100644
> --- a/src/libcamera/camera_sensor.cpp
> +++ b/src/libcamera/camera_sensor.cpp
> @@ -446,7 +446,7 @@ int CameraSensor::initProperties()
>  			break;
>  		}
>  	} else {
> -		propertyValue = properties::CameraLocationExternal;
> +		propertyValue = properties::CameraLocationUnknown;

I wonder if it would not make more sens to just set the location to 
front here? What additional use-case do we cover by adding the unkown 
location?

If we want to highlight we don't know where a camera is would it not be 
better to LOG() that we don't know but assume front. I'm thinking from 
an application point of view is it not kind of messy to have to deal 
with a firmware description that is incomplete? I guess all users will 
do what you do in this series for the HAL and default it to something 
else.

If you do opt to keep the addition of CameraLocationUnknown you should 
also update cam utility to handle the new location value.

>  	}
>  	properties_.set(properties::Location, propertyValue);
>  
> -- 
> 2.27.0
> 
> _______________________________________________
> 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