From 32b8832e38e5311dcbed5badfad3d69e5981ed95 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 23 Jul 2021 02:57:44 +0300 Subject: libcamera: camera: Pass Private pointer to Camera constructor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to allow subclassing Camera::Private in pipeline handlers, pass the pointer to the private data to the Camera constructor, and to the Camera::createCamera() function. The Camera::Private id_ and streams_ members now need to be initialized by the Camera constructor instead of the Camera::Private constructor, to allow storage of the streams in a pipeline handler-specific subclass of Camera::Private. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- include/libcamera/camera.h | 4 ++-- include/libcamera/internal/camera.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h index b081907e..05cdab72 100644 --- a/include/libcamera/camera.h +++ b/include/libcamera/camera.h @@ -78,7 +78,7 @@ class Camera final : public Object, public std::enable_shared_from_this, LIBCAMERA_DECLARE_PRIVATE() public: - static std::shared_ptr create(PipelineHandler *pipe, + static std::shared_ptr create(std::unique_ptr d, const std::string &id, const std::set &streams); @@ -107,7 +107,7 @@ public: private: LIBCAMERA_DISABLE_COPY(Camera) - Camera(PipelineHandler *pipe, const std::string &id, + Camera(std::unique_ptr d, const std::string &id, const std::set &streams); ~Camera(); diff --git a/include/libcamera/internal/camera.h b/include/libcamera/internal/camera.h index b60ed140..9ec8321a 100644 --- a/include/libcamera/internal/camera.h +++ b/include/libcamera/internal/camera.h @@ -26,8 +26,7 @@ class Camera::Private : public Extensible::Private LIBCAMERA_DECLARE_PUBLIC(Camera) public: - Private(PipelineHandler *pipe, const std::string &id, - const std::set &streams); + Private(PipelineHandler *pipe); ~Private(); private: -- cgit v1.2.1