[{"id":36213,"web_url":"https://patchwork.libcamera.org/comment/36213/","msgid":"<a84ba095-d293-4b79-bac8-e12381d43c60@ideasonboard.com>","date":"2025-10-13T08:59:21","subject":"Re: [PATCH v2 3/3] gstreamer: Improve logging for buffer pool\n\tactivation","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 10. 13. 8:38 keltezéssel, Umang Jain írta:\n> If the negotiation is going to fail, log the GST_ELEMENT_ERROR in\n> gst_libcamera_src_negotiate(), instead of logging in downstream method\n> chain.\n> \n> Signed-off-by: Umang Jain <uajain@igalia.com>\n> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> ---\n>   src/gstreamer/gstlibcamerasrc.cpp | 10 ++++++----\n>   1 file changed, 6 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index 07bb6b2f..75e0864c 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -581,9 +581,7 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self, GstPad *srcpad,\n>   \t}\n> \n>   \tif (!gst_buffer_pool_set_active(pool, true)) {\n> -\t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> -\t\t\t\t  (\"Failed to active buffer pool\"),\n> -\t\t\t\t  (\"gst_libcamera_src_negotiate() failed.\"));\n> +\t\tGST_ERROR(\"Failed to activate buffer pool\");\n\nMaybe it makes sense to use `GST_ERROR_OBJECT()` to tie this to the video pool?\nIn any case:\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n>   \t\treturn { nullptr, -EINVAL };\n>   \t}\n> \n> @@ -686,8 +684,12 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self)\n>   \t\t\tstd::tie(video_pool, ret) =\n>   \t\t\t\tgst_libcamera_create_video_pool(self, srcpad,\n>   \t\t\t\t\t\t\t\tcaps, &info);\n> -\t\t\tif (ret)\n> +\t\t\tif (ret) {\n> +\t\t\t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> +\t\t\t\t\t\t  (\"Failed to create video pool: %s\", g_strerror(-ret)),\n> +\t\t\t\t\t\t  (\"gst_libcamera_src_negotiate() failed.\"));\n>   \t\t\t\treturn false;\n> +\t\t\t}\n>   \t\t}\n> \n>   \t\tGstLibcameraPool *pool = gst_libcamera_pool_new(self->allocator,\n> --\n> 2.51.0\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 4F50BBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Oct 2025 08:59:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5DA726045F;\n\tMon, 13 Oct 2025 10:59:26 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4DF6060317\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Oct 2025 10:59:24 +0200 (CEST)","from [192.168.33.36] (185.182.214.105.nat.pool.zt.hu\n\t[185.182.214.105])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5AFDB6F9;\n\tMon, 13 Oct 2025 10:57:46 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"F69XLnIE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1760345866;\n\tbh=G996h5ku4mXhPY16bYRhfeOLzsGrPtDInjpRlvVWrzI=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=F69XLnIE5mrxj9Gle9QwkGSW+rc/XInS3R9DQl19etaNFyvDY8O5qBSH41ehQSRmi\n\t1kZGUPyuhGOTjQ8o0RAmf+FFoLk17Qr43kXntnb2BH/ZnJcuCwwxqx0pj8x1DM6l4D\n\teotwpeh5ooTRSwADdY7eeHtBgc5MQ90WHtdURbow=","Message-ID":"<a84ba095-d293-4b79-bac8-e12381d43c60@ideasonboard.com>","Date":"Mon, 13 Oct 2025 10:59:21 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 3/3] gstreamer: Improve logging for buffer pool\n\tactivation","To":"Umang Jain <uajain@igalia.com>, libcamera-devel@lists.libcamera.org","Cc":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","References":"<20251013063820.90805-1-uajain@igalia.com>\n\t<ffwjiIgateWUOJu5TFeho0DGOqGUDj4ayUAWonaR5yzEGgniJBqEVva3GRygBMweM_l1F4hFIh__4NWX-QCcaw==@protonmail.internalid>\n\t<20251013063820.90805-4-uajain@igalia.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20251013063820.90805-4-uajain@igalia.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":36246,"web_url":"https://patchwork.libcamera.org/comment/36246/","msgid":"<abe616fc7570f179a7901e709691bcb7b8e6c1f4.camel@collabora.com>","date":"2025-10-14T12:22:06","subject":"Re: [PATCH v2 3/3] gstreamer: Improve logging for buffer pool\n\tactivation","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Le lundi 13 octobre 2025 à 10:59 +0200, Barnabás Pőcze a écrit :\n> Hi\n> \n> 2025. 10. 13. 8:38 keltezéssel, Umang Jain írta:\n> > If the negotiation is going to fail, log the GST_ELEMENT_ERROR in\n> > gst_libcamera_src_negotiate(), instead of logging in downstream method\n> > chain.\n> > \n> > Signed-off-by: Umang Jain <uajain@igalia.com>\n> > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > ---\n> >   src/gstreamer/gstlibcamerasrc.cpp | 10 ++++++----\n> >   1 file changed, 6 insertions(+), 4 deletions(-)\n> > \n> > diff --git a/src/gstreamer/gstlibcamerasrc.cpp\n> > b/src/gstreamer/gstlibcamerasrc.cpp\n> > index 07bb6b2f..75e0864c 100644\n> > --- a/src/gstreamer/gstlibcamerasrc.cpp\n> > +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> > @@ -581,9 +581,7 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self,\n> > GstPad *srcpad,\n> >   \t}\n> > \n> >   \tif (!gst_buffer_pool_set_active(pool, true)) {\n> > -\t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> > -\t\t\t\t  (\"Failed to active buffer pool\"),\n> > -\t\t\t\t  (\"gst_libcamera_src_negotiate()\n> > failed.\"));\n> > +\t\tGST_ERROR(\"Failed to activate buffer pool\");\n> \n> Maybe it makes sense to use `GST_ERROR_OBJECT()` to tie this to the video\n> pool?\n\nGood catch, I did missed it, would be nice to be fixed before merging at least.\n\n> In any case:\n> \n> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> \n> \n> >   \t\treturn { nullptr, -EINVAL };\n> >   \t}\n> > \n> > @@ -686,8 +684,12 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self)\n> >   \t\t\tstd::tie(video_pool, ret) =\n> >   \t\t\t\tgst_libcamera_create_video_pool(self,\n> > srcpad,\n> >   \t\t\t\t\t\t\t\tcaps,\n> > &info);\n> > -\t\t\tif (ret)\n> > +\t\t\tif (ret) {\n> > +\t\t\t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> > +\t\t\t\t\t\t  (\"Failed to create video\n> > pool: %s\", g_strerror(-ret)),\n> > +\t\t\t\t\t\t \n> > (\"gst_libcamera_src_negotiate() failed.\"));\n> >   \t\t\t\treturn false;\n> > +\t\t\t}\n> >   \t\t}\n> > \n> >   \t\tGstLibcameraPool *pool = gst_libcamera_pool_new(self-\n> > >allocator,\n> > --\n> > 2.51.0\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 CB256BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Oct 2025 12:22:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E2418605F8;\n\tTue, 14 Oct 2025 14:22:10 +0200 (CEST)","from bali.collaboradmins.com (bali.collaboradmins.com\n\t[148.251.105.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0CCB9605DF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Oct 2025 14:22:09 +0200 (CEST)","from [IPv6:2606:6d00:17:ebd3::c41] (unknown\n\t[IPv6:2606:6d00:17:ebd3::c41])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256)\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby bali.collaboradmins.com (Postfix) with ESMTPSA id 098D317E055D;\n\tTue, 14 Oct 2025 14:22:07 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=collabora.com header.i=@collabora.com\n\theader.b=\"Fm/A4Gsa\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1760444528;\n\tbh=i4iLTGGFBA0pUbfOchkvwtJy+zY2Z9RRPOO3evES/2Q=;\n\th=Subject:From:To:Date:In-Reply-To:References:From;\n\tb=Fm/A4GsaW65tHxF/xeMJtMppKx56bovApVLz1BwndU1TPgFm5AM2n+PPzFUmal/jE\n\tE4lAy1T6vdZqiSvgkooy7avPTdqmuTZN+pYmToJ/y7GZMN1/ycSX/DH4TfF7opoEF8\n\t62GerkQl5Av+zlIHLT6dBxiwkNPpG1VT3vd9Og+jf5FpppTG2O0zZodC44LpCi4LUx\n\tOjL6B3mGHFEFX7ze00RviQLXn7fgyDsqf46Ovo/LwPFu2K45z11ezc69D9xUqcY/QT\n\tOgC2hB/PYw/cYkL7bdgwarW1G6w7KzYhrw5sPzXY8RbNdPGxSU3ZCxCjEMxlJ+92M3\n\tckkOBt/NoxLcQ==","Message-ID":"<abe616fc7570f179a7901e709691bcb7b8e6c1f4.camel@collabora.com>","Subject":"Re: [PATCH v2 3/3] gstreamer: Improve logging for buffer pool\n\tactivation","From":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tUmang Jain <uajain@igalia.com>, libcamera-devel@lists.libcamera.org","Date":"Tue, 14 Oct 2025 08:22:06 -0400","In-Reply-To":"<a84ba095-d293-4b79-bac8-e12381d43c60@ideasonboard.com>","References":"<20251013063820.90805-1-uajain@igalia.com>\n\t<ffwjiIgateWUOJu5TFeho0DGOqGUDj4ayUAWonaR5yzEGgniJBqEVva3GRygBMweM_l1F4hFIh__4NWX-QCcaw==@protonmail.internalid>\n\t<20251013063820.90805-4-uajain@igalia.com>\n\t<a84ba095-d293-4b79-bac8-e12381d43c60@ideasonboard.com>","Autocrypt":"addr=nicolas.dufresne@collabora.com; prefer-encrypt=mutual;\n\tkeydata=mDMEaCN2ixYJKwYBBAHaRw8BAQdAM0EHepTful3JOIzcPv6ekHOenE1u0vDG1gdHFrChD\n\t/e0J05pY29sYXMgRHVmcmVzbmUgPG5pY29sYXNAbmR1ZnJlc25lLmNhPoicBBMWCgBEAhsDBQsJCA\n\tcCAiICBhUKCQgLAgQWAgMBAh4HAheABQkJZfd1FiEE7w1SgRXEw8IaBG8S2UGUUSlgcvQFAmibrjo\n\tCGQEACgkQ2UGUUSlgcvQlQwD/RjpU1SZYcKG6pnfnQ8ivgtTkGDRUJ8gP3fK7+XUjRNIA/iXfhXMN\n\tabIWxO2oCXKf3TdD7aQ4070KO6zSxIcxgNQFtDFOaWNvbGFzIER1ZnJlc25lIDxuaWNvbGFzLmR1Z\n\tnJlc25lQGNvbGxhYm9yYS5jb20+iJkEExYKAEECGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4\n\tAWIQTvDVKBFcTDwhoEbxLZQZRRKWBy9AUCaCyyxgUJCWX3dQAKCRDZQZRRKWBy9ARJAP96pFmLffZ\n\tsmBUpkyVBfFAf+zq6BJt769R0al3kHvUKdgD9G7KAHuioxD2v6SX7idpIazjzx8b8rfzwTWyOQWHC\n\tAAS0LU5pY29sYXMgRHVmcmVzbmUgPG5pY29sYXMuZHVmcmVzbmVAZ21haWwuY29tPoiZBBMWCgBBF\n\tiEE7w1SgRXEw8IaBG8S2UGUUSlgcvQFAmibrGYCGwMFCQll93UFCwkIBwICIgIGFQoJCAsCBBYCAw\n\tECHgcCF4AACgkQ2UGUUSlgcvRObgD/YnQjfi4+L8f4fI7p1pPMTwRTcaRdy6aqkKEmKsCArzQBAK8\n\tbRLv9QjuqsE6oQZra/RB4widZPvphs78H0P6NmpIJ","Organization":"Collabora Canada","Content-Type":"multipart/signed; micalg=\"pgp-sha512\";\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"=-YnoodruZD3lo20wh/LOf\"","User-Agent":"Evolution 3.56.2 (3.56.2-2.fc42) ","MIME-Version":"1.0","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]