From patchwork Mon Dec 16 10:47:07 2024 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: 22343 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 C7B58C32F6 for ; Mon, 16 Dec 2024 10:47:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BFFD867F4C; Mon, 16 Dec 2024 11:47:14 +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="JB2FNfoX"; dkim-atps=neutral Received: from mail-10630.protonmail.ch (mail-10630.protonmail.ch [79.135.106.30]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E46E560136 for ; Mon, 16 Dec 2024 11:47:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1734346031; x=1734605231; bh=72aGnPxsaxIY18fcGLOLQub8Q2ibRsTGzNJKV8OatH4=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector: List-Unsubscribe:List-Unsubscribe-Post; b=JB2FNfoXcnE9HneSFXVNylrXCNngxxsfKotzxFM81f7Nv0YA8QqhiXnKz6kpjX66x 1w28dP1fe7nzvEjX2Wv8axw8cCHBy1KJDObwSWX+mixVrbnXt5nWZqC1PMplC9h4eD JLTftc5gVhFTHYdKpG/e/yI9ZmngAI63AJDycxbwN3t/ZGiJgvW4FEX4JcNmtzJag3 MD0678ltI7favUPAZLtu9LANq2tpQ+dxUkPv5BngOla53L6M6inwbiQ4+D306fF+GQ C9PSmMDwtQSgApjWGh6UcupR8E3UvmFUEZ3ZEg4V7yN9fS8yZdHExIDdaneGOyhhW0 trc9B4IFaNIDQ== Date: Mon, 16 Dec 2024 10:47:07 +0000 To: libcamera-devel@lists.libcamera.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH v2 1/2] gstreamer: allocator: gst_libcamera_allocator_new(): Recognize errors Message-ID: <20241216104704.957343-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton X-Pm-Message-ID: ec1a710915a77b38b9cc46116e7da1409de7790a 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 --- src/gstreamer/gstlibcameraallocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();