[{"id":22360,"web_url":"https://patchwork.libcamera.org/comment/22360/","msgid":"<Yjo1ezmtrRISFXIK@pendragon.ideasonboard.com>","date":"2022-03-22T20:45:47","subject":"Re: [libcamera-devel] [PATCH v1 1/3] utils: timer: Allow\n\tTimer::start to use utils::Duration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Tue, Mar 22, 2022 at 01:16:33PM +0000, Naushir Patuck via libcamera-devel wrote:\n> Add an overload of the Timer::start member function to accept a utils::Duration\n> type for the timer duration.\n\nI'm actually considering moving the Duration class from libcamera-base to\nlibcamera. The rationale is that the class picks one particular\nrepresentation of a duration that we deem suitable for the libcamera\npublic API. It is of limited usefulness in the base library itself, as\nit's not generic. This would prevent the Timer class from using it. How\nmuch hassle is it to use the Timer class in subsequent patches in this\nseries if we dropped this start() overload ?\n\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  include/libcamera/base/timer.h |  2 ++\n>  src/libcamera/base/timer.cpp   | 14 ++++++++++++++\n>  2 files changed, 16 insertions(+)\n> \n> diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h\n> index 09f1d3229bd5..f42a8cfd4d6d 100644\n> --- a/include/libcamera/base/timer.h\n> +++ b/include/libcamera/base/timer.h\n> @@ -14,6 +14,7 @@\n>  \n>  #include <libcamera/base/object.h>\n>  #include <libcamera/base/signal.h>\n> +#include <libcamera/base/utils.h>\n>  \n>  namespace libcamera {\n>  \n> @@ -27,6 +28,7 @@ public:\n>  \n>  \tvoid start(unsigned int msec) { start(std::chrono::milliseconds(msec)); }\n>  \tvoid start(std::chrono::milliseconds duration);\n> +\tvoid start(utils::Duration duration);\n>  \tvoid start(std::chrono::steady_clock::time_point deadline);\n>  \tvoid stop();\n>  \tbool isRunning() const;\n> diff --git a/src/libcamera/base/timer.cpp b/src/libcamera/base/timer.cpp\n> index 187336e3a1a4..3ff526aea8ae 100644\n> --- a/src/libcamera/base/timer.cpp\n> +++ b/src/libcamera/base/timer.cpp\n> @@ -85,6 +85,20 @@ void Timer::start(std::chrono::milliseconds duration)\n>  \tstart(utils::clock::now() + duration);\n>  }\n>  \n> +/**\n> + * \\brief Start or restart the timer with a timeout of \\a duration\n> + * \\param[in] duration The timer duration given by \\a utils::Duration\n> + *\n> + * If the timer is already running it will be stopped and restarted.\n> + *\n> + * \\context This function is \\threadbound.\n> + */\n> +void Timer::start(utils::Duration duration)\n> +{\n> +\tauto msec = std::chrono::duration_cast<std::chrono::milliseconds>(duration);\n> +\tstart(utils::clock::now() + msec);\n> +}\n> +\n>  /**\n>   * \\brief Start or restart the timer with a \\a deadline\n>   * \\param[in] deadline The timer deadline","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 F1500BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Mar 2022 20:46:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 62F38604C5;\n\tTue, 22 Mar 2022 21:46:07 +0100 (CET)","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 2D962604C5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Mar 2022 21:46:05 +0100 (CET)","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 B0CEBDFA;\n\tTue, 22 Mar 2022 21:46:04 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1647981967;\n\tbh=xSeXVwGP6mYHf/FK9rAB4epHRpaMltmzC3eZmO7xvS0=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=ZYrx3CIljbyELvEZTIn1zPsDzQWe9qLOR6/Ho9B/j8EKgLkYWfMVekj8+1YncaXI5\n\tmt86n33dOhqYOKfMeELwf7vT81k0t2yt1/V4CPAHmpSG75yWW9aImTrRCpXPmw2VgW\n\tIx4RRvrziBaR3E7SJP5Ls245lJfoNkVbRnL+FbwJ7UURuPBEOpfZBBBXcvO8TvUCf3\n\tvU4IouJI9p5MEUbvjCfGhH8q9KoDDig2HHpfByeOadnvZcIPOwxxUSygOK3Bp2r3ie\n\t3XU5Pg9A9x4bg6baXRlk4nx3zVZAwTd3XBHaCsgW5DXZPiiXInB1+OOgItdXFQ4nMO\n\tXhKeilq3KEeCA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1647981964;\n\tbh=xSeXVwGP6mYHf/FK9rAB4epHRpaMltmzC3eZmO7xvS0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=gufZ7PpuVzcgAZ5jsJEvuCoxld8M9UYzR9HkFoHG1skrzrdI+2OyKORO402xm7MIp\n\tcTx+RHml/37nMZj12ZIUaGoJoE82efmdH7GTiSMgrqBYLSxiqCE4vGTE7ZYnd+C+Xq\n\trC7WITgxbt+hJENgQDSbqJej/WNmhvERdKk8h130="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"gufZ7Ppu\"; dkim-atps=neutral","Date":"Tue, 22 Mar 2022 22:45:47 +0200","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<Yjo1ezmtrRISFXIK@pendragon.ideasonboard.com>","References":"<20220322131635.2869526-1-naush@raspberrypi.com>\n\t<20220322131635.2869526-2-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220322131635.2869526-2-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v1 1/3] utils: timer: Allow\n\tTimer::start to use utils::Duration","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22386,"web_url":"https://patchwork.libcamera.org/comment/22386/","msgid":"<CAEmqJPpOONeAkrzR2H3RgtqfjfNzNxQiCgZSnP2NcSVAxQ6Uww@mail.gmail.com>","date":"2022-03-23T09:07:30","subject":"Re: [libcamera-devel] [PATCH v1 1/3] utils: timer: Allow\n\tTimer::start to use utils::Duration","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Laurent,\n\n\nOn Tue, 22 Mar 2022 at 20:46, Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> Hi Naush,\n>\n> Thank you for the patch.\n>\n> On Tue, Mar 22, 2022 at 01:16:33PM +0000, Naushir Patuck via\n> libcamera-devel wrote:\n> > Add an overload of the Timer::start member function to accept a\n> utils::Duration\n> > type for the timer duration.\n>\n> I'm actually considering moving the Duration class from libcamera-base to\n> libcamera. The rationale is that the class picks one particular\n> representation of a duration that we deem suitable for the libcamera\n> public API. It is of limited usefulness in the base library itself, as\n> it's not generic. This would prevent the Timer class from using it. How\n> much hassle is it to use the Timer class in subsequent patches in this\n> series if we dropped this start() overload ?\n>\n\nAs mentioned earlier, there is minimal hassle if we decide not to use\nutils::Duration\nin this API, so I am ok with it.\n\nHowever, utils::Duration is very nice, so I was curious what would make it\nunusable\nhere if it were in the public API? Would this affect our usage in the IPA\nas well?  The\nIPA does make significant use of utils::Duration, it would be painful to\nstop using it\nthere.\n\nRegards,\nNaush\n\n\n>\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > ---\n> >  include/libcamera/base/timer.h |  2 ++\n> >  src/libcamera/base/timer.cpp   | 14 ++++++++++++++\n> >  2 files changed, 16 insertions(+)\n> >\n> > diff --git a/include/libcamera/base/timer.h\n> b/include/libcamera/base/timer.h\n> > index 09f1d3229bd5..f42a8cfd4d6d 100644\n> > --- a/include/libcamera/base/timer.h\n> > +++ b/include/libcamera/base/timer.h\n> > @@ -14,6 +14,7 @@\n> >\n> >  #include <libcamera/base/object.h>\n> >  #include <libcamera/base/signal.h>\n> > +#include <libcamera/base/utils.h>\n> >\n> >  namespace libcamera {\n> >\n> > @@ -27,6 +28,7 @@ public:\n> >\n> >       void start(unsigned int msec) {\n> start(std::chrono::milliseconds(msec)); }\n> >       void start(std::chrono::milliseconds duration);\n> > +     void start(utils::Duration duration);\n> >       void start(std::chrono::steady_clock::time_point deadline);\n> >       void stop();\n> >       bool isRunning() const;\n> > diff --git a/src/libcamera/base/timer.cpp b/src/libcamera/base/timer.cpp\n> > index 187336e3a1a4..3ff526aea8ae 100644\n> > --- a/src/libcamera/base/timer.cpp\n> > +++ b/src/libcamera/base/timer.cpp\n> > @@ -85,6 +85,20 @@ void Timer::start(std::chrono::milliseconds duration)\n> >       start(utils::clock::now() + duration);\n> >  }\n> >\n> > +/**\n> > + * \\brief Start or restart the timer with a timeout of \\a duration\n> > + * \\param[in] duration The timer duration given by \\a utils::Duration\n> > + *\n> > + * If the timer is already running it will be stopped and restarted.\n> > + *\n> > + * \\context This function is \\threadbound.\n> > + */\n> > +void Timer::start(utils::Duration duration)\n> > +{\n> > +     auto msec =\n> std::chrono::duration_cast<std::chrono::milliseconds>(duration);\n> > +     start(utils::clock::now() + msec);\n> > +}\n> > +\n> >  /**\n> >   * \\brief Start or restart the timer with a \\a deadline\n> >   * \\param[in] deadline The timer deadline\n>\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 BDAA2C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 23 Mar 2022 09:07:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3BDDB604D5;\n\tWed, 23 Mar 2022 10:07:50 +0100 (CET)","from mail-lj1-x236.google.com (mail-lj1-x236.google.com\n\t[IPv6:2a00:1450:4864:20::236])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A7032601F8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Mar 2022 10:07:48 +0100 (CET)","by mail-lj1-x236.google.com with SMTP id b5so913701ljf.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Mar 2022 02:07:48 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648026470;\n\tbh=lHXJsFBvsZ4Qi+vxwB9BBTqe+y0PAKNVLfEjQJn5758=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=uoqm2Jn0eDYrQCCtptU/pRuuBLLMPJMFL9Tvqb8T0XaIUNF0LL8jD2NegYkYul8GZ\n\tJe52x6Z8Jm53va9YJB0AiWF5Lh5lXJxkgDhddVsWmB646E1ylmFv/Ul0WU0a4ZeVwF\n\tBsEgShjG8qxe6R8De7tj0JYtliJlOs9gpXmaCy9vi1d15KrapSo/hyxHhDEWI6ABcQ\n\tcz+YTbVzvliwctxpCeo/uW9O4ac4ZNtg+TQT2uaqIO5HyiP/R2ZdXKTzhVoUfDm7YP\n\tNkasgK6juH/mceWwdtkRs2T+f8l6UHiGdhaKR5uZLjw5JyFjMgKGjCiMeclNrvJiZ6\n\tGRhnFsHxGUNSw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=hj1jUP41f2v86fYttSu/RU7cM6bCsKGUsct1V4xk44I=;\n\tb=EqT8Jo6S1I6mgnpot64iYZ04s+IQPGkXFv+Tb8QTPdrbvtR6mOVdtEx9rvMvUPzv6W\n\t+AfUTReslibMtU1X4BtfH0nb6lpMxEmn6gk+awuz7Tv6bIwim6L8mNhffw+xIPo/YG9V\n\tOm++r3XKn3KyjuwHE1N085BbGQqMpGleh6pjC/kphQ6MADykOhEZP4M9X+MGdVwEl9VA\n\tAwCGUFTFx+lqjGyIeqlfBZJii345mde6WarTb0khOl9ZpLFYevxIkDSEZMreDH/1Zyxl\n\tdQpDEfcRasRX/zpJsnF0/vi0gLdE/EtjlYCtTMOGz2E7F/KPxp39ViUe5gVr3XD0Sktw\n\tXq5A=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"EqT8Jo6S\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=hj1jUP41f2v86fYttSu/RU7cM6bCsKGUsct1V4xk44I=;\n\tb=ghLQv7nM0TbXAByU3+1qzTR00cCy2Zzpw9qRdPSMlaMCwWLI97UZek/WvsxxYNMI/9\n\tY9LTw0WA01lpls+D5PtRWvPehKLanXAL8kRla/fqDtIrK2F8pmInXLWcIXnrYMEKuz+l\n\t6HLE3kq2cugWBUnaFpgWCJcLHBHgWRhDCLzD/I/I0Jb3jn881ExzKZ+iaGiWLPjiTkza\n\t0p4ujQX0gWNDUb4oItPL62EbsCL7cNjhK9FEwyREm4K3oNlMHFBTlHDC9yN3iXrVyg69\n\tvQtWZj8/uSeYxpx17oSK2OwqnOW0cKTMyN4o+jcPpxzMgP0kXngawdjniTuUws1hwoSq\n\t67ng==","X-Gm-Message-State":"AOAM530UnPV5/FoN99AnC+YV+aaSaGQVf8eNYwDFaBpIpzhEP3txvF5q\n\tDjkb1XNRLA/zFhoo7i1HAkbzw0KOx8mvGNsN9Ric35rqXJw=","X-Google-Smtp-Source":"ABdhPJxLhNutKRmkvMAcecIYfPCPS0ngd36tTiwEXVERjrYt/Ea50bNN/+DRc+e7L4+fdzPNaUHzzmyal1ILN2PNXe8=","X-Received":"by 2002:a2e:a54d:0:b0:249:8dd1:9da1 with SMTP id\n\te13-20020a2ea54d000000b002498dd19da1mr6462107ljn.372.1648026466708;\n\tWed, 23 Mar 2022 02:07:46 -0700 (PDT)","MIME-Version":"1.0","References":"<20220322131635.2869526-1-naush@raspberrypi.com>\n\t<20220322131635.2869526-2-naush@raspberrypi.com>\n\t<Yjo1ezmtrRISFXIK@pendragon.ideasonboard.com>","In-Reply-To":"<Yjo1ezmtrRISFXIK@pendragon.ideasonboard.com>","Date":"Wed, 23 Mar 2022 09:07:30 +0000","Message-ID":"<CAEmqJPpOONeAkrzR2H3RgtqfjfNzNxQiCgZSnP2NcSVAxQ6Uww@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"00000000000021007305dadf1024\"","Subject":"Re: [libcamera-devel] [PATCH v1 1/3] utils: timer: Allow\n\tTimer::start to use utils::Duration","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22402,"web_url":"https://patchwork.libcamera.org/comment/22402/","msgid":"<Yjr8DZyALptt5FKp@pendragon.ideasonboard.com>","date":"2022-03-23T10:53:01","subject":"Re: [libcamera-devel] [PATCH v1 1/3] utils: timer: Allow\n\tTimer::start to use utils::Duration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nOn Wed, Mar 23, 2022 at 09:07:30AM +0000, Naushir Patuck wrote:\n> On Tue, 22 Mar 2022 at 20:46, Laurent Pinchart wrote:\n> > On Tue, Mar 22, 2022 at 01:16:33PM +0000, Naushir Patuck via\n> > libcamera-devel wrote:\n> > > Add an overload of the Timer::start member function to accept a\n> > utils::Duration\n> > > type for the timer duration.\n> >\n> > I'm actually considering moving the Duration class from libcamera-base to\n> > libcamera. The rationale is that the class picks one particular\n> > representation of a duration that we deem suitable for the libcamera\n> > public API. It is of limited usefulness in the base library itself, as\n> > it's not generic. This would prevent the Timer class from using it. How\n> > much hassle is it to use the Timer class in subsequent patches in this\n> > series if we dropped this start() overload ?\n> \n> As mentioned earlier, there is minimal hassle if we decide not to use utils::Duration\n> in this API, so I am ok with it.\n> \n> However, utils::Duration is very nice, so I was curious what would make it unusable\n> here if it were in the public API? Would this affect our usage in the IPA as well?  The\n> IPA does make significant use of utils::Duration, it would be painful to stop using it\n> there.\n\nYou can still use it in the IPA module, but you wouldn't be able to use\nit in the base layer itself, as it would be a libcamera concept, not a\nlibcamera-base (think of libcamera-based as our custom version of boost\n:-)) concept.\n\n> > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > ---\n> > >  include/libcamera/base/timer.h |  2 ++\n> > >  src/libcamera/base/timer.cpp   | 14 ++++++++++++++\n> > >  2 files changed, 16 insertions(+)\n> > >\n> > > diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h\n> > > index 09f1d3229bd5..f42a8cfd4d6d 100644\n> > > --- a/include/libcamera/base/timer.h\n> > > +++ b/include/libcamera/base/timer.h\n> > > @@ -14,6 +14,7 @@\n> > >\n> > >  #include <libcamera/base/object.h>\n> > >  #include <libcamera/base/signal.h>\n> > > +#include <libcamera/base/utils.h>\n> > >\n> > >  namespace libcamera {\n> > >\n> > > @@ -27,6 +28,7 @@ public:\n> > >\n> > >       void start(unsigned int msec) { start(std::chrono::milliseconds(msec)); }\n> > >       void start(std::chrono::milliseconds duration);\n> > > +     void start(utils::Duration duration);\n> > >       void start(std::chrono::steady_clock::time_point deadline);\n> > >       void stop();\n> > >       bool isRunning() const;\n> > > diff --git a/src/libcamera/base/timer.cpp b/src/libcamera/base/timer.cpp\n> > > index 187336e3a1a4..3ff526aea8ae 100644\n> > > --- a/src/libcamera/base/timer.cpp\n> > > +++ b/src/libcamera/base/timer.cpp\n> > > @@ -85,6 +85,20 @@ void Timer::start(std::chrono::milliseconds duration)\n> > >       start(utils::clock::now() + duration);\n> > >  }\n> > >\n> > > +/**\n> > > + * \\brief Start or restart the timer with a timeout of \\a duration\n> > > + * \\param[in] duration The timer duration given by \\a utils::Duration\n> > > + *\n> > > + * If the timer is already running it will be stopped and restarted.\n> > > + *\n> > > + * \\context This function is \\threadbound.\n> > > + */\n> > > +void Timer::start(utils::Duration duration)\n> > > +{\n> > > +     auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(duration);\n> > > +     start(utils::clock::now() + msec);\n> > > +}\n> > > +\n> > >  /**\n> > >   * \\brief Start or restart the timer with a \\a deadline\n> > >   * \\param[in] deadline The timer deadline","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 879FCBD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 23 Mar 2022 10:53:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E51CD604D5;\n\tWed, 23 Mar 2022 11:53:19 +0100 (CET)","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 41F18601F8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Mar 2022 11:53:19 +0100 (CET)","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 B07CC9DE;\n\tWed, 23 Mar 2022 11:53:18 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648032799;\n\tbh=eDnykzIrsj4kdNyCt9bB9x9KvuhRl4+5bMNxXzpRSag=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=hsn9n9ML+KtIZ1sU9chSSp7okqzZ1IBfrOmX/SefGQMW5TSAnJN/M4qaonlFPBnpA\n\tLAUO4XMsePIOn55c3+w+uT4goff91FYSssFRe137aFddx4BW5QJwsuaai+OmDqVDiS\n\tM3VuJN4xoekorOOO2tFU7YK5H8EhpEaHW5DDNviPnxx99hJLY3iLOQSFrVn6wBHI0j\n\ta8i/tAgyBR7klgRXPc9YVztToWCyOgEMNetDaPgw6dImitIqfbHNHI0LanaaH2+MFn\n\tPUxfu6ZecVsRJykzcdhrGHCcz4n5qefmdqZAsQn3F0hK1t91VPRfo2XloQtla/brEY\n\tw4sTFbsX3XQGA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1648032798;\n\tbh=eDnykzIrsj4kdNyCt9bB9x9KvuhRl4+5bMNxXzpRSag=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=f7eTwKUO+bK2ttNDNVqQot3KC9Bjd7tsxCKrvhJN1B8gI+WyjnebiGUOK2+LY+8xN\n\t/ZkATy8T0Jd1KL1gt5p5O1adcRMQeNssZcRwiCdvZf5O6lsfA/5C5J2eRCj1zV8dRW\n\tREpYvU7xEqh3wqdqOiu5Wutp1vjWUyRgMn+ilJu0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"f7eTwKUO\"; dkim-atps=neutral","Date":"Wed, 23 Mar 2022 12:53:01 +0200","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<Yjr8DZyALptt5FKp@pendragon.ideasonboard.com>","References":"<20220322131635.2869526-1-naush@raspberrypi.com>\n\t<20220322131635.2869526-2-naush@raspberrypi.com>\n\t<Yjo1ezmtrRISFXIK@pendragon.ideasonboard.com>\n\t<CAEmqJPpOONeAkrzR2H3RgtqfjfNzNxQiCgZSnP2NcSVAxQ6Uww@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAEmqJPpOONeAkrzR2H3RgtqfjfNzNxQiCgZSnP2NcSVAxQ6Uww@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v1 1/3] utils: timer: Allow\n\tTimer::start to use utils::Duration","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]