[{"id":18310,"web_url":"https://patchwork.libcamera.org/comment/18310/","msgid":"<YPvA4LOXz4zwrDCQ@oden.dyn.berto.se>","date":"2021-07-24T07:27:28","subject":"Re: [libcamera-devel] [RFC PATCH 14/17] libcamera: pipeline:\n\traspberrypi: Migrate to Camera::Private","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your effort.\n\nOn 2021-07-23 07:00:33 +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\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\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 2411f73f48e0..be8dcdc67a15 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> @@ -1523,10 +1523,10 @@ void RPiCameraData::clearIncompleteRequests()\n>  \t\tfor (auto &b : request->buffers()) {\n>  \t\t\tFrameBuffer *buffer = b.second;\n>  \t\t\tbuffer->cancel();\n> -\t\t\tpipe_->completeBuffer(request, buffer);\n> +\t\t\tpipe()->completeBuffer(request, buffer);\n>  \t\t}\n>  \n> -\t\tpipe_->completeRequest(request);\n> +\t\tpipe()->completeRequest(request);\n>  \t\trequestQueue_.pop_front();\n>  \t}\n>  }\n> @@ -1550,7 +1550,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> @@ -1613,7 +1613,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 099F1C0109\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 24 Jul 2021 07:27:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B98DD687A9;\n\tSat, 24 Jul 2021 09:27:31 +0200 (CEST)","from mail-lf1-x133.google.com (mail-lf1-x133.google.com\n\t[IPv6:2a00:1450:4864:20::133])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3F7A868540\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 24 Jul 2021 09:27:30 +0200 (CEST)","by mail-lf1-x133.google.com with SMTP id g13so5797219lfj.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 24 Jul 2021 00:27:30 -0700 (PDT)","from localhost (h-46-59-88-219.A463.priv.bahnhof.se.\n\t[46.59.88.219]) by smtp.gmail.com with ESMTPSA id\n\tq10sm2438056lfm.5.2021.07.24.00.27.29\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 24 Jul 2021 00:27:29 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"oR1V3NkZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=QXn56SBz1UL6CJGoaqaIZJRCLkplqeLBHSTXB5TlyNM=;\n\tb=oR1V3NkZagUOUOIZGdEWHp468tm5tgB5ElQdxDR7hzFG+J0oGgh8F3+LB7A/zX2B41\n\tZ60QnUObR63H8xrfY0pxaTCpCnUl3syX69fxy92Lly7ugciVCrwcNat0BD60jJz/e/T6\n\thz6UApRuS/FI3rVhJtLX3CaESDQbxnI95AH4NdR8pOOlvAFHjCVFogb5kFL4MM3WCQji\n\tBER0xD1857eN8ePrCFI4ZZ6t5f/0oPCW28di/X+62k2GyXzxlAWeH9P51Kh0Q7eUq7+v\n\tCutaAkhUoOpX7+hAcNsqh8hcYRBGMoOvkyx4BJxyhOkd/UzMaD/45DQ4w5/2L9QkY8l6\n\tcIPg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=QXn56SBz1UL6CJGoaqaIZJRCLkplqeLBHSTXB5TlyNM=;\n\tb=M56yRYqe0J51iBLv3yDWBI3sz2Bvvd5el3VGtMZc+lvBS5Jbtn3WT8gctMm54FKO3e\n\tGCDzHxtVWwLOa3eAezxemiJAozSGfVu8bXguScd38cWP/0kG+NfrN12nA/yTGV2axIE/\n\tKYLp0od4ZgcmVLsafxAUy+NVaD9mLzWY3IAXW5LeW6gOGANehlR+snOCdHmlwKOS1/vX\n\tan3Bu7mZYSbFXQPlxCv5k/Dud5lbmLtZHZwMrGrlO0ZFy6m6KSNlKdV0r4j621d2sG87\n\taPgyMd7f8Xtz0PyOUNU5xe5fyj5QAOCdeXUTTkICjnlZtoZqcfHrClTBq8xk4ZbTU555\n\t5mBQ==","X-Gm-Message-State":"AOAM532mBs0SU+wFbL/hotYbvm6EErP6tjI+gu0ivFr5ggjUgTFfXBWa\n\tnSzHZ7bot3MUK74pw6UER4kq2JUaL86jRw==","X-Google-Smtp-Source":"ABdhPJy9wijuNWqE6Yztny9Dbc360qRiKPx002NCySZitbIHWl4gar+0M6Yox6YhClHB8iSf4sIE+Q==","X-Received":"by 2002:a05:6512:b9a:: with SMTP id\n\tb26mr5780641lfv.78.1627111649677; \n\tSat, 24 Jul 2021 00:27:29 -0700 (PDT)","Date":"Sat, 24 Jul 2021 09:27:28 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<YPvA4LOXz4zwrDCQ@oden.dyn.berto.se>","References":"<20210723040036.32346-1-laurent.pinchart@ideasonboard.com>\n\t<20210723040036.32346-15-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20210723040036.32346-15-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [RFC PATCH 14/17] 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>"}}]