[libcamera-devel,v5,12/19] libcamera: ipu3: cio2: Add a const sensor() method

Message ID 20200731153320.58107-13-jacopo@jmondi.org
State Accepted
Headers show
Series
  • [libcamera-devel,v5,01/19] libcamera: ipu3: Rename mbusCodesToInfo
Related show

Commit Message

Jacopo Mondi July 31, 2020, 3:33 p.m. UTC
Add a const version of the CIO2Device::sensor() method, that retrieves
a const pointer to the sensor_ class member, to be called by users
which only own a const reference to a CIO2Device class instance.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/pipeline/ipu3/cio2.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Niklas Söderlund Aug. 1, 2020, 8:44 a.m. UTC | #1
Hi Jacopo,

Thanks for your work.

On 2020-07-31 17:33:13 +0200, Jacopo Mondi wrote:
> Add a const version of the CIO2Device::sensor() method, that retrieves
> a const pointer to the sensor_ class member, to be called by users
> which only own a const reference to a CIO2Device class instance.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

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

> ---
>  src/libcamera/pipeline/ipu3/cio2.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h
> index 221cf817eee9..fa813a989fd2 100644
> --- a/src/libcamera/pipeline/ipu3/cio2.h
> +++ b/src/libcamera/pipeline/ipu3/cio2.h
> @@ -50,6 +50,7 @@ public:
>  	int stop();
>  
>  	CameraSensor *sensor() { return sensor_; }
> +	const CameraSensor *sensor() const { return sensor_; }
>  
>  	int queueBuffer(Request *request, FrameBuffer *rawBuffer);
>  	void tryReturnBuffer(FrameBuffer *buffer);
> -- 
> 2.27.0
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h
index 221cf817eee9..fa813a989fd2 100644
--- a/src/libcamera/pipeline/ipu3/cio2.h
+++ b/src/libcamera/pipeline/ipu3/cio2.h
@@ -50,6 +50,7 @@  public:
 	int stop();
 
 	CameraSensor *sensor() { return sensor_; }
+	const CameraSensor *sensor() const { return sensor_; }
 
 	int queueBuffer(Request *request, FrameBuffer *rawBuffer);
 	void tryReturnBuffer(FrameBuffer *buffer);