[libcamera-devel] [PATCH v2 07/11] libcamera: pipeline: raspberrypi: Migrate to Camera::Private
Jacopo Mondi
jacopo at jmondi.org
Tue Aug 10 15:49:51 CEST 2021
Hi Laurent,
On Thu, Aug 05, 2021 at 08:58:44PM +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>
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
Thanks
j
> ---
> .../pipeline/raspberrypi/raspberrypi.cpp | 24 +++++++++----------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index 33cd5765b52e..754db5a65f4a 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -135,11 +135,11 @@ enum class Isp : unsigned int { Input, Output0, Output1, Stats };
>
> } /* namespace */
>
> -class RPiCameraData : public CameraData
> +class RPiCameraData : public Camera::Private
> {
> public:
> RPiCameraData(PipelineHandler *pipe)
> - : CameraData(pipe), state_(State::Stopped),
> + : Camera::Private(pipe), state_(State::Stopped),
> supportsFlips_(false), flipsAlterBayerOrder_(false),
> dropFrameCount_(0), ispOutputCount_(0)
> {
> @@ -263,9 +263,9 @@ public:
> bool match(DeviceEnumerator *enumerator) override;
>
> private:
> - RPiCameraData *cameraData(const Camera *camera)
> + RPiCameraData *cameraData(Camera *camera)
> {
> - return static_cast<RPiCameraData *>(PipelineHandler::cameraData(camera));
> + return static_cast<RPiCameraData *>(camera->_d());
> }
>
> int queueAllBuffers(Camera *camera);
> @@ -1106,10 +1106,10 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
> streams.insert(&data->isp_[Isp::Output1]);
>
> /* Create and register the camera. */
> + 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 true;
> }
> @@ -1224,7 +1224,7 @@ void RPiCameraData::frameStarted(uint32_t sequence)
>
> int RPiCameraData::loadIPA(ipa::RPi::SensorConfig *sensorConfig)
> {
> - ipa_ = IPAManager::createIPA<ipa::RPi::IPAProxyRPi>(pipe_, 1, 1);
> + ipa_ = IPAManager::createIPA<ipa::RPi::IPAProxyRPi>(pipe(), 1, 1);
>
> if (!ipa_)
> return -ENOENT;
> @@ -1528,11 +1528,11 @@ void RPiCameraData::clearIncompleteRequests()
> */
> if (buffer->request()) {
> buffer->cancel();
> - pipe_->completeBuffer(request, buffer);
> + pipe()->completeBuffer(request, buffer);
> }
> }
>
> - pipe_->completeRequest(request);
> + pipe()->completeRequest(request);
> requestQueue_.pop_front();
> }
> }
> @@ -1556,7 +1556,7 @@ void RPiCameraData::handleStreamBuffer(FrameBuffer *buffer, RPi::Stream *stream)
> * Tag the buffer as completed, returning it to the
> * application.
> */
> - pipe_->completeBuffer(request, buffer);
> + pipe()->completeBuffer(request, buffer);
> } else {
> /*
> * This buffer was not part of the Request, or there is no
> @@ -1619,7 +1619,7 @@ void RPiCameraData::checkRequestCompleted()
> if (state_ != State::IpaComplete)
> return;
>
> - pipe_->completeRequest(request);
> + pipe()->completeRequest(request);
> requestQueue_.pop_front();
> requestCompleted = true;
> }
> --
> Regards,
>
> Laurent Pinchart
>
More information about the libcamera-devel
mailing list