From patchwork Mon Jan 6 10:06:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22454 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 0CC5AC3257 for ; Mon, 6 Jan 2025 10:06:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E500D684E2; Mon, 6 Jan 2025 11:06:22 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=protonmail.com header.i=@protonmail.com header.b="dPujPZWa"; dkim-atps=neutral Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9DCDC608AB for ; Mon, 6 Jan 2025 11:06:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1736157981; x=1736417181; bh=ePjn5HvU0udlq8bTo7GChoHPsN/azCpmTcbyqXuWdao=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector: List-Unsubscribe:List-Unsubscribe-Post; b=dPujPZWa++JlH84GQUZpmAul3CL5PoZuSFfRE/CaeZqBHrXWsaNXwle9hn7aMsFSW ehM/xsQNN2C3jGOy4WYWEDcZu2FX0jac+fEz83vHxg0QdagIW+Gzbh7kX/YIli1r7r H/4+eQz+fyv+6UPbpi7MxLXb+61uYbYv3tP4zmhV9z7NArKcp3ALbIVEwDmBQt6/QL ZllVhUXK52ZSbMEq2AUr1p7sqEdGINUo9JBPZsVbEIO6Pv4dDLBem+hxN/SveRZe40 Q6nrFe0zSYNB8fl8cZ+jzV1hIZ44PxIdDB+7mdp5p8GtK4EaJVGUiPE3wrjmWFpMLD b5EOoIDkjfeRQ== Date: Mon, 06 Jan 2025 10:06:16 +0000 To: libcamera-devel@lists.libcamera.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Cc: Laurent Pinchart , Nicolas Dufresne Subject: [PATCH v3 1/2] gstreamer: allocator: gst_libcamera_allocator_new(): Recognize errors Message-ID: <20250106100613.493108-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton X-Pm-Message-ID: ad987dd89b5e3c22bae226b0d158640cac6a57c6 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" `FrameBufferAllocator::allocate()` might return a negative error code, but currently this is handled the same way as success. So instead of continuing, abort the construction of the allocator object. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Nicolas Dufresne --- Changes in v3: none Changes in v2: none --- src/gstreamer/gstlibcameraallocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.47.1 diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp index 7e4c904da..b0c84893a 100644 --- a/src/gstreamer/gstlibcameraallocator.cpp +++ b/src/gstreamer/gstlibcameraallocator.cpp @@ -214,7 +214,7 @@ gst_libcamera_allocator_new(std::shared_ptr camera, Stream *stream = streamCfg.stream(); ret = self->fb_allocator->allocate(stream); - if (ret == 0) + if (ret <= 0) return nullptr; GQueue *pool = g_queue_new();