[{"id":22723,"web_url":"https://patchwork.libcamera.org/comment/22723/","msgid":"<CAOgh=FzK5bm8cBXF4=R5EzpDq94cnzPCZfxp-WpyUL_U-PKxmA@mail.gmail.com>","date":"2022-04-15T11:14:52","subject":"Re: [libcamera-devel] [PATCH v7 1/2] cam: event_loop: Add timer\n\tevents to event loop","submitter":{"id":101,"url":"https://patchwork.libcamera.org/api/people/101/","name":"Eric Curtin","email":"ecurtin@redhat.com"},"content":"Hi Guys,\n\nI know holidays are coming up. Just a friendly reminder if you get a\nchance to review.\n\nIs mise le meas/Regards,\n\nEric Curtin\n\n\nOn Fri, 8 Apr 2022 at 17:00, Eric Curtin <ecurtin@redhat.com> wrote:\n>\n> Extend the EventLoop class to support periodic timer events. This can be\n> used to run tasks periodically, such as handling the event loop of SDL.\n>\n> Signed-off-by: Eric Curtin <ecurtin@redhat.com>\n> ---\n>  src/cam/event_loop.cpp | 37 +++++++++++++++++++++++++++++++++----\n>  src/cam/event_loop.h   |  3 +++\n>  2 files changed, 36 insertions(+), 4 deletions(-)\n>\n> diff --git a/src/cam/event_loop.cpp b/src/cam/event_loop.cpp\n> index e25784c0..1e1a4269 100644\n> --- a/src/cam/event_loop.cpp\n> +++ b/src/cam/event_loop.cpp\n> @@ -60,6 +60,17 @@ void EventLoop::callLater(const std::function<void()> &func)\n>         event_base_once(base_, -1, EV_TIMEOUT, dispatchCallback, this, nullptr);\n>  }\n>\n> +int EventLoop::eventNew(const std::unique_ptr<Event> &event, const int fd, const short events)\n> +{\n> +       event->event_ = event_new(base_, fd, events, &EventLoop::Event::dispatch, event.get());\n> +       if (!event->event_) {\n> +               std::cerr << \"Failed to create event for fd \" << fd << std::endl;\n> +               return -EINVAL;\n> +       }\n> +\n> +       return 0;\n> +}\n> +\n>  void EventLoop::addEvent(int fd, EventType type,\n>                          const std::function<void()> &callback)\n>  {\n> @@ -68,10 +79,7 @@ void EventLoop::addEvent(int fd, EventType type,\n>                      | (type & Write ? EV_WRITE : 0)\n>                      | EV_PERSIST;\n>\n> -       event->event_ = event_new(base_, fd, events, &EventLoop::Event::dispatch,\n> -                                 event.get());\n> -       if (!event->event_) {\n> -               std::cerr << \"Failed to create event for fd \" << fd << std::endl;\n> +       if (eventNew(event, fd, events)) {\n>                 return;\n>         }\n>\n> @@ -84,6 +92,27 @@ void EventLoop::addEvent(int fd, EventType type,\n>         events_.push_back(std::move(event));\n>  }\n>\n> +void EventLoop::addTimerEvent(const suseconds_t period,\n> +                             const std::function<void()> &callback)\n> +{\n> +       std::unique_ptr<Event> event = std::make_unique<Event>(callback);\n> +       if (eventNew(event, -1, EV_PERSIST)) {\n> +               return;\n> +       }\n> +\n> +       struct timeval tv;\n> +       tv.tv_sec = 0;\n> +       tv.tv_usec = period;\n> +\n> +       int ret = event_add(event->event_, &tv);\n> +       if (ret < 0) {\n> +               std::cerr << \"Failed to add timer event\" << std::endl;\n> +               return;\n> +       }\n> +\n> +       events_.push_back(std::move(event));\n> +}\n> +\n>  void EventLoop::dispatchCallback([[maybe_unused]] evutil_socket_t fd,\n>                                  [[maybe_unused]] short flags, void *param)\n>  {\n> diff --git a/src/cam/event_loop.h b/src/cam/event_loop.h\n> index a4613eb2..3d3561e5 100644\n> --- a/src/cam/event_loop.h\n> +++ b/src/cam/event_loop.h\n> @@ -36,6 +36,8 @@ public:\n>\n>         void addEvent(int fd, EventType type,\n>                       const std::function<void()> &handler);\n> +       void addTimerEvent(const suseconds_t period,\n> +                          const std::function<void()> &handler);\n>\n>  private:\n>         struct Event {\n> @@ -60,4 +62,5 @@ private:\n>         static void dispatchCallback(evutil_socket_t fd, short flags,\n>                                      void *param);\n>         void dispatchCall();\n> +       int eventNew(const std::unique_ptr<Event> &event, const int fd, const short events);\n>  };\n> --\n> 2.35.1\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 CCF00C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Apr 2022 11:15:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E13C3604AF;\n\tFri, 15 Apr 2022 13:15:13 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ABC9160207\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Apr 2022 13:15:11 +0200 (CEST)","from mail-oi1-f198.google.com (mail-oi1-f198.google.com\n\t[209.85.167.198]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-534-gYZcqh3ANnKcjt7mLvdIYA-1; Fri, 15 Apr 2022 07:15:09 -0400","by mail-oi1-f198.google.com with SMTP id\n\tu72-20020acaab4b000000b00322281df7faso1172710oie.14\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Apr 2022 04:15:08 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650021313;\n\tbh=qABpT9h38i7++kJDYYtGxj9HNpVtpQGlenkVyvDH4gE=;\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=y9l2suBTLSTOGYxO0cMpak6O95i5NuUi7ZRhrVIAj9cloedU5dsZueT9a6jz9obhM\n\tJB+sW3AJ3TyfntZtEfm0xIztowbT2UhPb6vqGzMAaiuWdivJcJs7wGH3clYAn4W+oX\n\tOKWTaG78fesHkcm+i/bJcnzNICepVuUJG5nSeXW+WiJWFN1OAx8Wu/vBQNtkJiDDzq\n\tgxBe9T0867wvq8gH6EMug4CaHkoFu1BNejMtk+HmFo8mAku8qqSgDx6G/YJ0vmiIRe\n\t6kImATyk4B3nImuL5cIYpAP3ptSaPPzy86c8HkNuIw61g4BjbHwmdHAEE7eu50T0Gz\n\twCSbmNjaDJhmw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1650021310;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=UpDW7LRCqbY1+EUvuV/pbI7HYGdADj8qQbRo4R8sfdM=;\n\tb=RSZrwLEhpRk7E7X6nZ8fZOHP4kfjkBnNNQ8ZKfCNs1c6Jo9aMF1yUc9D5YFCEWQcCQM8Dx\n\tZeG+tt29GKp9CnK4XzvDzHTry4/h1i8n0429lE/FkIpLm8TpP3j6qt7Vd6G6K4pGfZ85jo\n\t/jq4MmUH6JHG7nsth7Yiuna5royJZ8o="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"RSZrwLEh\"; \n\tdkim-atps=neutral","relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ecurtin@redhat.com"],"X-MC-Unique":"gYZcqh3ANnKcjt7mLvdIYA-1","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=UpDW7LRCqbY1+EUvuV/pbI7HYGdADj8qQbRo4R8sfdM=;\n\tb=rXTBBT8hVqKUkUx2h+YYc8m7cY/vzYrUvsK5z2WMFMrR1gWoyo+r1VBjefJzEgV6SF\n\tLZJA088faHFZ8i/s2/oCmc80UMU0A8boK0OsNVWRwFC+mUaEGr2fW3F+ta30PEXBtP7i\n\tUEJtgm42pN9XZVeErwClzIxWeM0x1EvpawKPcNjKD97JA2rU6arJ5uHj9UPz7sdhTkmb\n\t3xB4oPCliSJoHY4/qFwkMAUl/gYvha0UKIxNfIZ0ZEcOB+P8F8+XcDeYLjIdM9fg6tHx\n\tUPvP7KnIIJkHZ/ES96IYQUPkCBaxGjd5s6Dv8UPS1kqfKkkkkcWtVngI+C+v7lIjF41a\n\t18Tw==","X-Gm-Message-State":"AOAM5307NAZOkBJsH9ToTp2QouaEQPY8e4B7V5NuqzLcRXBCtlmpIs0g\n\tBxNM3mA9Y6Kg0FCQXjWUhSF6f5xDFkr1TBBgYcHShEKm8qwZa68IfdwKqvvGGUht4jsgz8X+m2A\n\tzjrqrFJh1+pJrmOIoSHco+zP+xhHRuuGyhjH/DL5LVhhWzP4/FQ==","X-Received":["by 2002:a05:6808:14c1:b0:2fa:72d6:5dfa with SMTP id\n\tf1-20020a05680814c100b002fa72d65dfamr1334146oiw.182.1650021308118; \n\tFri, 15 Apr 2022 04:15:08 -0700 (PDT)","by 2002:a05:6808:14c1:b0:2fa:72d6:5dfa with SMTP id\n\tf1-20020a05680814c100b002fa72d65dfamr1334137oiw.182.1650021307883;\n\tFri, 15 Apr 2022 04:15:07 -0700 (PDT)"],"X-Google-Smtp-Source":"ABdhPJwqArygkhOHOpL9RdP4X4yW9CoyixRowbtVCVAlU0uqToAxtTFM2CwRq6aNQPp6VYHtjBh2W60axNZij+TWwTo=","MIME-Version":"1.0","References":"<20220408160015.33612-1-ecurtin@redhat.com>","In-Reply-To":"<20220408160015.33612-1-ecurtin@redhat.com>","Date":"Fri, 15 Apr 2022 12:14:52 +0100","Message-ID":"<CAOgh=FzK5bm8cBXF4=R5EzpDq94cnzPCZfxp-WpyUL_U-PKxmA@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v7 1/2] cam: event_loop: Add timer\n\tevents to event loop","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":"Eric Curtin via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Eric Curtin <ecurtin@redhat.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":22728,"web_url":"https://patchwork.libcamera.org/comment/22728/","msgid":"<YlmchwdQP4fxaVc1@pendragon.ideasonboard.com>","date":"2022-04-15T16:25:43","subject":"Re: [libcamera-devel] [PATCH v7 1/2] cam: event_loop: Add timer\n\tevents to event loop","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Eric,\n\nThank you for the patch.\n\nOn Fri, Apr 08, 2022 at 05:00:14PM +0100, Eric Curtin via libcamera-devel wrote:\n> Extend the EventLoop class to support periodic timer events. This can be\n> used to run tasks periodically, such as handling the event loop of SDL.\n> \n> Signed-off-by: Eric Curtin <ecurtin@redhat.com>\n> ---\n>  src/cam/event_loop.cpp | 37 +++++++++++++++++++++++++++++++++----\n>  src/cam/event_loop.h   |  3 +++\n>  2 files changed, 36 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/cam/event_loop.cpp b/src/cam/event_loop.cpp\n> index e25784c0..1e1a4269 100644\n> --- a/src/cam/event_loop.cpp\n> +++ b/src/cam/event_loop.cpp\n> @@ -60,6 +60,17 @@ void EventLoop::callLater(const std::function<void()> &func)\n>  \tevent_base_once(base_, -1, EV_TIMEOUT, dispatchCallback, this, nullptr);\n>  }\n>  \n> +int EventLoop::eventNew(const std::unique_ptr<Event> &event, const int fd, const short events)\n> +{\n> +\tevent->event_ = event_new(base_, fd, events, &EventLoop::Event::dispatch, event.get());\n> +\tif (!event->event_) {\n> +\t\tstd::cerr << \"Failed to create event for fd \" << fd << std::endl;\n\nThis message will be a bit confusing for timer events, as it will print\n\n\tFailed to create event for fd -1\n\nAs there's really no other code sharing in this function, how about\ndropping it, keeping addEvent() unchanged, and called event_new()\ndirectlry in addTimerEvent() with a more appropriate message (such as\n\"Failed to create timer event\") ?\n\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n> +\treturn 0;\n> +}\n> +\n>  void EventLoop::addEvent(int fd, EventType type,\n>  \t\t\t const std::function<void()> &callback)\n>  {\n> @@ -68,10 +79,7 @@ void EventLoop::addEvent(int fd, EventType type,\n>  \t\t     | (type & Write ? EV_WRITE : 0)\n>  \t\t     | EV_PERSIST;\n>  \n> -\tevent->event_ = event_new(base_, fd, events, &EventLoop::Event::dispatch,\n> -\t\t\t\t  event.get());\n> -\tif (!event->event_) {\n> -\t\tstd::cerr << \"Failed to create event for fd \" << fd << std::endl;\n> +\tif (eventNew(event, fd, events)) {\n>  \t\treturn;\n>  \t}\n>  \n> @@ -84,6 +92,27 @@ void EventLoop::addEvent(int fd, EventType type,\n>  \tevents_.push_back(std::move(event));\n>  }\n>  \n> +void EventLoop::addTimerEvent(const suseconds_t period,\n> +\t\t\t      const std::function<void()> &callback)\n> +{\n> +\tstd::unique_ptr<Event> event = std::make_unique<Event>(callback);\n> +\tif (eventNew(event, -1, EV_PERSIST)) {\n> +\t\treturn;\n> +\t}\n> +\n> +\tstruct timeval tv;\n> +\ttv.tv_sec = 0;\n> +\ttv.tv_usec = period;\n> +\n> +\tint ret = event_add(event->event_, &tv);\n> +\tif (ret < 0) {\n> +\t\tstd::cerr << \"Failed to add timer event\" << std::endl;\n> +\t\treturn;\n> +\t}\n> +\n> +\tevents_.push_back(std::move(event));\n> +}\n> +\n>  void EventLoop::dispatchCallback([[maybe_unused]] evutil_socket_t fd,\n>  \t\t\t\t [[maybe_unused]] short flags, void *param)\n>  {\n> diff --git a/src/cam/event_loop.h b/src/cam/event_loop.h\n> index a4613eb2..3d3561e5 100644\n> --- a/src/cam/event_loop.h\n> +++ b/src/cam/event_loop.h\n> @@ -36,6 +36,8 @@ public:\n>  \n>  \tvoid addEvent(int fd, EventType type,\n>  \t\t      const std::function<void()> &handler);\n> +\tvoid addTimerEvent(const suseconds_t period,\n\nThis could be called addEvent() too, C++ will pick the right function.\nThe name addTimerEvent() makes the code more explicit though, which is\nnice, but I'd then rename addEvent to addFdEvent() (in a patch before\nthis one).\n\n> +\t\t\t   const std::function<void()> &handler);\n>  \n>  private:\n>  \tstruct Event {\n> @@ -60,4 +62,5 @@ private:\n>  \tstatic void dispatchCallback(evutil_socket_t fd, short flags,\n>  \t\t\t\t     void *param);\n>  \tvoid dispatchCall();\n> +\tint eventNew(const std::unique_ptr<Event> &event, const int fd, const short events);\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 C4DB8C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Apr 2022 16:25:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 35338604B4;\n\tFri, 15 Apr 2022 18:25:52 +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 95EAE60207\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Apr 2022 18:25:50 +0200 (CEST)","from pendragon.ideasonboard.com (85-76-64-137-nat.elisa-mobile.fi\n\t[85.76.64.137])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7A56C482;\n\tFri, 15 Apr 2022 18:25:49 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650039952;\n\tbh=NsvkOy5HgJWhx6QgL1ZmKLjR4uAM51k9phg0F9Ebk/8=;\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=gUFRbBDrj+Oj2kVu6Qaar1UE0qQspRdWPXqxmSUeAvARtAQSV9rGmI+rvEVs/B0ls\n\tXRYpfp/kgxd051cSKZVf5rQbnyXW6EcJOK5c/wE13FfU6Cmv7zfhff9bKqwy9xffa5\n\tqnj76DHG4BaOfr6QyChnnuQWMTte5vHTZQ/b3lQXAGsbCeqPqJBxE78tymEpJZKJqr\n\tZJMHnaraEEI9akhPMsNmcQT+77XtgbAgEgv82Qcqd/yv3DVHyiPn8/tbDkLferxNyx\n\t2rpzqJMHg1u3nPC1W/UKidcCopnown24aOmhyHepHJv9kjKMsdQRWF+uQBuDoeExL9\n\t2wgFdK8tpdW6w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1650039950;\n\tbh=NsvkOy5HgJWhx6QgL1ZmKLjR4uAM51k9phg0F9Ebk/8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=HgbTtABsxyK7wrWpMZhgFvbWScn0RkMLOJmQhzk6e/I6ZIzZDQLeoTWwxUX7OZ4lz\n\ti5vH4WZMLwJKxdo9OwOq87LDMqhbbAW9eMW83pnTVbafDMrcBxTdurC4w3aNCmDf47\n\t1R/fuPzPYO4ntTaAocmpeAQZkjKxbuphmKr7cEkM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"HgbTtABs\"; dkim-atps=neutral","Date":"Fri, 15 Apr 2022 19:25:43 +0300","To":"Eric Curtin <ecurtin@redhat.com>","Message-ID":"<YlmchwdQP4fxaVc1@pendragon.ideasonboard.com>","References":"<20220408160015.33612-1-ecurtin@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220408160015.33612-1-ecurtin@redhat.com>","Subject":"Re: [libcamera-devel] [PATCH v7 1/2] cam: event_loop: Add timer\n\tevents to event loop","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":22741,"web_url":"https://patchwork.libcamera.org/comment/22741/","msgid":"<CAOgh=FziGsbMTEx44c9rYZEbi6ksPAwN4=3RSvg04wneMbjPoQ@mail.gmail.com>","date":"2022-04-19T14:48:54","subject":"Re: [libcamera-devel] [PATCH v7 1/2] cam: event_loop: Add timer\n\tevents to event loop","submitter":{"id":101,"url":"https://patchwork.libcamera.org/api/people/101/","name":"Eric Curtin","email":"ecurtin@redhat.com"},"content":"On Fri, 15 Apr 2022 at 17:25, Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hi Eric,\n>\n> Thank you for the patch.\n>\n> On Fri, Apr 08, 2022 at 05:00:14PM +0100, Eric Curtin via libcamera-devel wrote:\n> > Extend the EventLoop class to support periodic timer events. This can be\n> > used to run tasks periodically, such as handling the event loop of SDL.\n> >\n> > Signed-off-by: Eric Curtin <ecurtin@redhat.com>\n> > ---\n> >  src/cam/event_loop.cpp | 37 +++++++++++++++++++++++++++++++++----\n> >  src/cam/event_loop.h   |  3 +++\n> >  2 files changed, 36 insertions(+), 4 deletions(-)\n> >\n> > diff --git a/src/cam/event_loop.cpp b/src/cam/event_loop.cpp\n> > index e25784c0..1e1a4269 100644\n> > --- a/src/cam/event_loop.cpp\n> > +++ b/src/cam/event_loop.cpp\n> > @@ -60,6 +60,17 @@ void EventLoop::callLater(const std::function<void()> &func)\n> >       event_base_once(base_, -1, EV_TIMEOUT, dispatchCallback, this, nullptr);\n> >  }\n> >\n> > +int EventLoop::eventNew(const std::unique_ptr<Event> &event, const int fd, const short events)\n> > +{\n> > +     event->event_ = event_new(base_, fd, events, &EventLoop::Event::dispatch, event.get());\n> > +     if (!event->event_) {\n> > +             std::cerr << \"Failed to create event for fd \" << fd << std::endl;\n>\n> This message will be a bit confusing for timer events, as it will print\n>\n>         Failed to create event for fd -1\n>\n> As there's really no other code sharing in this function, how about\n> dropping it, keeping addEvent() unchanged, and called event_new()\n> directlry in addTimerEvent() with a more appropriate message (such as\n> \"Failed to create timer event\") ?\n>\n> > +             return -EINVAL;\n> > +     }\n> > +\n> > +     return 0;\n> > +}\n> > +\n> >  void EventLoop::addEvent(int fd, EventType type,\n> >                        const std::function<void()> &callback)\n> >  {\n> > @@ -68,10 +79,7 @@ void EventLoop::addEvent(int fd, EventType type,\n> >                    | (type & Write ? EV_WRITE : 0)\n> >                    | EV_PERSIST;\n> >\n> > -     event->event_ = event_new(base_, fd, events, &EventLoop::Event::dispatch,\n> > -                               event.get());\n> > -     if (!event->event_) {\n> > -             std::cerr << \"Failed to create event for fd \" << fd << std::endl;\n> > +     if (eventNew(event, fd, events)) {\n> >               return;\n> >       }\n> >\n> > @@ -84,6 +92,27 @@ void EventLoop::addEvent(int fd, EventType type,\n> >       events_.push_back(std::move(event));\n> >  }\n> >\n> > +void EventLoop::addTimerEvent(const suseconds_t period,\n> > +                           const std::function<void()> &callback)\n> > +{\n> > +     std::unique_ptr<Event> event = std::make_unique<Event>(callback);\n> > +     if (eventNew(event, -1, EV_PERSIST)) {\n> > +             return;\n> > +     }\n> > +\n> > +     struct timeval tv;\n> > +     tv.tv_sec = 0;\n> > +     tv.tv_usec = period;\n> > +\n> > +     int ret = event_add(event->event_, &tv);\n> > +     if (ret < 0) {\n> > +             std::cerr << \"Failed to add timer event\" << std::endl;\n> > +             return;\n> > +     }\n> > +\n> > +     events_.push_back(std::move(event));\n> > +}\n> > +\n> >  void EventLoop::dispatchCallback([[maybe_unused]] evutil_socket_t fd,\n> >                                [[maybe_unused]] short flags, void *param)\n> >  {\n> > diff --git a/src/cam/event_loop.h b/src/cam/event_loop.h\n> > index a4613eb2..3d3561e5 100644\n> > --- a/src/cam/event_loop.h\n> > +++ b/src/cam/event_loop.h\n> > @@ -36,6 +36,8 @@ public:\n> >\n> >       void addEvent(int fd, EventType type,\n> >                     const std::function<void()> &handler);\n> > +     void addTimerEvent(const suseconds_t period,\n>\n> This could be called addEvent() too, C++ will pick the right function.\n> The name addTimerEvent() makes the code more explicit though, which is\n> nice, but I'd then rename addEvent to addFdEvent() (in a patch before\n> this one).\n\nFunnily enough I started changing to addFdEvent, but then reverted as\nit was touching many files, and didn't want the patch to spread to so\nmany files. I'll go back to doing that.\n\n>\n> > +                        const std::function<void()> &handler);\n> >\n> >  private:\n> >       struct Event {\n> > @@ -60,4 +62,5 @@ private:\n> >       static void dispatchCallback(evutil_socket_t fd, short flags,\n> >                                    void *param);\n> >       void dispatchCall();\n> > +     int eventNew(const std::unique_ptr<Event> &event, const int fd, const short events);\n> >  };\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 594E7C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Apr 2022 14:49:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0DE3B65642;\n\tTue, 19 Apr 2022 16:49:15 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D02326563C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Apr 2022 16:49:13 +0200 (CEST)","from mail-oi1-f198.google.com (mail-oi1-f198.google.com\n\t[209.85.167.198]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-201-shEstNguOFCy8HmG6He0Bg-1; Tue, 19 Apr 2022 10:49:11 -0400","by mail-oi1-f198.google.com with SMTP id\n\tc11-20020aca1c0b000000b002da42e09f96so6120251oic.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Apr 2022 07:49:11 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650379755;\n\tbh=S+RWsg/lxdsSK5PQFSeSoTsagqDQ0R2vEzGmCcNMylU=;\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=kv4s0pw7ILzNFRcy9ULn/0xUztOmdYj/h7FVesg76eZdZfn7y64bMpau3kke8tjrJ\n\ta513p72Dju7Fr+nOpZQjs/wWAOEe9ILuBuJJomqy1xYJWxwoYltjvnzdc1242MsBXv\n\tTP15cfomTipwelc7TC60qfvvlCoFX+YRMFuxqw4KWILkZQOAeS3viUN2mU47gZrkjt\n\tdKQva6nEyUQpX/B/FejmZSC1owHjcVyZQWkDx5WPEO4r5ekmPTjoCaJ/15OIau7g4u\n\t51z8+JcqGFhkK6wEW5vGpEEdh+361siPAnLfjjexgkgX7Imw/9VatS/RnGFDF0LzjJ\n\th1MHBwWqtveZQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1650379752;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=eQl+2MHPwuNUFqXzZ0TqL224A74UP7Pe4uQ1Uwaq/ts=;\n\tb=RPehJ3BwHydn9tuJxzH8aWD9ODQE1+n5AO8V7TuoJJmaEQaiDg9ATqPLymx+7mbOcn8oFq\n\tlln6DCoecJPyk8r6xphQfbJfwUPHd07KnZQ+abgyqitGsd7I2u9lW6g3ZYKEjQnUkJDZgF\n\teIg3LwAimw5ovpyolGl0Ml+TDlHgBvg="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"RPehJ3Bw\"; \n\tdkim-atps=neutral","relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ecurtin@redhat.com"],"X-MC-Unique":"shEstNguOFCy8HmG6He0Bg-1","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=eQl+2MHPwuNUFqXzZ0TqL224A74UP7Pe4uQ1Uwaq/ts=;\n\tb=dM8OCOQFqNbGQb/PuxKvPqTu/ECMtmGNEuk47AtHchAY4p4eNaJ3cNv3Oq8yTHOydD\n\tu9v91SzR5X9zQOmw3hxigs6WbRtQfbQwTYcRaGr/ZKbhTzxhG9PIZcOP74ti33Mp8mpW\n\tYoDIZ2+i3C7Q5iJEp3aaPggSF3ROkBqraXtu5t/D35myWIGpjvXGnA1MlEGNEBWDuF0b\n\twR39f/AK50Q5hMJlc1ThAsCAkodjLzjplvjNlCmYv386RKoIlDClbfZ063XtNKcuejtS\n\tc2bNpXPkB5Od6kLDef3B1dgxBpFHpPstL4scdPSKzDzbQYl41ZDfCxZUSUNngjp3u7uM\n\taGgg==","X-Gm-Message-State":"AOAM530mfph54hWiL4emcwTkbl5GvTD3qAAAQGKhhAZ/oerK6Dgbc/Xr\n\typxFYdhkzF8dfH0De4CfolHdepzBIksOYHzdCpt15dyj9yL+6cpIW4eFkLjbp990HLEIiw8IDpx\n\toFwLyUmNpGvAVZeHFcoZt7e7PD6XT76PdVIeRm+bAUm9cwdIktA==","X-Received":["by 2002:a05:6870:f624:b0:e1:c071:121c with SMTP id\n\tek36-20020a056870f62400b000e1c071121cmr6740737oab.182.1650379750337; \n\tTue, 19 Apr 2022 07:49:10 -0700 (PDT)","by 2002:a05:6870:f624:b0:e1:c071:121c with SMTP id\n\tek36-20020a056870f62400b000e1c071121cmr6740732oab.182.1650379750128;\n\tTue, 19 Apr 2022 07:49:10 -0700 (PDT)"],"X-Google-Smtp-Source":"ABdhPJxDc8rx8+WqRgqBJ/wzuBtd2o87Et9KcLjcJSIrQHhkNpEArP/7x7I3KWMasj6tEUcPPTq/u2f/7SC89+U2fcA=","MIME-Version":"1.0","References":"<20220408160015.33612-1-ecurtin@redhat.com>\n\t<YlmchwdQP4fxaVc1@pendragon.ideasonboard.com>","In-Reply-To":"<YlmchwdQP4fxaVc1@pendragon.ideasonboard.com>","Date":"Tue, 19 Apr 2022 15:48:54 +0100","Message-ID":"<CAOgh=FziGsbMTEx44c9rYZEbi6ksPAwN4=3RSvg04wneMbjPoQ@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v7 1/2] cam: event_loop: Add timer\n\tevents to event loop","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":"Eric Curtin via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Eric Curtin <ecurtin@redhat.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":22743,"web_url":"https://patchwork.libcamera.org/comment/22743/","msgid":"<165038175460.2548121.4270791333427932519@Monstersaurus>","date":"2022-04-19T15:22:34","subject":"Re: [libcamera-devel] [PATCH v7 1/2] cam: event_loop: Add timer\n\tevents to event loop","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Eric Curtin via libcamera-devel (2022-04-19 15:48:54)\n> On Fri, 15 Apr 2022 at 17:25, Laurent Pinchart\n> <laurent.pinchart@ideasonboard.com> wrote:\n> >\n> > Hi Eric,\n> >\n> > Thank you for the patch.\n> >\n> > On Fri, Apr 08, 2022 at 05:00:14PM +0100, Eric Curtin via libcamera-devel wrote:\n> > > Extend the EventLoop class to support periodic timer events. This can be\n> > > used to run tasks periodically, such as handling the event loop of SDL.\n> > >\n> > > Signed-off-by: Eric Curtin <ecurtin@redhat.com>\n> > > ---\n> > >  src/cam/event_loop.cpp | 37 +++++++++++++++++++++++++++++++++----\n> > >  src/cam/event_loop.h   |  3 +++\n> > >  2 files changed, 36 insertions(+), 4 deletions(-)\n> > >\n> > > diff --git a/src/cam/event_loop.cpp b/src/cam/event_loop.cpp\n> > > index e25784c0..1e1a4269 100644\n> > > --- a/src/cam/event_loop.cpp\n> > > +++ b/src/cam/event_loop.cpp\n> > > @@ -60,6 +60,17 @@ void EventLoop::callLater(const std::function<void()> &func)\n> > >       event_base_once(base_, -1, EV_TIMEOUT, dispatchCallback, this, nullptr);\n> > >  }\n> > >\n> > > +int EventLoop::eventNew(const std::unique_ptr<Event> &event, const int fd, const short events)\n> > > +{\n> > > +     event->event_ = event_new(base_, fd, events, &EventLoop::Event::dispatch, event.get());\n> > > +     if (!event->event_) {\n> > > +             std::cerr << \"Failed to create event for fd \" << fd << std::endl;\n> >\n> > This message will be a bit confusing for timer events, as it will print\n> >\n> >         Failed to create event for fd -1\n> >\n> > As there's really no other code sharing in this function, how about\n> > dropping it, keeping addEvent() unchanged, and called event_new()\n> > directlry in addTimerEvent() with a more appropriate message (such as\n> > \"Failed to create timer event\") ?\n> >\n> > > +             return -EINVAL;\n> > > +     }\n> > > +\n> > > +     return 0;\n> > > +}\n> > > +\n> > >  void EventLoop::addEvent(int fd, EventType type,\n> > >                        const std::function<void()> &callback)\n> > >  {\n> > > @@ -68,10 +79,7 @@ void EventLoop::addEvent(int fd, EventType type,\n> > >                    | (type & Write ? EV_WRITE : 0)\n> > >                    | EV_PERSIST;\n> > >\n> > > -     event->event_ = event_new(base_, fd, events, &EventLoop::Event::dispatch,\n> > > -                               event.get());\n> > > -     if (!event->event_) {\n> > > -             std::cerr << \"Failed to create event for fd \" << fd << std::endl;\n> > > +     if (eventNew(event, fd, events)) {\n> > >               return;\n> > >       }\n> > >\n> > > @@ -84,6 +92,27 @@ void EventLoop::addEvent(int fd, EventType type,\n> > >       events_.push_back(std::move(event));\n> > >  }\n> > >\n> > > +void EventLoop::addTimerEvent(const suseconds_t period,\n> > > +                           const std::function<void()> &callback)\n> > > +{\n> > > +     std::unique_ptr<Event> event = std::make_unique<Event>(callback);\n> > > +     if (eventNew(event, -1, EV_PERSIST)) {\n> > > +             return;\n> > > +     }\n> > > +\n> > > +     struct timeval tv;\n> > > +     tv.tv_sec = 0;\n> > > +     tv.tv_usec = period;\n> > > +\n> > > +     int ret = event_add(event->event_, &tv);\n> > > +     if (ret < 0) {\n> > > +             std::cerr << \"Failed to add timer event\" << std::endl;\n> > > +             return;\n> > > +     }\n> > > +\n> > > +     events_.push_back(std::move(event));\n> > > +}\n> > > +\n> > >  void EventLoop::dispatchCallback([[maybe_unused]] evutil_socket_t fd,\n> > >                                [[maybe_unused]] short flags, void *param)\n> > >  {\n> > > diff --git a/src/cam/event_loop.h b/src/cam/event_loop.h\n> > > index a4613eb2..3d3561e5 100644\n> > > --- a/src/cam/event_loop.h\n> > > +++ b/src/cam/event_loop.h\n> > > @@ -36,6 +36,8 @@ public:\n> > >\n> > >       void addEvent(int fd, EventType type,\n> > >                     const std::function<void()> &handler);\n> > > +     void addTimerEvent(const suseconds_t period,\n> >\n> > This could be called addEvent() too, C++ will pick the right function.\n> > The name addTimerEvent() makes the code more explicit though, which is\n> > nice, but I'd then rename addEvent to addFdEvent() (in a patch before\n> > this one).\n> \n> Funnily enough I started changing to addFdEvent, but then reverted as\n> it was touching many files, and didn't want the patch to spread to so\n> many files. I'll go back to doing that.\n\nAs long as the rename for addFdEvent is in it's own patch, before this\none, that's fine I think.\n\n--\nKieran\n\n> \n> >\n> > > +                        const std::function<void()> &handler);\n> > >\n> > >  private:\n> > >       struct Event {\n> > > @@ -60,4 +62,5 @@ private:\n> > >       static void dispatchCallback(evutil_socket_t fd, short flags,\n> > >                                    void *param);\n> > >       void dispatchCall();\n> > > +     int eventNew(const std::unique_ptr<Event> &event, const int fd, const short events);\n> > >  };\n> >\n> > --\n> > Regards,\n> >\n> > Laurent Pinchart\n> >\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 ACD65C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Apr 2022 15:22:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6299265644;\n\tTue, 19 Apr 2022 17:22:38 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E0FF6563C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Apr 2022 17:22:37 +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 55FF725B;\n\tTue, 19 Apr 2022 17:22:37 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650381758;\n\tbh=nL01nVVUOEGlrm3AX65OrLQO6ecq3uV1YsZv1faSaJI=;\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:Cc:\n\tFrom;\n\tb=GWxrHSvTJ586LXv/+nL2R2CBFOxKzBbUroL8dF0CscDL8nQBDoqPwtsVp8N9L7xiP\n\tI4uahy/cXdvVrI7QPirB4jvYdVYYqOVLpVos6aD6q+nDexsDAvuCaUtMgPy8TgzSjI\n\tvSXmi24QhvHEWOgG36F+2W3b/00GYXbhH2N+3/+pMhxVfSSDi2sw9J9iE+EdPNYNxW\n\tF1OeOpfHL5/steXu3yWcRoJHEUL9lic3e5/GSUO+fXgr7itt8Id8rRO+yDjRTe+Iua\n\tDmXfezhjscayoZ+U69g6gAAngugPGZrRvNWYFcl1GTcGiz1i79r8vXoFSd3+DSYSO2\n\tb6o2oVTovX1EQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1650381757;\n\tbh=nL01nVVUOEGlrm3AX65OrLQO6ecq3uV1YsZv1faSaJI=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=BsPjofcYDFQ5MgraH6BNfQkaBVc0XRaCFOUfwYsYDvWZUqXI0UYpM2roQEDGuaIEg\n\tEfdWy4I1gu9KzEU1Jw3BoWoTTOYw+6EbXy+wuur8dECoOwrKc28zmb0QLXQerKxG1r\n\tUTwNcal1B0srTPeh8wvjf1mTfnOYGfWZbDZhgL/M="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"BsPjofcY\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<CAOgh=FziGsbMTEx44c9rYZEbi6ksPAwN4=3RSvg04wneMbjPoQ@mail.gmail.com>","References":"<20220408160015.33612-1-ecurtin@redhat.com>\n\t<YlmchwdQP4fxaVc1@pendragon.ideasonboard.com>\n\t<CAOgh=FziGsbMTEx44c9rYZEbi6ksPAwN4=3RSvg04wneMbjPoQ@mail.gmail.com>","To":"Eric Curtin <ecurtin@redhat.com>,\n\tEric Curtin via libcamera-devel <libcamera-devel@lists.libcamera.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Tue, 19 Apr 2022 16:22:34 +0100","Message-ID":"<165038175460.2548121.4270791333427932519@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v7 1/2] cam: event_loop: Add timer\n\tevents to event loop","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]