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

Message ID 20210319130120.141563-4-jacopo@jmondi.org
State Accepted
Headers show
Series
  • libcamera: Do not default the location property
Related show

Commit Message

Jacopo Mondi March 19, 2021, 1:01 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.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/android/camera_device.cpp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Paul Elder March 22, 2021, 5:55 a.m. UTC | #1
Hi Jacopo,

On Fri, Mar 19, 2021 at 02:01:20PM +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.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  src/android/camera_device.cpp | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index a81e3c905d6c..72a89258386d 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -376,13 +376,15 @@ 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;
>  		}
> +	} else {
> +		/*
> +		 * \todo Retrieve the camera location from configuration file
> +		 * if not available from the library.
> +		 */
> +		facing_ = CAMERA_FACING_FRONT;
>  	}
>  
>  	/*
> -- 
> 2.30.0
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch
diff mbox series

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index a81e3c905d6c..72a89258386d 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -376,13 +376,15 @@  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;
 		}
+	} else {
+		/*
+		 * \todo Retrieve the camera location from configuration file
+		 * if not available from the library.
+		 */
+		facing_ = CAMERA_FACING_FRONT;
 	}
 
 	/*