[v3,13/17] camera: Add a const version of the pipe() function
diff mbox series

Message ID 20241206101344.767170-14-stefan.klug@ideasonboard.com
State Accepted
Delegated to: Paul Elder
Headers show
Series
  • rkisp1: Fix aspect ratio and ScalerCrop
Related show

Commit Message

Stefan Klug Dec. 6, 2024, 10:13 a.m. UTC
Allow access to the pipeline handler on a const instance of
Camera::Private.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
Changes in v3:
- Added this patch
---
 include/libcamera/internal/camera.h | 1 +
 src/libcamera/camera.cpp            | 5 +++++
 2 files changed, 6 insertions(+)

Comments

Jacopo Mondi Dec. 11, 2024, 2:40 p.m. UTC | #1
Hi Stefan

On Fri, Dec 06, 2024 at 11:13:35AM +0100, Stefan Klug wrote:
> Allow access to the pipeline handler on a const instance of
> Camera::Private.
>
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

> ---
> Changes in v3:
> - Added this patch
> ---
>  include/libcamera/internal/camera.h | 1 +
>  src/libcamera/camera.cpp            | 5 +++++
>  2 files changed, 6 insertions(+)
>
> diff --git a/include/libcamera/internal/camera.h b/include/libcamera/internal/camera.h
> index 0add0428bb5d..2bb00bbcb644 100644
> --- a/include/libcamera/internal/camera.h
> +++ b/include/libcamera/internal/camera.h
> @@ -32,6 +32,7 @@ public:
>  	~Private();
>
>  	PipelineHandler *pipe() { return pipe_.get(); }
> +	const PipelineHandler *pipe() const { return pipe_.get(); }
>
>  	std::list<Request *> queuedRequests_;
>  	ControlInfoMap controlInfo_;
> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
> index 4c865a46af53..69a7ee5353f1 100644
> --- a/src/libcamera/camera.cpp
> +++ b/src/libcamera/camera.cpp
> @@ -603,6 +603,11 @@ Camera::Private::~Private()
>   * \return The pipeline handler that created this camera
>   */
>
> +/**
> + * \fn Camera::Private::pipe() const
> + * \copydoc Camera::Private::pipe()
> + */
> +
>  /**
>   * \fn Camera::Private::validator()
>   * \brief Retrieve the control validator related to this camera
> --
> 2.43.0
>
Paul Elder Dec. 12, 2024, 12:05 p.m. UTC | #2
On Fri, Dec 06, 2024 at 11:13:35AM +0100, Stefan Klug wrote:
> Allow access to the pipeline handler on a const instance of
> Camera::Private.
> 
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

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

> ---
> Changes in v3:
> - Added this patch
> ---
>  include/libcamera/internal/camera.h | 1 +
>  src/libcamera/camera.cpp            | 5 +++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/include/libcamera/internal/camera.h b/include/libcamera/internal/camera.h
> index 0add0428bb5d..2bb00bbcb644 100644
> --- a/include/libcamera/internal/camera.h
> +++ b/include/libcamera/internal/camera.h
> @@ -32,6 +32,7 @@ public:
>  	~Private();
>  
>  	PipelineHandler *pipe() { return pipe_.get(); }
> +	const PipelineHandler *pipe() const { return pipe_.get(); }
>  
>  	std::list<Request *> queuedRequests_;
>  	ControlInfoMap controlInfo_;
> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
> index 4c865a46af53..69a7ee5353f1 100644
> --- a/src/libcamera/camera.cpp
> +++ b/src/libcamera/camera.cpp
> @@ -603,6 +603,11 @@ Camera::Private::~Private()
>   * \return The pipeline handler that created this camera
>   */
>  
> +/**
> + * \fn Camera::Private::pipe() const
> + * \copydoc Camera::Private::pipe()
> + */
> +
>  /**
>   * \fn Camera::Private::validator()
>   * \brief Retrieve the control validator related to this camera
> -- 
> 2.43.0
>

Patch
diff mbox series

diff --git a/include/libcamera/internal/camera.h b/include/libcamera/internal/camera.h
index 0add0428bb5d..2bb00bbcb644 100644
--- a/include/libcamera/internal/camera.h
+++ b/include/libcamera/internal/camera.h
@@ -32,6 +32,7 @@  public:
 	~Private();
 
 	PipelineHandler *pipe() { return pipe_.get(); }
+	const PipelineHandler *pipe() const { return pipe_.get(); }
 
 	std::list<Request *> queuedRequests_;
 	ControlInfoMap controlInfo_;
diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
index 4c865a46af53..69a7ee5353f1 100644
--- a/src/libcamera/camera.cpp
+++ b/src/libcamera/camera.cpp
@@ -603,6 +603,11 @@  Camera::Private::~Private()
  * \return The pipeline handler that created this camera
  */
 
+/**
+ * \fn Camera::Private::pipe() const
+ * \copydoc Camera::Private::pipe()
+ */
+
 /**
  * \fn Camera::Private::validator()
  * \brief Retrieve the control validator related to this camera