[libcamera-devel] [PATCH v3 5/6] libcamera: camera_sensor: Do not default 'rotation'

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Dec 30 21:15:40 CET 2020


Hi Jacopo,

Thank you for the patch.

On Wed, Dec 30, 2020 at 07:01:19PM +0100, Jacopo Mondi wrote:
> The 'rotation' property is not critical. Only register if the

s/register/register it/

> sensor driver reports it.
> 
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  src/libcamera/camera_sensor.cpp | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
> index 1a316da45511..f7b20b396914 100644
> --- a/src/libcamera/camera_sensor.cpp
> +++ b/src/libcamera/camera_sensor.cpp
> @@ -379,16 +379,11 @@ int CameraSensor::initProperties()
>  	}
>  	properties_.set(properties::Location, propertyValue);
>  
> -	/* Camera Rotation: default is 0 degrees. */
>  	const auto &rotationControl = controls.find(V4L2_CID_CAMERA_SENSOR_ROTATION);
>  	if (rotationControl != controls.end()) {
>  		propertyValue = rotationControl->second.def().get<int32_t>();
> -	} else {
> -		propertyValue = 0;
> -		LOG(CameraSensor, Debug)
> -			<< "Rotation property defaulted to 0 degrees";
> +		properties_.set(properties::Rotation, propertyValue);
>  	}
> -	properties_.set(properties::Rotation, propertyValue);
>  
>  	properties_.set(properties::PixelArraySize, pixelArraySize_);
>  	properties_.set(properties::PixelArrayActiveAreas, { activeAreaSize_ });

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list