[{"id":27428,"web_url":"https://patchwork.libcamera.org/comment/27428/","msgid":"<LcK3ozitfXaRu7Y64FEzPdZPahVwToTCNz-aXXJY9avQo4AqsGXHoxFUr8ZGemFlQLFQJBpXlpVy3xGRgu3Rl6jXdBRM1hmdIoV2hddgnoI=@protonmail.com>","date":"2023-06-26T21:52:18","subject":"Re: [libcamera-devel] [RFC PATCH] gstreamer: Drop libcamera_private\n\tdependency","submitter":{"id":133,"url":"https://patchwork.libcamera.org/api/people/133/","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"content":"Hi\n\n\n2023. június 26., hétfő 23:17 keltezéssel, Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org> írta:\n\n> Drop libcamera_private dependency entirely as to avoid libcamerasrc\n> getting more dependent on it. In order to achieve that, one of the\n> mutex locks in GstLibcameraSrcState needs to be replaced with GMutex.\n> \n> However doing so, this won't let us to use the clang's thread annotation\n> macros in libcamera (which should be fine as libcamerasrc would move\n> out of libcamera repo once matured).\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  src/gstreamer/gstlibcamerasrc.cpp | 20 ++++++++------------\n>  src/gstreamer/meson.build         |  2 +-\n>  2 files changed, 9 insertions(+), 13 deletions(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index 11f15068..fda5610f 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -32,8 +32,6 @@\n>  #include <queue>\n>  #include <vector>\n> \n> -#include <libcamera/base/mutex.h>\n> -\n>  #include <libcamera/camera.h>\n>  #include <libcamera/camera_manager.h>\n>  #include <libcamera/control_ids.h>\n> @@ -125,11 +123,9 @@ struct GstLibcameraSrcState {\n>  \t * be held while calling into other graph elements (e.g. when calling\n>  \t * gst_pad_query()).\n>  \t */\n> -\tMutex lock_;\n> -\tstd::queue<std::unique_ptr<RequestWrap>> queuedRequests_\n> -\t\tLIBCAMERA_TSA_GUARDED_BY(lock_);\n> -\tstd::queue<std::unique_ptr<RequestWrap>> completedRequests_\n> -\t\tLIBCAMERA_TSA_GUARDED_BY(lock_);\n> +\tGMutex lock_;\n> [...]\n\nShouldn't this be initialized? i.e. `g_mutex_init()`?\n\n\nRegards,\nBarnabás Pőcze","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 35A57BE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Jun 2023 21:52:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 756A2628C0;\n\tMon, 26 Jun 2023 23:52:32 +0200 (CEST)","from mail-40133.protonmail.ch (mail-40133.protonmail.ch\n\t[185.70.40.133])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B1CC628BB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jun 2023 23:52:31 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1687816352;\n\tbh=h0fUh8WntaCTPGAUvw4XbgkykeoDqaVUqSKx5MABnGY=;\n\th=Date:To:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=3k0ZsabW1h6PZZusT95Bc6HTeY9DlGDMjUeDZM80oQuNSShJlGGBdMRV005XIqXBy\n\tIGRo8B/WWPq6rK32QgnSM8uqpDvoor2R0jyuMxrEeLc1ixrDwKakU3dn/KnkctIspo\n\tSIzr6SuCFShhUHU3CPIWEdIdXraAeEOe64T7h6b388sgFF0xPwPrs/piqM831Lq+vs\n\tuCccAozWcAbMNKfgi+QjSBzQ+5u6PhEu9EEgWg2lgtWghP0NGlJOMBcSVYvgwj6tvu\n\t0L/4DngqHb4gttE6Kh8M3SmNXnduo59mHlymzRhj6+Nvh8e7lKe1JNJE5VUVVkrOb4\n\taxidShcCHl/hg==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1687816350; x=1688075550;\n\tbh=htyl00a45IIBhzGUA/blRjLSmv4XOJRlyoMWqj7HZQA=;\n\th=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector;\n\tb=R12/eVTHqMBhPifRz34bkNQp6Oqn3ImG2a9QdODm1xHcVLEPIl4RArKtuk3K/7NW8\n\t8MneN9HpNjCSJviB2OCtxb09mFWM0jGdRa0dKSvZrwJqRTWv/R1DqG+nkKDxxx+drJ\n\td0zpXIlWILNRvaerELLGPtvvbf4HckXhPxFMS+CKJUPn4kGLtFC1sT1Ka+LP2YBQlO\n\t2ye2MzVH6GbmuAddbQjm039W/OKYp+mWbdeMTUCwrEPJ+hSi3WVmOpj8snY9aIaOZ9\n\tw6gLY4DZf+RZ8n3d8T2EjQ2L8XDlydvtoy8IyRqFhyuNB7KHHR7HRnuQQasV8erWRG\n\ty8seeUlFhscZg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=protonmail.com\n\theader.i=@protonmail.com\n\theader.b=\"R12/eVTH\"; dkim-atps=neutral","Date":"Mon, 26 Jun 2023 21:52:18 +0000","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<LcK3ozitfXaRu7Y64FEzPdZPahVwToTCNz-aXXJY9avQo4AqsGXHoxFUr8ZGemFlQLFQJBpXlpVy3xGRgu3Rl6jXdBRM1hmdIoV2hddgnoI=@protonmail.com>","In-Reply-To":"<20230626211747.101412-1-umang.jain@ideasonboard.com>","References":"<20230626211747.101412-1-umang.jain@ideasonboard.com>","Feedback-ID":"20568564:user:proton","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","Subject":"Re: [libcamera-devel] [RFC PATCH] gstreamer: Drop libcamera_private\n\tdependency","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":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze_via_libcamera-devel?=\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.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":27429,"web_url":"https://patchwork.libcamera.org/comment/27429/","msgid":"<168785922622.1052803.15107455456761864419@Monstersaurus>","date":"2023-06-27T09:47:06","subject":"Re: [libcamera-devel] [RFC PATCH] gstreamer: Drop libcamera_private\n\tdependency","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Barnabás Pőcze via libcamera-devel (2023-06-26 22:52:18)\n> Hi\n> \n> \n> 2023. június 26., hétfő 23:17 keltezéssel, Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org> írta:\n> \n> > Drop libcamera_private dependency entirely as to avoid libcamerasrc\n> > getting more dependent on it. In order to achieve that, one of the\n> > mutex locks in GstLibcameraSrcState needs to be replaced with GMutex.\n> > \n\nExcellent plan! Indeed - gstilbcamerasrc should definitely only use the\npublic API.\n\n\n> > However doing so, this won't let us to use the clang's thread annotation\n> > macros in libcamera (which should be fine as libcamerasrc would move\n> > out of libcamera repo once matured).\n\nI think that's reasonable in this instance.\n\n\n> > \n> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> > ---\n> >  src/gstreamer/gstlibcamerasrc.cpp | 20 ++++++++------------\n> >  src/gstreamer/meson.build         |  2 +-\n> >  2 files changed, 9 insertions(+), 13 deletions(-)\n> > \n> > diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> > index 11f15068..fda5610f 100644\n> > --- a/src/gstreamer/gstlibcamerasrc.cpp\n> > +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> > @@ -32,8 +32,6 @@\n> >  #include <queue>\n> >  #include <vector>\n> > \n> > -#include <libcamera/base/mutex.h>\n> > -\n> >  #include <libcamera/camera.h>\n> >  #include <libcamera/camera_manager.h>\n> >  #include <libcamera/control_ids.h>\n> > @@ -125,11 +123,9 @@ struct GstLibcameraSrcState {\n> >        * be held while calling into other graph elements (e.g. when calling\n> >        * gst_pad_query()).\n> >        */\n> > -     Mutex lock_;\n> > -     std::queue<std::unique_ptr<RequestWrap>> queuedRequests_\n> > -             LIBCAMERA_TSA_GUARDED_BY(lock_);\n> > -     std::queue<std::unique_ptr<RequestWrap>> completedRequests_\n> > -             LIBCAMERA_TSA_GUARDED_BY(lock_);\n> > +     GMutex lock_;\n> > [...]\n> \n> Shouldn't this be initialized? i.e. `g_mutex_init()`?\n\nLooking at https://docs.gtk.org/glib/method.Mutex.init.html\nit will also need a g_mutex_clear();\n\nBut with those:\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> \n> Regards,\n> Barnabás Pőcze","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 1BB21C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Jun 2023 09:47:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 491E6628C0;\n\tTue, 27 Jun 2023 11:47:12 +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 1C97860386\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Jun 2023 11:47:10 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8F1F61447;\n\tTue, 27 Jun 2023 11:46:30 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1687859232;\n\tbh=ndIBI5Zd5lnMOLK/X16XNAn+klj/m4AzknVxQiCeCjQ=;\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=z4FuuS5VrJH2PWff87lCIeR7Q4n0U8x1z2VNzPwVKfBAUFbDwiBR34HQXgBO+nqBU\n\tj4gg97SWsBY6K+KB3PVC5irPIYTuqdEGXjfBmX+S2AW7cfwp7+Fk6iCtdnstyVDPTx\n\t4QZTNRuNmczMFxrMbsQdq2KurNWc2sgKMQ1HTtG+XTky6T198zZTiEHyo6LnDQSJas\n\t5PRe2r6eTLVwDEluNKGCZbp3QcBNf27BOKbHToSdAjpyBLjpIJvmr9MGdRxCkjmBgl\n\twDjdfAQOC+WFzh6GDxGSfXxY5KCcfl5E4ZeDqAroe3jD58YgMbqIxwnagaeYLh3PHY\n\t8PHxPV7vVJ0BQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1687859190;\n\tbh=ndIBI5Zd5lnMOLK/X16XNAn+klj/m4AzknVxQiCeCjQ=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=RXENBspH8OfjjhFha3C0AO4GJj7krqffaja6O54Mk1/MUtJ2+2JJF1Wy+yENEKDY+\n\t4ILnciehMnx1G0SWPt8HthrjWvSXxo9ytXDSKcJoNmSYnrQ3cKmz9DEHZ8+nQlq+79\n\tX0nYSIvyR1nXTmXCQl6hMw26ipcbpAENkT/VkCRM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"RXENBspH\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<LcK3ozitfXaRu7Y64FEzPdZPahVwToTCNz-aXXJY9avQo4AqsGXHoxFUr8ZGemFlQLFQJBpXlpVy3xGRgu3Rl6jXdBRM1hmdIoV2hddgnoI=@protonmail.com>","References":"<20230626211747.101412-1-umang.jain@ideasonboard.com>\n\t<LcK3ozitfXaRu7Y64FEzPdZPahVwToTCNz-aXXJY9avQo4AqsGXHoxFUr8ZGemFlQLFQJBpXlpVy3xGRgu3Rl6jXdBRM1hmdIoV2hddgnoI=@protonmail.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>,\n\t=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>, Umang Jain\n\t<umang.jain@ideasonboard.com>","Date":"Tue, 27 Jun 2023 10:47:06 +0100","Message-ID":"<168785922622.1052803.15107455456761864419@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [RFC PATCH] gstreamer: Drop libcamera_private\n\tdependency","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>"}},{"id":27431,"web_url":"https://patchwork.libcamera.org/comment/27431/","msgid":"<e3f58f98bf3fdbddc5a6e4ee9c70fc0b85d949f8.camel@ndufresne.ca>","date":"2023-06-28T14:26:10","subject":"Re: [libcamera-devel] [RFC PATCH] gstreamer: Drop libcamera_private\n\tdependency","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"content":"Le lundi 26 juin 2023 à 21:52 +0000, Barnabás Pőcze via libcamera-devel a\nécrit :\n> Hi\n> \n> \n> 2023. június 26., hétfő 23:17 keltezéssel, Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org> írta:\n> \n> > Drop libcamera_private dependency entirely as to avoid libcamerasrc\n> > getting more dependent on it. In order to achieve that, one of the\n> > mutex locks in GstLibcameraSrcState needs to be replaced with GMutex.\n> > \n> > However doing so, this won't let us to use the clang's thread annotation\n> > macros in libcamera (which should be fine as libcamerasrc would move\n> > out of libcamera repo once matured).\n> > \n> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> > ---\n> >  src/gstreamer/gstlibcamerasrc.cpp | 20 ++++++++------------\n> >  src/gstreamer/meson.build         |  2 +-\n> >  2 files changed, 9 insertions(+), 13 deletions(-)\n> > \n> > diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> > index 11f15068..fda5610f 100644\n> > --- a/src/gstreamer/gstlibcamerasrc.cpp\n> > +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> > @@ -32,8 +32,6 @@\n> >  #include <queue>\n> >  #include <vector>\n> > \n> > -#include <libcamera/base/mutex.h>\n> > -\n> >  #include <libcamera/camera.h>\n> >  #include <libcamera/camera_manager.h>\n> >  #include <libcamera/control_ids.h>\n> > @@ -125,11 +123,9 @@ struct GstLibcameraSrcState {\n> >  \t * be held while calling into other graph elements (e.g. when calling\n> >  \t * gst_pad_query()).\n> >  \t */\n> > -\tMutex lock_;\n> > -\tstd::queue<std::unique_ptr<RequestWrap>> queuedRequests_\n> > -\t\tLIBCAMERA_TSA_GUARDED_BY(lock_);\n> > -\tstd::queue<std::unique_ptr<RequestWrap>> completedRequests_\n> > -\t\tLIBCAMERA_TSA_GUARDED_BY(lock_);\n> > +\tGMutex lock_;\n> > [...]\n> \n> Shouldn't this be initialized? i.e. `g_mutex_init()`?\n\nA quote from the doc:\n   \n   Notice that the GMutex is not initialised to any particular value. Its\n   placement in static storage ensures that it will be initialised to all-zeros,\n   which is appropriate.\n   \n   If a GMutex is placed in other contexts (eg: embedded in a struct) then it\n   must be explicitly initialised using g_mutex_init().\n\nSo yes, in the constructor we need to drop g_mutex_init() since C++ object are\nnot memset to zero, unlike GObject.\n\n> \n> \n> Regards,\n> Barnabás Pőcze","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 596BBBDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Jun 2023 14:26:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CB145628BC;\n\tWed, 28 Jun 2023 16:26:13 +0200 (CEST)","from mail-vs1-xe29.google.com (mail-vs1-xe29.google.com\n\t[IPv6:2607:f8b0:4864:20::e29])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 73BA661E3B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Jun 2023 16:26:12 +0200 (CEST)","by mail-vs1-xe29.google.com with SMTP id\n\tada2fe7eead31-44096f01658so2014875137.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Jun 2023 07:26:12 -0700 (PDT)","from nicolas-tpx395.localdomain ([2606:6d00:15:c623::7a9])\n\tby smtp.gmail.com with ESMTPSA id\n\tq3-20020ad44023000000b00630164a9992sm5818915qvp.73.2023.06.28.07.26.10\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 28 Jun 2023 07:26:10 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1687962373;\n\tbh=nUqZVMz1UOtK54jHlM3GqEdcGJlcpR4hZVMiJbMDZX8=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=FUpMUvTZbim5Rm2AeDVgHQI0qzYLrg9GCyo/16cJZjAqyF5ORKWoZfZIag3CSe2KH\n\t5uXDWDk0IF9S3fAQFTo++GVZ/SUQYAkvmAcu+PEclsheKPHKyIlQ4OOw7hY7L4e+Ts\n\tEtocNAYS1NYgPxFzXkMDAXXvtHctDmxSo5KYDGvP5t16jEYBOwZtQ2JuvXAE76TFB2\n\t/qCnOR2iy7uwNxjrRUzAuq+qSKcp8smiSnYkYzRVPCH//AWxhx/nM35umWurIXs3u3\n\tpvZpc6zSYemF2ZOxqeII6IfMV7KOKZx3Xj34RYdFhy2EmB8X5zgZ4aYEQ/yJJ1JYXZ\n\tRZpRjTg77j42g==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ndufresne-ca.20221208.gappssmtp.com; s=20221208; t=1687962371;\n\tx=1690554371; \n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=EltxBw+c09j3571EGUlNOFbbhyQ0bZLcDhY58AJvDiQ=;\n\tb=DJfRxrCNnveEjvlL0dy+9eMe/6NuvG6yYU1cPGH3N2XdjCKX+P8gPR56VngXNXOQT5\n\tn/kjUfeUuyrqkf6Q4I2/cCttgpB8ZsfUXnxGo2AiN4JvaxtT0FN8PVM2hhyPoa5hNa2Z\n\tHJ9W6OdoBaa/1yqi+552EgxfCRg+baC9w8VJYFlzrc/3K17/sIlInksCRTvsYNHzuehR\n\t4QyrKh/Xejsl7BstGF87kWNTLr0tHnqtc68JYacQ33XCaZWoqG3BYwqnRiJWsSeRipK+\n\t3FpG05GMfqDQ4R8+7PqDSnnfkeIo6Ka3cJVKW6Cl6DR5B63b5COS27VCLuw6ch1AZLJa\n\tq7Rw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=ndufresne-ca.20221208.gappssmtp.com\n\theader.i=@ndufresne-ca.20221208.gappssmtp.com header.b=\"DJfRxrCN\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1687962371; x=1690554371;\n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state\n\t:from:to:cc:subject:date:message-id:reply-to;\n\tbh=EltxBw+c09j3571EGUlNOFbbhyQ0bZLcDhY58AJvDiQ=;\n\tb=P/BnG+B+965ej8upITAEiPQnEKWuVrH3yKfpX4Oyr64QCtobP7kLAAWg3gnqU7K9IK\n\t53lkOxGToYhrvjE64RwBgqmTtCUNssDRO9TaVB5dWVayqJJkJuMU4Bmn0DI1pai4tPqv\n\ttiby4PGaXdmh8aXVfBZS/0Lj3YENdbAuRPd7putWAXewJFDnMIbrYacWTACgtDDjz8ye\n\toLNOKQzRI4tjm1hPjl0yoXEKdW9oJG4gF4378oJi8S+7cJALMHCxdx2QR9xYhhyKuMcL\n\toxN1ZZXJ19po9Ou3PISXxLgkvlS8avwu3VQganatn5NIoiM8/Bnrf9ejCM1gB+Pq9zuN\n\tQgSA==","X-Gm-Message-State":"AC+VfDz+99VwmO6ycL1Cy0bvX+RSmp0q11uNJ8x1VtVDZAfyvkhz7khG\n\tFKRvjgFsF6ZjtKxtkx1Pc0pJtg==","X-Google-Smtp-Source":"ACHHUZ6siSNOw77eUaf4f4lv/bOl0DZz1zDCSenJBQ/u3jTlayj7mg3ZoLeT+pNVHyqyt0kSLuY2Hw==","X-Received":"by 2002:a67:f615:0:b0:443:66b9:b8e9 with SMTP id\n\tk21-20020a67f615000000b0044366b9b8e9mr5088200vso.20.1687962371127; \n\tWed, 28 Jun 2023 07:26:11 -0700 (PDT)","Message-ID":"<e3f58f98bf3fdbddc5a6e4ee9c70fc0b85d949f8.camel@ndufresne.ca>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>, Umang Jain\n\t<umang.jain@ideasonboard.com>","Date":"Wed, 28 Jun 2023 10:26:10 -0400","In-Reply-To":"<LcK3ozitfXaRu7Y64FEzPdZPahVwToTCNz-aXXJY9avQo4AqsGXHoxFUr8ZGemFlQLFQJBpXlpVy3xGRgu3Rl6jXdBRM1hmdIoV2hddgnoI=@protonmail.com>","References":"<20230626211747.101412-1-umang.jain@ideasonboard.com>\n\t<LcK3ozitfXaRu7Y64FEzPdZPahVwToTCNz-aXXJY9avQo4AqsGXHoxFUr8ZGemFlQLFQJBpXlpVy3xGRgu3Rl6jXdBRM1hmdIoV2hddgnoI=@protonmail.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.48.3 (3.48.3-1.fc38) ","MIME-Version":"1.0","Subject":"Re: [libcamera-devel] [RFC PATCH] gstreamer: Drop libcamera_private\n\tdependency","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":"Nicolas Dufresne via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27432,"web_url":"https://patchwork.libcamera.org/comment/27432/","msgid":"<325da3614f8be391af16fb035e53238faa1f396f.camel@ndufresne.ca>","date":"2023-06-28T14:27:07","subject":"Re: [libcamera-devel] [RFC PATCH] gstreamer: Drop libcamera_private\n\tdependency","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"content":"Le mercredi 28 juin 2023 à 10:26 -0400, Nicolas Dufresne a écrit :\n> Le lundi 26 juin 2023 à 21:52 +0000, Barnabás Pőcze via libcamera-devel a\n> écrit :\n> > Hi\n> > \n> > \n> > 2023. június 26., hétfő 23:17 keltezéssel, Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org> írta:\n> > \n> > > Drop libcamera_private dependency entirely as to avoid libcamerasrc\n> > > getting more dependent on it. In order to achieve that, one of the\n> > > mutex locks in GstLibcameraSrcState needs to be replaced with GMutex.\n> > > \n> > > However doing so, this won't let us to use the clang's thread annotation\n> > > macros in libcamera (which should be fine as libcamerasrc would move\n> > > out of libcamera repo once matured).\n> > > \n> > > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> > > ---\n> > >  src/gstreamer/gstlibcamerasrc.cpp | 20 ++++++++------------\n> > >  src/gstreamer/meson.build         |  2 +-\n> > >  2 files changed, 9 insertions(+), 13 deletions(-)\n> > > \n> > > diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> > > index 11f15068..fda5610f 100644\n> > > --- a/src/gstreamer/gstlibcamerasrc.cpp\n> > > +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> > > @@ -32,8 +32,6 @@\n> > >  #include <queue>\n> > >  #include <vector>\n> > > \n> > > -#include <libcamera/base/mutex.h>\n> > > -\n> > >  #include <libcamera/camera.h>\n> > >  #include <libcamera/camera_manager.h>\n> > >  #include <libcamera/control_ids.h>\n> > > @@ -125,11 +123,9 @@ struct GstLibcameraSrcState {\n> > >  \t * be held while calling into other graph elements (e.g. when calling\n> > >  \t * gst_pad_query()).\n> > >  \t */\n> > > -\tMutex lock_;\n> > > -\tstd::queue<std::unique_ptr<RequestWrap>> queuedRequests_\n> > > -\t\tLIBCAMERA_TSA_GUARDED_BY(lock_);\n> > > -\tstd::queue<std::unique_ptr<RequestWrap>> completedRequests_\n> > > -\t\tLIBCAMERA_TSA_GUARDED_BY(lock_);\n> > > +\tGMutex lock_;\n> > > [...]\n> > \n> > Shouldn't this be initialized? i.e. `g_mutex_init()`?\n> \n> A quote from the doc:\n>    \n>    Notice that the GMutex is not initialised to any particular value. Its\n>    placement in static storage ensures that it will be initialised to all-zeros,\n>    which is appropriate.\n>    \n>    If a GMutex is placed in other contexts (eg: embedded in a struct) then it\n>    must be explicitly initialised using g_mutex_init().\n> \n> So yes, in the constructor we need to drop g_mutex_init() since C++ object are\n> not memset to zero, unlike GObject.\n\nOh, and with that fixed, you can add a second Rb\n\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\n> \n> > \n> > \n> > Regards,\n> > Barnabás Pőcze\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 A15B4BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Jun 2023 14:27:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 60D6D628C1;\n\tWed, 28 Jun 2023 16:27:11 +0200 (CEST)","from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com\n\t[IPv6:2607:f8b0:4864:20::e2d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1DD6C628BC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Jun 2023 16:27:10 +0200 (CEST)","by mail-vs1-xe2d.google.com with SMTP id\n\tada2fe7eead31-440b54708f2so1846133137.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Jun 2023 07:27:10 -0700 (PDT)","from nicolas-tpx395.localdomain ([2606:6d00:15:c623::7a9])\n\tby smtp.gmail.com with ESMTPSA id\n\tmz14-20020a0562142d0e00b006300e92ea02sm5791996qvb.121.2023.06.28.07.27.08\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 28 Jun 2023 07:27:08 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1687962431;\n\tbh=BUdIWHgFTPuNAVmxJ2r3qupdzKdJsCiDEP7thsB8azw=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=yFnrsYxiQidFMiHO6jzmik+em+9jV8hZRBtxw02MCRcudiA08xXhQRjp9Z3dnOZWM\n\tPVTuoz7IhcS4U4SQN9jXXVZQSvkqJve40SP8pNd1I2VtsuC3jjEBnxUYYP76289Rvv\n\tpZ3gJbDKGtr+yW6Xbi93tgVAkiOpB7Q6FLoAcAoGPddoS1m2PIH2Lc02l853+/vd1G\n\teNqxN5yEmI/lHghIBzRbotDwCMzoiG9rRrhympRIPoCFc1BpPJIWKi22riErhaxOKE\n\tVMbtHVqPDul6IYC8Y+x507iOACnNg9JCDaao8c/49l5re2moN1Gd2Z1kd1Sd3RZgij\n\thNs2/19bAaroQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ndufresne-ca.20221208.gappssmtp.com; s=20221208; t=1687962429;\n\tx=1690554429; \n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=7aY+/BnzYoPWpB2NApFMAnFkbsSP3xVBPUWLrSwtG0k=;\n\tb=JwBLcinscMi5u6SEyk09gcpXkjOfldBd04HNTXxVqG4yyDMeUrKrUOP0MVgT4cnLLU\n\t3YLAtBPsqTgdjXvkgrraox9oSKnA1R1x1wQwRtkv4P8XojkQJoO4Kq8n6GCUJnMH4fP+\n\tqo2EqccHKVBNI7Jc1uvPEx8wttM8amw+ULmObsTjQvNyIQv7/ChlI6bw1J4BW5F6VFfi\n\t69AUBQ5py/s7pt0lV4ibFU6hq9nh7JA1hjOJjDA0YhDyYhZo066KEtI7QmZBaGSO3OLg\n\tybVCOoXaWI9mA0otiV9LMBi4k/gl14Up871unX9BxCE4W3iItynu60N3WQbGZYWOa0vT\n\tppig=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=ndufresne-ca.20221208.gappssmtp.com\n\theader.i=@ndufresne-ca.20221208.gappssmtp.com header.b=\"JwBLcins\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1687962429; x=1690554429;\n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state\n\t:from:to:cc:subject:date:message-id:reply-to;\n\tbh=7aY+/BnzYoPWpB2NApFMAnFkbsSP3xVBPUWLrSwtG0k=;\n\tb=UiTwxntQotnU4Q4VvJ20cTRZCL/MUe/kfSPQcimu9yydbv5qNN94/5i1S7M4hK3dvq\n\tbbgPVZghuBTALdaeoitwXZXP3qLiCQYEd2BL7/3CbOjwDNqIvA8/J0pjvVZh4bSitSbR\n\tuZI73YHBMnZue3hbIBzAUDSkXCRAVdeIIPB5sgzQ0STo1XYgR5PPq0w+r28VkeCEMMbt\n\tih9XkjdMJPqiqU/hgyP+3MayWEcNtquOOTkoT2bg/kMT+oCU87wUJSHH9czl48E1wsUg\n\thTDlVjAHxxWj7SR5RGRqQ+nlsRME/VPg8sX+83AWcVjhISKl2D+zhSSTrrJ25xdoGRNs\n\tLtUQ==","X-Gm-Message-State":"AC+VfDzWh/jH9zxkq7Oed1ip9BLOIyiTmgmmlSkvruNkzp2HTpTKq9Rr\n\t7loD9be5wHiI1VcXL57WJo1BtBoOfm9kC1csdxo=","X-Google-Smtp-Source":"ACHHUZ6HSmFH2igKF15XE/bzaoIFt6Wy/qKxnJ2b02QtKduzilkvI6A6Hht/0oCslxRiMtdI2y9o2A==","X-Received":"by 2002:a05:6102:3bc9:b0:443:5d85:99f3 with SMTP id\n\ta9-20020a0561023bc900b004435d8599f3mr5762973vsv.7.1687962428886; \n\tWed, 28 Jun 2023 07:27:08 -0700 (PDT)","Message-ID":"<325da3614f8be391af16fb035e53238faa1f396f.camel@ndufresne.ca>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>, Umang Jain\n\t<umang.jain@ideasonboard.com>","Date":"Wed, 28 Jun 2023 10:27:07 -0400","In-Reply-To":"<e3f58f98bf3fdbddc5a6e4ee9c70fc0b85d949f8.camel@ndufresne.ca>","References":"<20230626211747.101412-1-umang.jain@ideasonboard.com>\n\t<LcK3ozitfXaRu7Y64FEzPdZPahVwToTCNz-aXXJY9avQo4AqsGXHoxFUr8ZGemFlQLFQJBpXlpVy3xGRgu3Rl6jXdBRM1hmdIoV2hddgnoI=@protonmail.com>\n\t<e3f58f98bf3fdbddc5a6e4ee9c70fc0b85d949f8.camel@ndufresne.ca>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.48.3 (3.48.3-1.fc38) ","MIME-Version":"1.0","Subject":"Re: [libcamera-devel] [RFC PATCH] gstreamer: Drop libcamera_private\n\tdependency","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":"Nicolas Dufresne via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]