[libcamera-devel,v3,4/5] android: camera_device: Add a getter to get libcamera::Camera pointer

Message ID 20200817202629.4277-5-email@uajain.com
State Accepted
Headers show
Series
  • android: Camera hotplug support
Related show

Commit Message

Umang Jain Aug. 17, 2020, 8:26 p.m. UTC
Add a public member function to get the libcamera::Camera pointer
associated with the CameraDevice. This will help to find the CameraDevice
object in CameraHalManager when the hotplug support is extended in the
android layer.

Signed-off-by: Umang Jain <email@uajain.com>
---
 src/android/camera_device.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart Aug. 19, 2020, 2:42 p.m. UTC | #1
Hi Umang,

Thank you for the patch.

On Mon, Aug 17, 2020 at 08:26:40PM +0000, Umang Jain wrote:
> Add a public member function to get the libcamera::Camera pointer
> associated with the CameraDevice. This will help to find the CameraDevice
> object in CameraHalManager when the hotplug support is extended in the
> android layer.

s/android/Android/

> Signed-off-by: Umang Jain <email@uajain.com>
> ---
>  src/android/camera_device.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/android/camera_device.h b/src/android/camera_device.h
> index b149043..7908bc0 100644
> --- a/src/android/camera_device.h
> +++ b/src/android/camera_device.h
> @@ -57,6 +57,7 @@ public:
>  
>  	unsigned int id() const { return id_; }
>  	camera3_device_t *camera3Device() { return &camera3Device_; }
> +	const libcamera::Camera *camera() { return camera_.get(); }

You can make this a const method

	const libcamera::Camera *camera() const { return camera_.get(); }

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

>  
>  	int facing() const { return facing_; }
>  	int orientation() const { return orientation_; }
Niklas Söderlund Aug. 20, 2020, 7:30 a.m. UTC | #2
Hi Umang,

Thanks for your work.

On 2020-08-17 20:26:40 +0000, Umang Jain wrote:
> Add a public member function to get the libcamera::Camera pointer
> associated with the CameraDevice. This will help to find the CameraDevice
> object in CameraHalManager when the hotplug support is extended in the
> android layer.
> 
> Signed-off-by: Umang Jain <email@uajain.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/android/camera_device.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/android/camera_device.h b/src/android/camera_device.h
> index b149043..7908bc0 100644
> --- a/src/android/camera_device.h
> +++ b/src/android/camera_device.h
> @@ -57,6 +57,7 @@ public:
>  
>  	unsigned int id() const { return id_; }
>  	camera3_device_t *camera3Device() { return &camera3Device_; }
> +	const libcamera::Camera *camera() { return camera_.get(); }
>  
>  	int facing() const { return facing_; }
>  	int orientation() const { return orientation_; }
> -- 
> 2.26.2
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/android/camera_device.h b/src/android/camera_device.h
index b149043..7908bc0 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -57,6 +57,7 @@  public:
 
 	unsigned int id() const { return id_; }
 	camera3_device_t *camera3Device() { return &camera3Device_; }
+	const libcamera::Camera *camera() { return camera_.get(); }
 
 	int facing() const { return facing_; }
 	int orientation() const { return orientation_; }