[libcamera-devel] [RFC PATCH 07/17] libcamera: camera: Make Camera::Private members private

Jacopo Mondi jacopo at jmondi.org
Thu Jul 29 22:52:00 CEST 2021


Hi Laurent

On Fri, Jul 23, 2021 at 07:00:26AM +0300, Laurent Pinchart wrote:
> To prepare for the Camera::Private structure being used by pipeline
> handlers, turn all its members to private. Members that are useful for
> pipeline handlers will be made public again, or will be exposed through
> accessor functions, on a case-by-case basis.

It makes easier to follow what happens indeed

Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>

Thanks
  j

>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  include/libcamera/internal/camera.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/libcamera/internal/camera.h b/include/libcamera/internal/camera.h
> index 9ef5d8ae98a6..b60ed140356a 100644
> --- a/include/libcamera/internal/camera.h
> +++ b/include/libcamera/internal/camera.h
> @@ -26,6 +26,11 @@ class Camera::Private : public Extensible::Private
>  	LIBCAMERA_DECLARE_PUBLIC(Camera)
>
>  public:
> +	Private(PipelineHandler *pipe, const std::string &id,
> +		const std::set<Stream *> &streams);
> +	~Private();
> +
> +private:
>  	enum State {
>  		CameraAvailable,
>  		CameraAcquired,
> @@ -34,10 +39,6 @@ public:
>  		CameraRunning,
>  	};
>
> -	Private(PipelineHandler *pipe, const std::string &id,
> -		const std::set<Stream *> &streams);
> -	~Private();
> -
>  	bool isRunning() const;
>  	int isAccessAllowed(State state, bool allowDisconnected = false,
>  			    const char *from = __builtin_FUNCTION()) const;
> @@ -53,7 +54,6 @@ public:
>  	std::set<Stream *> streams_;
>  	std::set<const Stream *> activeStreams_;
>
> -private:
>  	bool disconnected_;
>  	std::atomic<State> state_;
>  };
> --
> Regards,
>
> Laurent Pinchart
>


More information about the libcamera-devel mailing list