From patchwork Sun Dec 15 18:18:38 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: 22313 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 AD8BBC32F6 for ; Sun, 15 Dec 2024 18:18:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EDB3D67F07; Sun, 15 Dec 2024 19:18:45 +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="BsDbmJRU"; dkim-atps=neutral Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D08B67EEE for ; Sun, 15 Dec 2024 19:18:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1734286723; x=1734545923; bh=aS3YEHrQ2tHzTb2MdljxMSdODBdI9/WQyI8TYfLOwVg=; 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=BsDbmJRUknN5Cwp7tDhY+9LL5PWKya8ZNAy2+Im5+TexakKLJcVwXn9SDj1iMUprd w64UKbWt2aAjDbu/ZvyKAGo9IPLtczj7iE9nJNHcERLvolg3zunG8bPc9t1LaOvYtf R0UhROYignqi6w4K2NUH5ln18N23/FSoMWMsFknWxcissUNDXL92qx9prOpwueHujy icGrBkan/RpKg+TFCJF4eFENq+ugFmQtavTCMudKFd1XwnVmf2dvZHSDaLOQLBuwtJ B3fM0gYJ8v9DnO3Y+2i8IQAYXFaOY7TfGg0TCLl+IWXi2qne0I1DqDTDx/nrW1pozC +OZjEBRHjNSZQ== Date: Sun, 15 Dec 2024 18:18:38 +0000 To: libcamera-devel@lists.libcamera.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH v1 1/2] gstreamer: allocator: Recognize FrameBufferAllocator errors Message-ID: <20241215181835.802589-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton X-Pm-Message-ID: 0ab074a75be0aa0af3e650caf95726c3373ca8fe 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. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- 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();