diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-07-23 02:57:44 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-08-16 23:57:28 +0300 |
commit | 32b8832e38e5311dcbed5badfad3d69e5981ed95 (patch) | |
tree | d78355ef8ebb1a75248f11464723fd73fb52fe67 /src/libcamera/pipeline/uvcvideo | |
parent | e77c8951e9ff91bf2bacf81791a882ccb3cee30b (diff) |
libcamera: camera: Pass Private pointer to Camera constructor
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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/pipeline/uvcvideo')
-rw-r--r-- | src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp index 573d8042..f2d2b670 100644 --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp @@ -22,6 +22,7 @@ #include <libcamera/request.h> #include <libcamera/stream.h> +#include "libcamera/internal/camera.h" #include "libcamera/internal/device_enumerator.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/pipeline_handler.h" @@ -470,7 +471,9 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator) } std::set<Stream *> streams{ &data->stream_ }; - std::shared_ptr<Camera> camera = Camera::create(this, id, streams); + std::shared_ptr<Camera> camera = + Camera::create(std::make_unique<Camera::Private>(this), id, + streams); registerCamera(std::move(camera), std::move(data)); /* Enable hot-unplug notifications. */ |