summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/rkisp1
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-23 02:57:44 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-16 23:57:28 +0300
commit32b8832e38e5311dcbed5badfad3d69e5981ed95 (patch)
treed78355ef8ebb1a75248f11464723fd73fb52fe67 /src/libcamera/pipeline/rkisp1
parente77c8951e9ff91bf2bacf81791a882ccb3cee30b (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/rkisp1')
-rw-r--r--src/libcamera/pipeline/rkisp1/rkisp1.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 710b9309..74c55620 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -27,6 +27,7 @@
#include <libcamera/request.h>
#include <libcamera/stream.h>
+#include "libcamera/internal/camera.h"
#include "libcamera/internal/camera_sensor.h"
#include "libcamera/internal/delayed_controls.h"
#include "libcamera/internal/device_enumerator.h"
@@ -971,7 +972,8 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)
&data->selfPathStream_,
};
std::shared_ptr<Camera> camera =
- Camera::create(this, data->sensor_->id(), streams);
+ Camera::create(std::make_unique<Camera::Private>(this),
+ data->sensor_->id(), streams);
registerCamera(std::move(camera), std::move(data));
return 0;