From patchwork Fri Aug 19 11:16:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 17175 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 C73AEBE173 for ; Fri, 19 Aug 2022 11:16:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EC95761FC7; Fri, 19 Aug 2022 13:16:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1660907793; bh=gWZyc07t0f8VQcdCF5lWQnIvwpu5YPzPBeRixPgjuJs=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=vqlZX7VPZHgcrhDo80cGjj1x2Fq4V3Qn2I4he3odrxbVi71DTFRHBy2Sq+U7ZRTdG JGDGG7ZCaw6ZY1bN1ZB4wpdiNqi1m5LMtAqjOlZ+BN281jsjF3jBDdapicxE8XNK2u /r/LVn2w62KKxee3MTfajsTzkImjyaLvQKPR9uP/7va02cQ7mGa3Ebu115XIjx6fKo fGOsoSUnEgx3ylILhJnEiApYR7Y/L7NKcaIzMFEn3eKQ2/wdsvbCeADd0xLR5oUliF NtciHgG7+BrXUmRzqI+s2TWHUf8FUd7ntRxFOEW4+quA0xLB/jk70rQ+1OFR3ZA0mE skSTyrb9kT46g== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 963E261FA4 for ; Fri, 19 Aug 2022 13:16:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="i2RUSred"; dkim-atps=neutral Received: from deskari.lan (91-158-154-79.elisa-laajakaista.fi [91.158.154.79]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9BD233F1; Fri, 19 Aug 2022 13:16:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1660907790; bh=gWZyc07t0f8VQcdCF5lWQnIvwpu5YPzPBeRixPgjuJs=; h=From:To:Cc:Subject:Date:From; b=i2RUSreddWitDpuebYyuohjH0y0gkBPDnA/q7CbPVP9S2u1aK5EUcdmdcWo7LZzS3 Kpd6GCCdv69H1rKPR09of7uJl+DmhtcLwqnNk2XwAcRo1RVfLXBo2I6afeg1Syc+Lo HdS57ac+spzX0mz5DAJz7pSMVACCE16K3yFa1VE4= To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart , Jacopo Mondi Date: Fri, 19 Aug 2022 14:16:09 +0300 Message-Id: <20220819111615.39814-1-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 0/6] Python bindings: PyCameraManager and non-blocking eventfd 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: , X-Patchwork-Original-From: Tomi Valkeinen via libcamera-devel From: Tomi Valkeinen Reply-To: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, These are the reviewed patches from "Python bindings event handling" series. The rest in that series will break the API and/or need a bit more working, so it makes sense to get these merged while the rest are being worked on. Changes since v3: - New patch "py: meson: Use libcamera_private dependency" - Renamed ret -> py_reqs in "py: Create PyCameraManager" - Added a few more includes (string, vector) just in case - Check the error properly in PyCameraManager::readFd Tomi Tomi Valkeinen (6): py: meson: Use libcamera_private dependency py: Create PyCameraManager py: Use UniqueFD py: Set EFD_CLOEXEC on eventfd to avoid fd leaking py: Use libcamera's Mutex classes py: Switch to non-blocking eventfd src/py/examples/simple-cam.py | 5 +- src/py/examples/simple-capture.py | 12 +- src/py/examples/simple-continuous-capture.py | 5 +- src/py/libcamera/meson.build | 4 +- src/py/libcamera/py_camera_manager.cpp | 131 +++++++++++++++++++ src/py/libcamera/py_camera_manager.h | 45 +++++++ src/py/libcamera/py_main.cpp | 120 ++++------------- test/py/unittests.py | 7 + 8 files changed, 227 insertions(+), 102 deletions(-) create mode 100644 src/py/libcamera/py_camera_manager.cpp create mode 100644 src/py/libcamera/py_camera_manager.h