[{"id":18682,"web_url":"https://patchwork.libcamera.org/comment/18682/","msgid":"<20210810134951.oe75dzxsk3xl5scy@uno.localdomain>","date":"2021-08-10T13:49:51","subject":"Re: [libcamera-devel] [PATCH v2 07/11] libcamera: pipeline:\n\traspberrypi: Migrate to Camera::Private","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Thu, Aug 05, 2021 at 08:58:44PM +0300, Laurent Pinchart wrote:\n> As part of the effort to remove the CameraData class, migrate the\n> pipeline handler-specific camera data from CameraData to the\n> Camera::Private class.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\n> ---\n>  .../pipeline/raspberrypi/raspberrypi.cpp      | 24 +++++++++----------\n>  1 file changed, 12 insertions(+), 12 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 33cd5765b52e..754db5a65f4a 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -135,11 +135,11 @@ enum class Isp : unsigned int { Input, Output0, Output1, Stats };\n>\n>  } /* namespace */\n>\n> -class RPiCameraData : public CameraData\n> +class RPiCameraData : public Camera::Private\n>  {\n>  public:\n>  \tRPiCameraData(PipelineHandler *pipe)\n> -\t\t: CameraData(pipe), state_(State::Stopped),\n> +\t\t: Camera::Private(pipe), state_(State::Stopped),\n>  \t\t  supportsFlips_(false), flipsAlterBayerOrder_(false),\n>  \t\t  dropFrameCount_(0), ispOutputCount_(0)\n>  \t{\n> @@ -263,9 +263,9 @@ public:\n>  \tbool match(DeviceEnumerator *enumerator) override;\n>\n>  private:\n> -\tRPiCameraData *cameraData(const Camera *camera)\n> +\tRPiCameraData *cameraData(Camera *camera)\n>  \t{\n> -\t\treturn static_cast<RPiCameraData *>(PipelineHandler::cameraData(camera));\n> +\t\treturn static_cast<RPiCameraData *>(camera->_d());\n>  \t}\n>\n>  \tint queueAllBuffers(Camera *camera);\n> @@ -1106,10 +1106,10 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)\n>  \tstreams.insert(&data->isp_[Isp::Output1]);\n>\n>  \t/* Create and register the camera. */\n> +\tconst std::string &id = data->sensor_->id();\n>  \tstd::shared_ptr<Camera> camera =\n> -\t\tCamera::create(new Camera::Private(this), data->sensor_->id(),\n> -\t\t\t       streams);\n> -\tregisterCamera(std::move(camera), std::move(data));\n> +\t\tCamera::create(data.release(), id, streams);\n> +\tregisterCamera(std::move(camera), nullptr);\n>\n>  \treturn true;\n>  }\n> @@ -1224,7 +1224,7 @@ void RPiCameraData::frameStarted(uint32_t sequence)\n>\n>  int RPiCameraData::loadIPA(ipa::RPi::SensorConfig *sensorConfig)\n>  {\n> -\tipa_ = IPAManager::createIPA<ipa::RPi::IPAProxyRPi>(pipe_, 1, 1);\n> +\tipa_ = IPAManager::createIPA<ipa::RPi::IPAProxyRPi>(pipe(), 1, 1);\n>\n>  \tif (!ipa_)\n>  \t\treturn -ENOENT;\n> @@ -1528,11 +1528,11 @@ void RPiCameraData::clearIncompleteRequests()\n>  \t\t\t */\n>  \t\t\tif (buffer->request()) {\n>  \t\t\t\tbuffer->cancel();\n> -\t\t\t\tpipe_->completeBuffer(request, buffer);\n> +\t\t\t\tpipe()->completeBuffer(request, buffer);\n>  \t\t\t}\n>  \t\t}\n>\n> -\t\tpipe_->completeRequest(request);\n> +\t\tpipe()->completeRequest(request);\n>  \t\trequestQueue_.pop_front();\n>  \t}\n>  }\n> @@ -1556,7 +1556,7 @@ void RPiCameraData::handleStreamBuffer(FrameBuffer *buffer, RPi::Stream *stream)\n>  \t\t\t * Tag the buffer as completed, returning it to the\n>  \t\t\t * application.\n>  \t\t\t */\n> -\t\t\tpipe_->completeBuffer(request, buffer);\n> +\t\t\tpipe()->completeBuffer(request, buffer);\n>  \t\t} else {\n>  \t\t\t/*\n>  \t\t\t * This buffer was not part of the Request, or there is no\n> @@ -1619,7 +1619,7 @@ void RPiCameraData::checkRequestCompleted()\n>  \t\tif (state_ != State::IpaComplete)\n>  \t\t\treturn;\n>\n> -\t\tpipe_->completeRequest(request);\n> +\t\tpipe()->completeRequest(request);\n>  \t\trequestQueue_.pop_front();\n>  \t\trequestCompleted = true;\n>  \t}\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3203AC3240\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 10 Aug 2021 13:49:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AAC0768822;\n\tTue, 10 Aug 2021 15:49:05 +0200 (CEST)","from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 951DF687F0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 Aug 2021 15:49:03 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 20063FF806;\n\tTue, 10 Aug 2021 13:49:02 +0000 (UTC)"],"Date":"Tue, 10 Aug 2021 15:49:51 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20210810134951.oe75dzxsk3xl5scy@uno.localdomain>","References":"<20210805175848.24188-1-laurent.pinchart@ideasonboard.com>\n\t<20210805175848.24188-8-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20210805175848.24188-8-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 07/11] libcamera: pipeline:\n\traspberrypi: Migrate to Camera::Private","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]