[{"id":12832,"web_url":"https://patchwork.libcamera.org/comment/12832/","msgid":"<20200928224233.GU23539@pendragon.ideasonboard.com>","date":"2020-09-28T22:42:33","subject":"Re: [libcamera-devel] [PATCH v3 18/22] libcamera: pipeline: rkisp1:\n\tAdd wrappers for accessing the path video device","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Fri, Sep 25, 2020 at 03:42:03AM +0200, Niklas Söderlund wrote:\n> As a step to be able to make RkISP1Path::video_ private add simple\n> wrappers for buffer handling. There is no functional change.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp     | 12 ++++++------\n>  src/libcamera/pipeline/rkisp1/rkisp1path.cpp |  6 ++++++\n>  src/libcamera/pipeline/rkisp1/rkisp1path.h   | 10 +++++++++-\n>  3 files changed, 21 insertions(+), 7 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 114aee3e180afb77..7dd4fb11c39dd811 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -403,10 +403,10 @@ protected:\n>  \t\tpipe_->stat_->queueBuffer(info->statBuffer);\n>  \n>  \t\tif (info->mainPathBuffer)\n> -\t\t\tpipe_->mainPath_.video_->queueBuffer(info->mainPathBuffer);\n> +\t\t\tpipe_->mainPath_.queueBuffer(info->mainPathBuffer);\n>  \n>  \t\tif (info->selfPathBuffer)\n> -\t\t\tpipe_->selfPath_.video_->queueBuffer(info->selfPathBuffer);\n> +\t\t\tpipe_->selfPath_.queueBuffer(info->selfPathBuffer);\n>  \t}\n>  \n>  private:\n> @@ -752,9 +752,9 @@ int PipelineHandlerRkISP1::exportFrameBuffers([[maybe_unused]] Camera *camera, S\n>  \tunsigned int count = stream->configuration().bufferCount;\n>  \n>  \tif (stream == &data->mainPathStream_)\n> -\t\treturn mainPath_.video_->exportBuffers(count, buffers);\n> +\t\treturn mainPath_.exportBuffers(count, buffers);\n>  \telse if (stream == &data->selfPathStream_)\n> -\t\treturn selfPath_.video_->exportBuffers(count, buffers);\n> +\t\treturn selfPath_.exportBuffers(count, buffers);\n>  \n>  \treturn -EINVAL;\n>  }\n> @@ -1154,8 +1154,8 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n>  \tif (!selfPath_.init(media_))\n>  \t\treturn false;\n>  \n> -\tmainPath_.video_->bufferReady.connect(this, &PipelineHandlerRkISP1::bufferReady);\n> -\tselfPath_.video_->bufferReady.connect(this, &PipelineHandlerRkISP1::bufferReady);\n> +\tmainPath_.bufferReady().connect(this, &PipelineHandlerRkISP1::bufferReady);\n> +\tselfPath_.bufferReady().connect(this, &PipelineHandlerRkISP1::bufferReady);\n>  \tstat_->bufferReady.connect(this, &PipelineHandlerRkISP1::statReady);\n>  \tparam_->bufferReady.connect(this, &PipelineHandlerRkISP1::paramReady);\n>  \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1path.cpp\n> index 0be4d20bb1cd2094..74eaa5d32388184b 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1path.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1path.cpp\n> @@ -149,6 +149,12 @@ int RkISP1Path::configure(const StreamConfiguration &config,\n>  \treturn 0;\n>  }\n>  \n> +int RkISP1Path::exportBuffers(unsigned int bufferCount,\n> +\t\t\t      std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n> +{\n> +\treturn video_->exportBuffers(bufferCount, buffers);\n> +}\n> +\n>  RkISP1MainPath::RkISP1MainPath()\n>  \t: RkISP1Path(\"main\",\n>  \t\t     {\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1path.h b/src/libcamera/pipeline/rkisp1/rkisp1path.h\n> index 5b2917c746ee1d95..1315b2c64feac681 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1path.h\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1path.h\n> @@ -10,6 +10,9 @@\n>  #include <vector>\n>  \n>  #include <libcamera/camera.h>\n> +#include <libcamera/signal.h>\n> +\n> +#include \"libcamera/internal/v4l2_videodevice.h\"\n>  \n>  namespace libcamera {\n>  \n> @@ -17,7 +20,6 @@ class MediaDevice;\n>  class PixelFormat;\n>  class Size;\n>  class V4L2Subdevice;\n> -class V4L2VideoDevice;\n>  struct StreamConfiguration;\n>  struct V4L2SubdeviceFormat;\n>  \n> @@ -36,6 +38,12 @@ public:\n>  \tint configure(const StreamConfiguration &config,\n>  \t\t      const V4L2SubdeviceFormat &inputFormat);\n>  \n> +\tint exportBuffers(unsigned int bufferCount,\n> +\t\t\t  std::vector<std::unique_ptr<FrameBuffer>> *buffers);\n\nWith the next two functions inline, how about inlining this one too ?\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\n> +\tint queueBuffer(FrameBuffer *buffer) { return video_->queueBuffer(buffer); }\n> +\tSignal<FrameBuffer *> &bufferReady() { return video_->bufferReady; }\n> +\n>  \t/* \\todo Make video private. */\n>  \tV4L2VideoDevice *video_;\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 7A9F8C3B5C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Sep 2020 22:43:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EB8D86138F;\n\tTue, 29 Sep 2020 00:43:09 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 15DB360394\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Sep 2020 00:43:09 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 59B96A58;\n\tTue, 29 Sep 2020 00:43:08 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"vQGZENNX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1601332988;\n\tbh=QHgN9gqvBUn7IQAm1tP3elOck1OJn2NlzaQuC9kLtFM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=vQGZENNX3ct9afwxZhJIQcNrNM8c4Egb5OHG3Znk1CM31KUZYqwX97v08ajGW7zNe\n\tAyQI1tMYZgPaDd4BeWYH3o59PR9Ql+zYMqnaEUMuyvkW1cW41UN/qUwaNJ8hzrECUW\n\tCXwHesSJlxdJYDWoYklh7TRFcesdZOlI2rtDDWEg=","Date":"Tue, 29 Sep 2020 01:42:33 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200928224233.GU23539@pendragon.ideasonboard.com>","References":"<20200925014207.1455796-1-niklas.soderlund@ragnatech.se>\n\t<20200925014207.1455796-19-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200925014207.1455796-19-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH v3 18/22] libcamera: pipeline: rkisp1:\n\tAdd wrappers for accessing the path video device","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","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]