[{"id":24867,"web_url":"https://patchwork.libcamera.org/comment/24867/","msgid":"<166195265171.15972.1370296224624148577@Monstersaurus>","date":"2022-08-31T13:30:51","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: request: Rename\n\tPrivate::reuse() to Private::reset()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Umang Jain via libcamera-devel (2022-08-30 14:33:21)\n> The Request::Private::reuse() is different from Request::reuse().\n> It reset the members of Request::Private to default values hence,\n\ns/reset/resets/\n\n> rename it to more appropriate Request::Private::reset().\n\n/it to more/it to a more/\n\n> \n> Update the usage and documentation accordingly.\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nLooks good to me, the very trivial minors above could be fixed before\napplying, no need for a v3 I don't think.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n> Changes in v2:\n> - Overhaul the patch by renaming Private::reuse() to reset()\n> \n> v1: [PATCH] libcamera: request: Fix doxygen warning\n> ---\n>  include/libcamera/internal/request.h | 2 +-\n>  src/libcamera/request.cpp            | 9 ++++++---\n>  2 files changed, 7 insertions(+), 4 deletions(-)\n> \n> diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h\n> index 9dadd6c6..8c92a27a 100644\n> --- a/include/libcamera/internal/request.h\n> +++ b/include/libcamera/internal/request.h\n> @@ -37,7 +37,7 @@ public:\n>         bool completeBuffer(FrameBuffer *buffer);\n>         void complete();\n>         void cancel();\n> -       void reuse();\n> +       void reset();\n>  \n>         void prepare(std::chrono::milliseconds timeout = 0ms);\n>         Signal<> prepared;\n> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\n> index d2af1d22..949c556f 100644\n> --- a/src/libcamera/request.cpp\n> +++ b/src/libcamera/request.cpp\n> @@ -158,9 +158,12 @@ void Request::Private::cancel()\n>  }\n>  \n>  /**\n> - * \\copydoc Request::reuse()\n> + * \\brief Reset the request internal data to default values\n> + *\n> + * After calling this function, all request internal data will have default\n> + * values as if the Request::Private instance had just been constructed.\n>   */\n> -void Request::Private::reuse()\n> +void Request::Private::reset()\n>  {\n>         sequence_ = 0;\n>         cancelled_ = false;\n> @@ -380,7 +383,7 @@ void Request::reuse(ReuseFlag flags)\n>  {\n>         LIBCAMERA_TRACEPOINT(request_reuse, this);\n>  \n> -       _d()->reuse();\n> +       _d()->reset();\n>  \n>         if (flags & ReuseBuffers) {\n>                 for (auto pair : bufferMap_) {\n> -- \n> 2.37.2\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 5382EC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 31 Aug 2022 13:30:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BDFDA61FC0;\n\tWed, 31 Aug 2022 15:30:57 +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 0345361F9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 31 Aug 2022 15:30:55 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7565A481;\n\tWed, 31 Aug 2022 15:30:55 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1661952657;\n\tbh=nx9GeQ434+U9nTeZTvkfT+6p17mZFkVXgsbtqkMDd1s=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=RYeYrox8t37uhd2caIie/Sm9QN3jAHnM07vpZE8b3Iz12BedNepCwtbxL9ClMQGon\n\tS4j6GIm7fR3KQMflbXgUeL4M9Py+eMrd9wvMEhS7P84RUulXQtGwh9PUIwKdhtipUQ\n\tM4XikWXMAdH1Q/5MSwbl7TBklffszcmvuahlQpzLCXKKVq8DpRg/yS1Yy6k9lrInUw\n\tUC72Wyr6xxjXbj1itNovvxLUwtZCkCKA9iA5YWTbaCiQXJrtH1wFQRVEC/1SgmypiU\n\tnsZKnH5xW2UizPmfLB+53T3igep5B4uUJv+8adxMVsidnt4dxG7dfUW93EpFrswvBn\n\tMQCZtp80MWBLg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1661952655;\n\tbh=nx9GeQ434+U9nTeZTvkfT+6p17mZFkVXgsbtqkMDd1s=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=VkpiesPerY7EojMJAv3mKNxBmyuJ09mOzcGrsOGW81R2hX5S7Jq84M/8El4n/xVbc\n\tt+yUHUSj1JJsrv7fzzYOJpMgRhLnLNQbci9snbQH8O+ZDPxCtsyym/iXLWXEzul+OU\n\tz8HoCd7R65cIxlo3c0KySfYegFM7Zljw4O5U/kEw="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"VkpiesPe\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220830133321.1107312-1-umang.jain@ideasonboard.com>","References":"<20220830133321.1107312-1-umang.jain@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 31 Aug 2022 14:30:51 +0100","Message-ID":"<166195265171.15972.1370296224624148577@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: request: Rename\n\tPrivate::reuse() to Private::reset()","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]