[libcamera-devel] [PATCH 3/3] android: camera_device: Default the camera location to Front

Kieran Bingham kieran.bingham at ideasonboard.com
Thu Feb 11 14:53:38 CET 2021


Hi Paul,

On 11/02/2021 08:55, Paul Elder wrote:
> Since the libcamera camera now has an Unknown location, we can know if
> the camera's location is actually unknown. In this case, set the android
> camera location to front, as some systems may not support external
> cameras.
> 
> This allows the following CTS test to pass:
> - android.hardware.camera2.cts.CameraManagerTest#testCameraManagerGetDeviceIdList
> 
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> ---
>  src/android/camera_device.cpp | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index 1e2a5b5f..3d815d21 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -407,6 +407,9 @@ int CameraDevice::initialize()
>  		case properties::CameraLocationExternal:
>  			facing_ = CAMERA_FACING_EXTERNAL;
>  			break;

This 'might' be worth an explanation to say why we chose 'FRONT'
specifically here, but that will be in the git history too.

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

> +		case properties::CameraLocationUnknown:
> +			facing_ = CAMERA_FACING_FRONT;
> +			break;
>  		}
>  	}
>  
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list