[libcamera-devel] [PATCH v2 06/11] libcamera: pipeline: rkisp1: Migrate to Camera::Private
Jacopo Mondi
jacopo at jmondi.org
Tue Aug 10 15:47:52 CEST 2021
Hi Laurent
same nit below :)
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
Thanks
j
On Thu, Aug 05, 2021 at 08:58:43PM +0300, Laurent Pinchart wrote:
> As part of the effort to remove the CameraData class, migrate the
> pipeline handler-specific camera data from CameraData to the
> Camera::Private class.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> src/libcamera/pipeline/rkisp1/rkisp1.cpp | 28 ++++++++++++------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index cc279ce733ef..eab892785fb0 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -77,12 +77,12 @@ private:
> std::map<unsigned int, RkISP1FrameInfo *> frameInfo_;
> };
>
> -class RkISP1CameraData : public CameraData
> +class RkISP1CameraData : public Camera::Private
> {
> public:
> RkISP1CameraData(PipelineHandler *pipe, RkISP1MainPath *mainPath,
> RkISP1SelfPath *selfPath)
> - : CameraData(pipe), frame_(0), frameInfo_(pipe),
> + : Camera::Private(pipe), frame_(0), frameInfo_(pipe),
> mainPath_(mainPath), selfPath_(selfPath)
> {
> }
> @@ -152,16 +152,15 @@ public:
> bool match(DeviceEnumerator *enumerator) override;
>
> private:
> - RkISP1CameraData *cameraData(const Camera *camera)
> + RkISP1CameraData *cameraData(Camera *camera)
> {
> - return static_cast<RkISP1CameraData *>(
> - PipelineHandler::cameraData(camera));
> + return static_cast<RkISP1CameraData *>(camera->_d());
> }
>
> friend RkISP1CameraData;
> friend RkISP1Frames;
>
> - int initLinks(const Camera *camera, const CameraSensor *sensor,
> + int initLinks(Camera *camera, const CameraSensor *sensor,
> const RkISP1CameraConfiguration &config);
> int createCamera(MediaEntity *sensor);
> void tryCompleteRequest(Request *request);
> @@ -307,7 +306,7 @@ RkISP1FrameInfo *RkISP1Frames::find(Request *request)
>
> int RkISP1CameraData::loadIPA(unsigned int hwRevision)
> {
> - ipa_ = IPAManager::createIPA<ipa::rkisp1::IPAProxyRkISP1>(pipe_, 1, 1);
> + ipa_ = IPAManager::createIPA<ipa::rkisp1::IPAProxyRkISP1>(pipe(), 1, 1);
> if (!ipa_)
> return -ENOENT;
>
> @@ -333,7 +332,8 @@ void RkISP1CameraData::queueFrameAction(unsigned int frame,
> break;
> }
> case ipa::rkisp1::ActionParamFilled: {
> - PipelineHandlerRkISP1 *pipe = static_cast<PipelineHandlerRkISP1 *>(pipe_);
> + PipelineHandlerRkISP1 *pipe =
> + static_cast<PipelineHandlerRkISP1 *>(this->pipe());
> RkISP1FrameInfo *info = frameInfo_.find(frame);
> if (!info)
> break;
> @@ -361,7 +361,7 @@ void RkISP1CameraData::queueFrameAction(unsigned int frame,
> void RkISP1CameraData::metadataReady(unsigned int frame, const ControlList &metadata)
> {
> PipelineHandlerRkISP1 *pipe =
> - static_cast<PipelineHandlerRkISP1 *>(pipe_);
> + static_cast<PipelineHandlerRkISP1 *>(this->pipe());
>
> RkISP1FrameInfo *info = frameInfo_.find(frame);
> if (!info)
> @@ -847,7 +847,7 @@ void PipelineHandlerRkISP1::stop(Camera *camera)
> LOG(RkISP1, Warning)
> << "Failed to stop parameters for " << camera->id();
>
> - ASSERT(camera->_d()->queuedRequests_.empty());
> + ASSERT(data->queuedRequests_.empty());
> data->frameInfo_.clear();
>
> freeBuffers(camera);
> @@ -879,7 +879,7 @@ int PipelineHandlerRkISP1::queueRequestDevice(Camera *camera, Request *request)
> * Match and Setup
> */
>
> -int PipelineHandlerRkISP1::initLinks(const Camera *camera,
> +int PipelineHandlerRkISP1::initLinks(Camera *camera,
> const CameraSensor *sensor,
> const RkISP1CameraConfiguration &config)
> {
> @@ -970,10 +970,10 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)
> &data->mainPathStream_,
> &data->selfPathStream_,
> };
> + const std::string &id = data->sensor_->id();
> std::shared_ptr<Camera> camera =
> - Camera::create(new Camera::Private(this), data->sensor_->id(),
> - streams);
> - registerCamera(std::move(camera), std::move(data));
> + Camera::create(data.release(), id, streams);
> + registerCamera(std::move(camera), nullptr);
>
> return 0;
> }
> --
> Regards,
>
> Laurent Pinchart
>
More information about the libcamera-devel
mailing list