[libcamera-devel,2/2] android: camera_device: Do not default External to Front
diff mbox series

Message ID 20210318125521.43278-3-jacopo@jmondi.org
State Superseded
Headers show
Series
  • libcamera: Do not default the location property
Related show

Commit Message

Jacopo Mondi March 18, 2021, 12:55 p.m. UTC
Now that the camera location is not defaulted anymore in the library but
doesn't get registered if the firmware interface does not provide the
information, do not default it to FRONT if LocationExternal is reported.

To maintain compatibility with CTS requirements, default location to
FRONT only if the camera property is not available.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/android/camera_device.cpp | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Laurent Pinchart March 19, 2021, 12:08 a.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Thu, Mar 18, 2021 at 01:55:21PM +0100, Jacopo Mondi wrote:
> Now that the camera location is not defaulted anymore in the library but
> doesn't get registered if the firmware interface does not provide the
> information, do not default it to FRONT if LocationExternal is reported.
> 
> To maintain compatibility with CTS requirements, default location to
> FRONT only if the camera property is not available.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

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

> ---
>  src/android/camera_device.cpp | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index a81e3c905d6c..a65b978ffc32 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -376,11 +376,7 @@ int CameraDevice::initialize()
>  			facing_ = CAMERA_FACING_BACK;
>  			break;
>  		case properties::CameraLocationExternal:
> -			/*
> -			 * \todo Set this to EXTERNAL once we support
> -			 * HARDWARE_LEVEL_EXTERNAL
> -			 */
> -			facing_ = CAMERA_FACING_FRONT;
> +			facing_ = CAMERA_FACING_EXTERNAL;
>  			break;
>  		}
>  	}

Patch
diff mbox series

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index a81e3c905d6c..a65b978ffc32 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -376,11 +376,7 @@  int CameraDevice::initialize()
 			facing_ = CAMERA_FACING_BACK;
 			break;
 		case properties::CameraLocationExternal:
-			/*
-			 * \todo Set this to EXTERNAL once we support
-			 * HARDWARE_LEVEL_EXTERNAL
-			 */
-			facing_ = CAMERA_FACING_FRONT;
+			facing_ = CAMERA_FACING_EXTERNAL;
 			break;
 		}
 	}