[{"id":32762,"web_url":"https://patchwork.libcamera.org/comment/32762/","msgid":"<20241216112554.GM32204@pendragon.ideasonboard.com>","date":"2024-12-16T11:25:54","subject":"Re: [PATCH v2 1/2] gstreamer: allocator:\n\tgst_libcamera_allocator_new(): Recognize errors","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Barnabás,\n\nThank you for the patch.\n\nOn Mon, Dec 16, 2024 at 10:47:07AM +0000, Barnabás Pőcze wrote:\n> `FrameBufferAllocator::allocate()` might return a negative error code,\n> but currently this is handled the same way as success. So instead\n> of continuing, abort the construction of the allocator object.\n> \n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n\nI think you missed my R-b tag from v1.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/gstreamer/gstlibcameraallocator.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp\n> index 7e4c904da..b0c84893a 100644\n> --- a/src/gstreamer/gstlibcameraallocator.cpp\n> +++ b/src/gstreamer/gstlibcameraallocator.cpp\n> @@ -214,7 +214,7 @@ gst_libcamera_allocator_new(std::shared_ptr<Camera> camera,\n>  \t\tStream *stream = streamCfg.stream();\n>  \n>  \t\tret = self->fb_allocator->allocate(stream);\n> -\t\tif (ret == 0)\n> +\t\tif (ret <= 0)\n>  \t\t\treturn nullptr;\n>  \n>  \t\tGQueue *pool = g_queue_new();","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 67005C32F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Dec 2024 11:26:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 35FB167F4D;\n\tMon, 16 Dec 2024 12:26:12 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B9E9862C8B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Dec 2024 12:26:10 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0EAA913C;\n\tMon, 16 Dec 2024 12:25:34 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"IrqQYByb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1734348334;\n\tbh=WHUD6gi74aN9lwKpvI0SebHt8zspf4qD7JR4QRvwxb0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=IrqQYBybe4OYrD5Kwrx7q4ggAcZfuhF8hzqeh/RacwkjQa4/OCm+isVrLV/7NixkX\n\tNAP0ahVvxjuRCHnMADMszpTS1N9vwiC2JGpLxzthx0Ggu2pYon40k7tUY5gNTW+Qe8\n\tedWdzly0yEdhByu1u+dRQFASEqaoaR8q2prq1mYM=","Date":"Mon, 16 Dec 2024 13:25:54 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 1/2] gstreamer: allocator:\n\tgst_libcamera_allocator_new(): Recognize errors","Message-ID":"<20241216112554.GM32204@pendragon.ideasonboard.com>","References":"<20241216104704.957343-1-pobrn@protonmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20241216104704.957343-1-pobrn@protonmail.com>","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":32849,"web_url":"https://patchwork.libcamera.org/comment/32849/","msgid":"<e251e557569c389eb6b1654005221f2c2bc7f9eb.camel@ndufresne.ca>","date":"2024-12-17T18:31:44","subject":"Re: [PATCH v2 1/2] gstreamer: allocator:\n\tgst_libcamera_allocator_new(): Recognize errors","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"content":"Le lundi 16 décembre 2024 à 10:47 +0000, Barnabás Pőcze a écrit :\n> `FrameBufferAllocator::allocate()` might return a negative error code,\n> but currently this is handled the same way as success. So instead\n> of continuing, abort the construction of the allocator object.\n> \n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\n> ---\n>  src/gstreamer/gstlibcameraallocator.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp\n> index 7e4c904da..b0c84893a 100644\n> --- a/src/gstreamer/gstlibcameraallocator.cpp\n> +++ b/src/gstreamer/gstlibcameraallocator.cpp\n> @@ -214,7 +214,7 @@ gst_libcamera_allocator_new(std::shared_ptr<Camera> camera,\n>  \t\tStream *stream = streamCfg.stream();\n>  \n>  \t\tret = self->fb_allocator->allocate(stream);\n> -\t\tif (ret == 0)\n> +\t\tif (ret <= 0)\n>  \t\t\treturn nullptr;\n>  \n>  \t\tGQueue *pool = g_queue_new();","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 600D7BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 Dec 2024 18:31:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 98E9167FFE;\n\tTue, 17 Dec 2024 19:31:49 +0100 (CET)","from mail-qk1-x731.google.com (mail-qk1-x731.google.com\n\t[IPv6:2607:f8b0:4864:20::731])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 97FE367FD3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Dec 2024 19:31:48 +0100 (CET)","by mail-qk1-x731.google.com with SMTP id\n\taf79cd13be357-7b6edb82f85so699936685a.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Dec 2024 10:31:48 -0800 (PST)","from nicolas-tpx395.localdomain ([2606:6d00:15:862e::7a9])\n\tby smtp.gmail.com with ESMTPSA id\n\taf79cd13be357-7b7047e73easm342165585a.52.2024.12.17.10.31.45\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 17 Dec 2024 10:31:45 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=ndufresne-ca.20230601.gappssmtp.com\n\theader.i=@ndufresne-ca.20230601.gappssmtp.com\n\theader.b=\"pUBaU74z\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ndufresne-ca.20230601.gappssmtp.com; s=20230601; t=1734460307;\n\tx=1735065107; darn=lists.libcamera.org; \n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=wcbFsSyoDze6qs6RNw25+/8k0G6kafNPTN0pvaZN13U=;\n\tb=pUBaU74zWTbijMqbHwmgaUtLuM2mbZQzo7UjUAuI30bTwUHqlFGxC6c70Omd7jxBN8\n\t4G3SdhRP1CbK3w6+xKp5h0bRLsKwDBQukDtBF6djV/CTuXjrd0hnXylud0ffavmMaar3\n\tZppqQ9epdGegkJvSvGg9OcjprW2Brhv0FOHL+1ImrtsGZu/T3nad6+pg6gd+jViuylPF\n\tyxLRDxZny88HCOBWGAVkNFzd1Rx+D48Y37oX8Af1AmkK58g+yJGxfWNhNfVNLIwZovcb\n\tXvkEmgmribOfrNEBVmDvzpBWfeO9KvryUAau++qWdxcQ3vZ57U6dl46gmWLt+icZ34pc\n\tkYNQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1734460307; x=1735065107;\n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=wcbFsSyoDze6qs6RNw25+/8k0G6kafNPTN0pvaZN13U=;\n\tb=DN92NsmbaSVe6E138vHMWjulBpOd8lBR6uxgN0q+1HAJKEZgHUoLodlEWiA4ouzuVk\n\tvUbbJA633P0fNIwzSxjM0z50t51cEL9m38rOjP7t+aZyZ31kKqpIPhfNC0eerv1yYbGl\n\t6xRAAa4S7xL8DByZUBsMQWILXOWRL1r1oYCihiF5M+YAvGjC76EV2UIPWVNRDYj80YOY\n\tZlHdwTXe6aTicGwyeyHZwuJG84lBAIHN4Bl6B4bUV+SsHaePLGrRIrcSLx/spsUpZ1X7\n\tNOFVXy7GbgrjXXpmI2ItF+wSq6urngGZKBWVUH00udyApXyzBZ08pDHdHlr43YzTpYs7\n\tcaXw==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCVIbv7ew+jZugdae9vPpq7rzG3//IPP1by9bJs8l+f4hehcMTHwmHz7ZbIWh90g9fyuPyp6YKtjRVdWTXrx7kM=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YxQuApJHWY+gmvTkF9mwXVY1jumUyouLJ2FhYEoi1BbXmG0jYEM\n\tPFLhwS1F9GLM7KKYWuzG20gFOjQlAhlcR5pDnG61kcBXU0Aa2rQL3GROISvrR/k=","X-Gm-Gg":"ASbGnct6KzVyLg9wAEW1k3rFHUvEh2N2I7v8rbgpjfdOBLfIO/CA5QQXg4W7Ag0YOb4\n\tknPBXjEsr4soPxFajws5HyMaLW5E7q92iTSbuqwvORKaqqPRR6o0meC6AnlCbaOfX6mEtUs+6vj\n\toZmqjMm8TwvB84okVgVj6jfJEBBl4wvV4O/tWcDrorWsqWz3J2l4WCe6sqx6MgQr9krmWyj7vsH\n\tjxufRqq4up5MH5i3Zdqn3Nmxn5Lx0vHTZbMNSI0NPNUPCua3Az2U/e1lw==","X-Google-Smtp-Source":"AGHT+IEHnms9c5YpE8ZlFlNm+InobHr9d4XZAeAu2r7HJrtfIe/zNUqYCFQExn5mfSvQYuGc7iUMdQ==","X-Received":"by 2002:a05:620a:4554:b0:7af:c60b:5acf with SMTP id\n\taf79cd13be357-7b6fbecc76fmr3332832485a.10.1734460305855; \n\tTue, 17 Dec 2024 10:31:45 -0800 (PST)","Message-ID":"<e251e557569c389eb6b1654005221f2c2bc7f9eb.camel@ndufresne.ca>","Subject":"Re: [PATCH v2 1/2] gstreamer: allocator:\n\tgst_libcamera_allocator_new(): Recognize errors","From":"Nicolas Dufresne <nicolas@ndufresne.ca>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 17 Dec 2024 13:31:44 -0500","In-Reply-To":"<20241216104704.957343-1-pobrn@protonmail.com>","References":"<20241216104704.957343-1-pobrn@protonmail.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.54.2 (3.54.2-1.fc41) ","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>"}}]