{"id":24036,"url":"https://patchwork.libcamera.org/api/1.1/covers/24036/?format=json","web_url":"https://patchwork.libcamera.org/cover/24036/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250730102733.21314-1-laurent.pinchart@ideasonboard.com>","date":"2025-07-30T10:27:31","name":"[v3,0/2] libcamera: Introduce and use scope_exit","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/24036/mbox/","series":[{"id":5350,"url":"https://patchwork.libcamera.org/api/1.1/series/5350/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5350","date":"2025-07-30T10:27:31","name":"libcamera: Introduce and use scope_exit","version":3,"mbox":"https://patchwork.libcamera.org/series/5350/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/24036/comments/","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 C3FCFBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 30 Jul 2025 10:27:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B8FBD691FF;\n\tWed, 30 Jul 2025 12:27:46 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AA8856914D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Jul 2025 12:27:42 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 162FFA57\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Jul 2025 12:26:59 +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=\"nF0IhDxt\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753871219;\n\tbh=88blg7lqUA1I2CR+V4SNI/IE7yMzkmzDv+ljLhh8vK4=;\n\th=From:To:Subject:Date:From;\n\tb=nF0IhDxtY7hVYnTp2Xdp6gNvMbeBELN2l+/PwZcb2NxYcAj4oEtryLRe/Qn/eyExn\n\tvziZRFyOVAgbXqs+hl4uw0a9/PeUu/+cLpRsXCpbuk/esX3tTJKgJX9QOiW3yAsQ4F\n\tCTbxUVt+L4QLGLyHKFJZ/T+rzNP2ttJnx1rPQqWs=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH v3 0/2] libcamera: Introduce and use scope_exit","Date":"Wed, 30 Jul 2025 13:27:31 +0300","Message-ID":"<20250730102733.21314-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.49.1","MIME-Version":"1.0","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>"},"content":"Hello,\n\nlibcamera includes a ScopeExitActions class that simplifies error\nhandling by gathering cleanup actions for automatic run on scope exit.\nThe mechanism is quite versatile, but is not suitable for hot paths as\nit requires dynamic heap allocation.\n\nThis series introduces in patch 1/2 a new simpler scope_exit class that\nimplements the API defined in the C++ library fundamentals TS v3. It\ndoes not suffer from the same issue as ScopeExitActions, but is less\nversatile as a result. Patch 2/2 then uses the new class in\nV4L2VideoDevice::queueBuffer() to simplify error handling.\n\nLaurent Pinchart (2):\n  libcamera: utils: Add scope_exit class\n  libcamera: v4l2_videodevice: Use scope_exit\n\n include/libcamera/base/utils.h     | 38 ++++++++++++++++++++++++++++++\n src/libcamera/v4l2_videodevice.cpp | 11 +++------\n 2 files changed, 41 insertions(+), 8 deletions(-)\n\n\nbase-commit: 2d5a1367e2b14dab9671270655bbb1702e0826de\n--\nRegards,\n\nLaurent Pinchart"}