[{"id":24505,"web_url":"https://patchwork.libcamera.org/comment/24505/","msgid":"<d733c30c-242d-884e-d577-25c897499d71@ideasonboard.com>","date":"2022-08-10T06:44:31","subject":"Re: [libcamera-devel] [RFC PATCH] libcamera: base: Make message.h\n\tand mutex.h private","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent,\n\nThank you for the patch.\n\nOn 8/8/22 20:49, Laurent Pinchart via libcamera-devel wrote:\n> The message.h and mutex.h headers are not used in the libcamera public\n> API. Make them private to avoid there usage in applications, and to\n> prevent having to maintain them with a stable ABI.\n>\n> As mutex.h is used by libcamerasrc, the GStreamer element must switch\n> from the libcamera_public to the libcamera_private dependency.\n\n\nShould the gstreamer element be moving away from using those headers as \nwell?\n\nIf it's a question on locks (I see Mutex and MutexLocker) being used, \nreplacing with GLib equivalent can be a way forwards to drop those (now \nprivate) headers?\n\nIn that case, this patch can introduce a \\todo in gstreamer element.\n\nAnyways,\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>   include/libcamera/base/message.h | 2 ++\n>   include/libcamera/base/mutex.h   | 2 ++\n>   src/gstreamer/meson.build        | 2 +-\n>   3 files changed, 5 insertions(+), 1 deletion(-)\n>\n> diff --git a/include/libcamera/base/message.h b/include/libcamera/base/message.h\n> index 65572c7470e9..b939af6f79bb 100644\n> --- a/include/libcamera/base/message.h\n> +++ b/include/libcamera/base/message.h\n> @@ -9,6 +9,8 @@\n>   \n>   #include <atomic>\n>   \n> +#include <libcamera/base/private.h>\n> +\n>   #include <libcamera/base/bound_method.h>\n>   \n>   namespace libcamera {\n> diff --git a/include/libcamera/base/mutex.h b/include/libcamera/base/mutex.h\n> index 2d23e49e4546..52441c55287a 100644\n> --- a/include/libcamera/base/mutex.h\n> +++ b/include/libcamera/base/mutex.h\n> @@ -10,6 +10,8 @@\n>   #include <condition_variable>\n>   #include <mutex>\n>   \n> +#include <libcamera/base/private.h>\n> +\n>   #include <libcamera/base/thread_annotations.h>\n>   \n>   namespace libcamera {\n> diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n> index 77c79140eb37..eda246d7ffc8 100644\n> --- a/src/gstreamer/meson.build\n> +++ b/src/gstreamer/meson.build\n> @@ -42,7 +42,7 @@ endif\n>   libcamera_gst = shared_library('gstlibcamera',\n>       libcamera_gst_sources,\n>       cpp_args : libcamera_gst_cpp_args,\n> -    dependencies : [libcamera_public, gstvideo_dep, gstallocator_dep],\n> +    dependencies : [libcamera_private, gstvideo_dep, gstallocator_dep],\n>       install: true,\n>       install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')),\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 A932CC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Aug 2022 06:44:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 245EC6332B;\n\tWed, 10 Aug 2022 08:44:41 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8405661FA9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 08:44:39 +0200 (CEST)","from [IPV6:2401:4900:1f3f:c7a1:27b3:9637:38a7:6084] (unknown\n\t[IPv6:2401:4900:1f3f:c7a1:27b3:9637:38a7:6084])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 20A9E481;\n\tWed, 10 Aug 2022 08:44:37 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660113881;\n\tbh=2KSiOFgj6JHvU49b99hkJX6hwOTTXfvg75Q8X+GQWlQ=;\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:\n\tFrom;\n\tb=iOpizgHMLfa0s3MxiX+yUsuA7Fd/cDKMaQqAw2Xn4avYKf+Fq9hr4vhz2T0HonGAU\n\tQ9CckEpSwvm4pbQw+Zrloa/So7HX15ZKBfvBCiWFex3UAVlT01s+AUpIfyXTAjyhoh\n\tV5wdNZFrGA4vHVlgtMm0K+Lem1t401mwV7/WI7dNq6Y/v4uF3VBbClk39IDujZb6NK\n\tV2V56r81+uS+JP/Zb1iDVNB7CMFIhDS4qyFA1TN6Lu+x5+Jwatr8VWen6aTCN+/3s0\n\tCHC2GjWva2IUCg30fakFDpx6i8eJi0n+lI64lN7BKkROySJQGBXuX1vFo2issc6ssO\n\to4ye5lvOy0n+Q==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660113879;\n\tbh=2KSiOFgj6JHvU49b99hkJX6hwOTTXfvg75Q8X+GQWlQ=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=q09V5t5zpUfM+NVf+pG2YsBdAwr53OZpLZrlFGyth4SKqnsbsEhzTI/W5qJNn8Qqj\n\tyNZJ7v9zR/F23mStZfyB9RiAANR4J8k9MkzIfwAPgbE9EjvJsVIHoNww9neyYCkl4k\n\tDdzaX+Y2Xvgc9ySx84JntgAvpS3EvvsAbr9XbLdE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"q09V5t5z\"; dkim-atps=neutral","Message-ID":"<d733c30c-242d-884e-d577-25c897499d71@ideasonboard.com>","Date":"Wed, 10 Aug 2022 12:14:31 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220808151918.25411-1-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20220808151918.25411-1-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [RFC PATCH] libcamera: base: Make message.h\n\tand mutex.h private","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":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24512,"web_url":"https://patchwork.libcamera.org/comment/24512/","msgid":"<166011988954.2190824.1736816547753752531@Monstersaurus>","date":"2022-08-10T08:24:49","subject":"Re: [libcamera-devel] [RFC PATCH] libcamera: base: Make message.h\n\tand mutex.h private","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Umang Jain via libcamera-devel (2022-08-10 07:44:31)\n> Hi Laurent,\n> \n> Thank you for the patch.\n> \n> On 8/8/22 20:49, Laurent Pinchart via libcamera-devel wrote:\n> > The message.h and mutex.h headers are not used in the libcamera public\n> > API. Make them private to avoid there usage in applications, and to\n> > prevent having to maintain them with a stable ABI.\n> >\n> > As mutex.h is used by libcamerasrc, the GStreamer element must switch\n> > from the libcamera_public to the libcamera_private dependency.\n> \n> \n> Should the gstreamer element be moving away from using those headers as \n> well?\n\nI think that would be down to where the gstreamer element lives.\n\nAnything built within the libcamera code base can use the private\nheaders, as we can ensure that they are updated accordingly.\n\nBut if the gstlibcamerasrc element moves to the gstreamer project, that\nwould have to be refactored. However, it likely can't move there until\nwe have a stable API and ABI for libcamera, so I think it's fine to use\nthe internal headers for now.\n\n--\nKieran\n\n\n> If it's a question on locks (I see Mutex and MutexLocker) being used, \n> replacing with GLib equivalent can be a way forwards to drop those (now \n> private) headers?\n> \n> In that case, this patch can introduce a \\todo in gstreamer element.\n> \n> Anyways,\n> \n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> \n> >\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >   include/libcamera/base/message.h | 2 ++\n> >   include/libcamera/base/mutex.h   | 2 ++\n> >   src/gstreamer/meson.build        | 2 +-\n> >   3 files changed, 5 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/include/libcamera/base/message.h b/include/libcamera/base/message.h\n> > index 65572c7470e9..b939af6f79bb 100644\n> > --- a/include/libcamera/base/message.h\n> > +++ b/include/libcamera/base/message.h\n> > @@ -9,6 +9,8 @@\n> >   \n> >   #include <atomic>\n> >   \n> > +#include <libcamera/base/private.h>\n> > +\n> >   #include <libcamera/base/bound_method.h>\n> >   \n> >   namespace libcamera {\n> > diff --git a/include/libcamera/base/mutex.h b/include/libcamera/base/mutex.h\n> > index 2d23e49e4546..52441c55287a 100644\n> > --- a/include/libcamera/base/mutex.h\n> > +++ b/include/libcamera/base/mutex.h\n> > @@ -10,6 +10,8 @@\n> >   #include <condition_variable>\n> >   #include <mutex>\n> >   \n> > +#include <libcamera/base/private.h>\n> > +\n> >   #include <libcamera/base/thread_annotations.h>\n> >   \n> >   namespace libcamera {\n> > diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n> > index 77c79140eb37..eda246d7ffc8 100644\n> > --- a/src/gstreamer/meson.build\n> > +++ b/src/gstreamer/meson.build\n> > @@ -42,7 +42,7 @@ endif\n> >   libcamera_gst = shared_library('gstlibcamera',\n> >       libcamera_gst_sources,\n> >       cpp_args : libcamera_gst_cpp_args,\n> > -    dependencies : [libcamera_public, gstvideo_dep, gstallocator_dep],\n> > +    dependencies : [libcamera_private, gstvideo_dep, gstallocator_dep],\n> >       install: true,\n> >       install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')),\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 EE7C9C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Aug 2022 08:24:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E35546332B;\n\tWed, 10 Aug 2022 10:24:53 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F7E461FAB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 10:24:53 +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 A670E3F1;\n\tWed, 10 Aug 2022 10:24:52 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660119893;\n\tbh=c7639rtqMYgoPFUbT4Nn/sbKDYuz0eVZQsAvagSzlFE=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=CIEgUdMSi1jw6FQ+cUAIGOE5jus3RaeSxAZCAZdE10Rcz2e711HGZPQwwbIYx3Oig\n\tMTz2CnyNiEPBvsuQktMMk7EySjMJw8l0zWk3vQKvdZODGy91agml+TqT/fIzB8f/Th\n\tw9jawBcPzebiUqYGxB3tA/fGvKoAPuiZUrCNjx8izncwIPHg0f0nkXXpPCtM83LqoR\n\tIBszYnvYMspebiIjz3H5iKAjDa7rIzfGuIFs7Lebxr9tCnKlG0VSfVPp/M8z2dKRwU\n\tW6vVXp3iLONUe6UXRHpYXTrI5vziLuHdG3Hn9y1XvEcSlQkMhsxmZf1LUU7rLrNYq1\n\t20jgO3Sj7sazA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660119892;\n\tbh=c7639rtqMYgoPFUbT4Nn/sbKDYuz0eVZQsAvagSzlFE=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=sGwJid4/iR/J8b9Q1551rkA8FtBBqRSWDyrSCg9koyZH14cloHaAQTXN0OkfxPIQQ\n\tMTo6O4/BrynUw5LDczQ8UhVB7wkYD+hq3KWi+voIQaN8hFeVYDInBgwid+kBJR1Mlh\n\tOD53uJ7QG/f5yG8R2T3wAIGgD49xnNZVv6h72xFc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"sGwJid4/\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<d733c30c-242d-884e-d577-25c897499d71@ideasonboard.com>","References":"<20220808151918.25411-1-laurent.pinchart@ideasonboard.com>\n\t<d733c30c-242d-884e-d577-25c897499d71@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tUmang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 10 Aug 2022 09:24:49 +0100","Message-ID":"<166011988954.2190824.1736816547753752531@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [RFC PATCH] libcamera: base: Make message.h\n\tand mutex.h private","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24513,"web_url":"https://patchwork.libcamera.org/comment/24513/","msgid":"<166012002375.2190824.3103116400940635065@Monstersaurus>","date":"2022-08-10T08:27:03","subject":"Re: [libcamera-devel] [RFC PATCH] libcamera: base: Make message.h\n\tand mutex.h private","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart via libcamera-devel (2022-08-08 16:19:18)\n> The message.h and mutex.h headers are not used in the libcamera public\n> API. Make them private to avoid there usage in applications, and to\n> prevent having to maintain them with a stable ABI.\n> \n> As mutex.h is used by libcamerasrc, the GStreamer element must switch\n> from the libcamera_public to the libcamera_private dependency.\n\nNot used by public API == Private. So I don't think this is even RFC ;-)\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\nHowever I'd still like to make -base more widely reusable sometime, But\nthen that needs to go alongside something that goes 'on top' of\nlibcamera too to support add on helpers ... (libcamera-top? still\nwaiting to complete the bikeshedding there before I create the library\nheheh).\n\n\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  include/libcamera/base/message.h | 2 ++\n>  include/libcamera/base/mutex.h   | 2 ++\n>  src/gstreamer/meson.build        | 2 +-\n>  3 files changed, 5 insertions(+), 1 deletion(-)\n> \n> diff --git a/include/libcamera/base/message.h b/include/libcamera/base/message.h\n> index 65572c7470e9..b939af6f79bb 100644\n> --- a/include/libcamera/base/message.h\n> +++ b/include/libcamera/base/message.h\n> @@ -9,6 +9,8 @@\n>  \n>  #include <atomic>\n>  \n> +#include <libcamera/base/private.h>\n> +\n>  #include <libcamera/base/bound_method.h>\n>  \n>  namespace libcamera {\n> diff --git a/include/libcamera/base/mutex.h b/include/libcamera/base/mutex.h\n> index 2d23e49e4546..52441c55287a 100644\n> --- a/include/libcamera/base/mutex.h\n> +++ b/include/libcamera/base/mutex.h\n> @@ -10,6 +10,8 @@\n>  #include <condition_variable>\n>  #include <mutex>\n>  \n> +#include <libcamera/base/private.h>\n> +\n>  #include <libcamera/base/thread_annotations.h>\n>  \n>  namespace libcamera {\n> diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n> index 77c79140eb37..eda246d7ffc8 100644\n> --- a/src/gstreamer/meson.build\n> +++ b/src/gstreamer/meson.build\n> @@ -42,7 +42,7 @@ endif\n>  libcamera_gst = shared_library('gstlibcamera',\n>      libcamera_gst_sources,\n>      cpp_args : libcamera_gst_cpp_args,\n> -    dependencies : [libcamera_public, gstvideo_dep, gstallocator_dep],\n> +    dependencies : [libcamera_private, gstvideo_dep, gstallocator_dep],\n>      install: true,\n>      install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')),\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 37DE0C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Aug 2022 08:27:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 824896332B;\n\tWed, 10 Aug 2022 10:27:07 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 76D1461FAB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 10:27:06 +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 05E133F1;\n\tWed, 10 Aug 2022 10:27:05 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660120027;\n\tbh=deLqkt0kvB+f8VREmJGTf4sEK0GJa3N5u7MHi55U+Yk=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=1evi1yrWxVpuH+OBQZ16xn4UI2OxvZDuHb8xTXJDYlRWeioK8bQfpYUfu+o6WKvEy\n\tUAQ2NTb+Ejr2hd487js9HA+i8I/tDPhlPSxdV0FeJfTwy6yVYM8kcf5d2+7nTSAuy8\n\t2TglIl/JqowG3U40sznRoAUKDCKQFLDIvbopuHy5iAVY9R4j06DWtMyWjVsl+mL2+v\n\ti2Gm+ikQ8MS044JzRsbv/PPG1N2np2FxwFhuH0Ix8RuVk5Ymf+bQDjPbOo0TjfYLw4\n\t8hoqq0+5xP+naNgyJ9HhsWqZjfeIRyNp3+RNYaBhoVYK9MbrfbBdyRVQGJXTAvo55k\n\twjopwnFQowMGw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660120026;\n\tbh=deLqkt0kvB+f8VREmJGTf4sEK0GJa3N5u7MHi55U+Yk=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=bMOopB9YiPCWNmdwE9cdMtFkllpkNWujrSrQ+e/UjZN+iuM1Ej/1PwEeFx/s5JfUn\n\t5IoHOfgPtKCWodPd3w4eV38E3eumqF9BEsNAgwZM3z56D/xZqLNZKI+2WvBt4/oJjE\n\tNPKQ0ZrMrKK1Gecudq88+vk1gro1KP06QIDwB7bg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"bMOopB9Y\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220808151918.25411-1-laurent.pinchart@ideasonboard.com>","References":"<20220808151918.25411-1-laurent.pinchart@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 10 Aug 2022 09:27:03 +0100","Message-ID":"<166012002375.2190824.3103116400940635065@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [RFC PATCH] libcamera: base: Make message.h\n\tand mutex.h private","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24566,"web_url":"https://patchwork.libcamera.org/comment/24566/","msgid":"<YvlJmPHVp9V8GyAD@pendragon.ideasonboard.com>","date":"2022-08-14T19:14:32","subject":"Re: [libcamera-devel] [RFC PATCH] libcamera: base: Make message.h\n\tand mutex.h private","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Aug 10, 2022 at 09:24:49AM +0100, Kieran Bingham wrote:\n> Quoting Umang Jain via libcamera-devel (2022-08-10 07:44:31)\n> > On 8/8/22 20:49, Laurent Pinchart via libcamera-devel wrote:\n> > > The message.h and mutex.h headers are not used in the libcamera public\n> > > API. Make them private to avoid there usage in applications, and to\n> > > prevent having to maintain them with a stable ABI.\n> > >\n> > > As mutex.h is used by libcamerasrc, the GStreamer element must switch\n> > > from the libcamera_public to the libcamera_private dependency.\n> > \n> > Should the gstreamer element be moving away from using those headers as \n> > well?\n> \n> I think that would be down to where the gstreamer element lives.\n> \n> Anything built within the libcamera code base can use the private\n> headers, as we can ensure that they are updated accordingly.\n> \n> But if the gstlibcamerasrc element moves to the gstreamer project, that\n> would have to be refactored. However, it likely can't move there until\n> we have a stable API and ABI for libcamera, so I think it's fine to use\n> the internal headers for now.\n\nThat's a very good point, we may need to move away from mutex.h in this\ncase. We could do so already, but I don't think there's an urgency, and\nit doesn't block marking mutex.h as private. There's one possible issue\nthough, in that further usage of private APIs in libcamerasrc will not\nbe caught by the compiler. That would make libcamerasrc more dependent\non private APIs, which we may not want to facilitate a future\nconversion. I think this could be handled through reviews.\n\n> > If it's a question on locks (I see Mutex and MutexLocker) being used, \n> > replacing with GLib equivalent can be a way forwards to drop those (now \n> > private) headers?\n> > \n> > In that case, this patch can introduce a \\todo in gstreamer element.\n> > \n> > Anyways,\n> > \n> > Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> > \n> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > ---\n> > >   include/libcamera/base/message.h | 2 ++\n> > >   include/libcamera/base/mutex.h   | 2 ++\n> > >   src/gstreamer/meson.build        | 2 +-\n> > >   3 files changed, 5 insertions(+), 1 deletion(-)\n> > >\n> > > diff --git a/include/libcamera/base/message.h b/include/libcamera/base/message.h\n> > > index 65572c7470e9..b939af6f79bb 100644\n> > > --- a/include/libcamera/base/message.h\n> > > +++ b/include/libcamera/base/message.h\n> > > @@ -9,6 +9,8 @@\n> > >   \n> > >   #include <atomic>\n> > >   \n> > > +#include <libcamera/base/private.h>\n> > > +\n> > >   #include <libcamera/base/bound_method.h>\n> > >   \n> > >   namespace libcamera {\n> > > diff --git a/include/libcamera/base/mutex.h b/include/libcamera/base/mutex.h\n> > > index 2d23e49e4546..52441c55287a 100644\n> > > --- a/include/libcamera/base/mutex.h\n> > > +++ b/include/libcamera/base/mutex.h\n> > > @@ -10,6 +10,8 @@\n> > >   #include <condition_variable>\n> > >   #include <mutex>\n> > >   \n> > > +#include <libcamera/base/private.h>\n> > > +\n> > >   #include <libcamera/base/thread_annotations.h>\n> > >   \n> > >   namespace libcamera {\n> > > diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\n> > > index 77c79140eb37..eda246d7ffc8 100644\n> > > --- a/src/gstreamer/meson.build\n> > > +++ b/src/gstreamer/meson.build\n> > > @@ -42,7 +42,7 @@ endif\n> > >   libcamera_gst = shared_library('gstlibcamera',\n> > >       libcamera_gst_sources,\n> > >       cpp_args : libcamera_gst_cpp_args,\n> > > -    dependencies : [libcamera_public, gstvideo_dep, gstallocator_dep],\n> > > +    dependencies : [libcamera_private, gstvideo_dep, gstallocator_dep],\n> > >       install: true,\n> > >       install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')),\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 02E89C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 14 Aug 2022 19:14:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 62DAD61FC0;\n\tSun, 14 Aug 2022 21:14:48 +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 C245761FBA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 14 Aug 2022 21:14:46 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2DCED30A;\n\tSun, 14 Aug 2022 21:14:46 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660504488;\n\tbh=8Sb5nurMhFsNPwTr7GAMBA/c1jcYjw+HrsZWXJk4MDw=;\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=tqa+OvPP6wtCyJtN8iVoPm8NvB2nldQbIcqeSbwqSsARc9SUNZD94Os881tZdx3BP\n\tr6lwrwkk06uYZABWjizzIsE1C/zJt3Ahel8yfHyisMwrruAmQfWj/T0LDK4Qt5xyJp\n\ta+q0f7/UAqNj0PLjmBivGTRnRvDhVnV1RwFcEmBXJImmy5P5/y30tjYdHNaRnm4TZu\n\t6We4tx5lsaTrK6WglWQSymVo0DiIn7m6BhOHq/vr730JomNDhFpd5zeKfUVIkYSJzn\n\tFVuKRIoiJiIWVrgFWZ1FPWJI4D2y5fZ2NqhkmcSfp9RBDn4vF4A9dE1L1FmmIMnCUj\n\tT6HhJdbRpfvlQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660504486;\n\tbh=8Sb5nurMhFsNPwTr7GAMBA/c1jcYjw+HrsZWXJk4MDw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=vbxuY4Kn42htgIZxtBFwjRoUtmJ3xkSJOLmh/EEpbZIobtY2+pU3/4TUaH8NUrazs\n\taMC9Rcih1n93hvorK5y/sdPKh6eDM7Z5BOPmpRbBYawKYpTDjpHXivniT1a632ZgdG\n\tz+8htbEGlDDcYM0wfJ9zw6bPw5CiIFNFb4JkHOTU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"vbxuY4Kn\"; dkim-atps=neutral","Date":"Sun, 14 Aug 2022 22:14:32 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YvlJmPHVp9V8GyAD@pendragon.ideasonboard.com>","References":"<20220808151918.25411-1-laurent.pinchart@ideasonboard.com>\n\t<d733c30c-242d-884e-d577-25c897499d71@ideasonboard.com>\n\t<166011988954.2190824.1736816547753752531@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<166011988954.2190824.1736816547753752531@Monstersaurus>","Subject":"Re: [libcamera-devel] [RFC PATCH] libcamera: base: Make message.h\n\tand mutex.h private","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>"}}]