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

Niklas Söderlund niklas.soderlund at ragnatech.se
Sat Jul 24 09:01:53 CEST 2021


Hi Laurent,

Thanks for your patch.

On 2021-07-23 07:00:26 +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.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

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

> ---
>  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
> 

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list