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

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Feb 11 22:46:06 CET 2021


Hi Paul,

Thank you for the patch.

On Thu, Feb 11, 2021 at 01:53:38PM +0000, Kieran Bingham wrote:
> 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.

Git history or comment in the code both work for me in this case.

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

> Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> 
> > +		case properties::CameraLocationUnknown:
> > +			facing_ = CAMERA_FACING_FRONT;
> > +			break;
> >  		}
> >  	}
> >  

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list