Patch Detail
Show a patch.
GET /api/1.1/patches/18695/?format=api
{ "id": 18695, "url": "https://patchwork.libcamera.org/api/1.1/patches/18695/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18695/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20230603075615.20663-11-tomi.valkeinen@ideasonboard.com>", "date": "2023-06-03T07:56:12", "name": "[libcamera-devel,v5,10/13] py: Add hotplug-monitor.py", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "aa7b3c2ac91df67045869c2876af3488618c89d6", "submitter": { "id": 109, "url": "https://patchwork.libcamera.org/api/1.1/people/109/?format=api", "name": "Tomi Valkeinen", "email": "tomi.valkeinen@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18695/mbox/", "series": [ { "id": 3904, "url": "https://patchwork.libcamera.org/api/1.1/series/3904/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3904", "date": "2023-06-03T07:56:02", "name": "py: New python bindings event handling", "version": 5, "mbox": "https://patchwork.libcamera.org/series/3904/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18695/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18695/checks/", "tags": {}, "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 778F6C32AA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 3 Jun 2023 07:57:21 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 168C7626FA;\n\tSat, 3 Jun 2023 09:57:21 +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 F1EC56287F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 3 Jun 2023 09:57:14 +0200 (CEST)", "from desky.lan (91-154-35-171.elisa-laajakaista.fi [91.154.35.171])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 798DD468;\n\tSat, 3 Jun 2023 09:56:51 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1685779041;\n\tbh=cAWEa3NfkVrbPYoK1a6BVS1X1Z4HPm6BjAhCUj9LxvE=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=yxGTIa4g56l4Qig53E5gcYEfwtzVn40UtqpPR9oS6vLMtv3kTVF79hcSvzWwzA4Uj\n\tD3S1pQjcKxCIOBBtA5JLDOJGaehP2JRoZZVNLlQ3fMfOvxRlmhw3pcvAmKkHzsxtgt\n\tEKbWg3WAiMhJXYd5wKfXv2UyIFUM+QidvsbpN4Hw3IVs4zuq4Drpsi9AhvLl8gNu5P\n\ttWlCvh0lJobH+ExVDL/tEikmI/IC9hNjMWqUGA7drBYeAzC8Cotj7GLt46922oJmZO\n\tnYpuPgiEoxw2yPfY0/IXqFxlacndMYIEdjBO5lYDn4x5jJ7k5o03V0FtP3520OlaHL\n\tuEwGbI739Bm1g==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1685779011;\n\tbh=cAWEa3NfkVrbPYoK1a6BVS1X1Z4HPm6BjAhCUj9LxvE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ZuIBQlVELOalRw3/SWukS6J+om2ESeP8WrSockLvaGHJ2D08B4ZA5Ulx7FECMkPlK\n\te7GSwZywsrVDeopm0dTE85CXvlVzmbDK2RHS21boVjRZmJhEatspoNOKlgScZJmnnZ\n\tgQq9CuxvyGf1H0CjVQNFipdqnW8W+iBMIDuTxFy8=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ZuIBQlVE\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sat, 3 Jun 2023 10:56:12 +0300", "Message-Id": "<20230603075615.20663-11-tomi.valkeinen@ideasonboard.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230603075615.20663-1-tomi.valkeinen@ideasonboard.com>", "References": "<20230603075615.20663-1-tomi.valkeinen@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v5 10/13] py: Add hotplug-monitor.py", "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>", "From": "Tomi Valkeinen via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add a simple example script which waits for camera hotplug events.\n\nSigned-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/py/examples/hotplug-monitor.py | 39 ++++++++++++++++++++++++++++++\n 1 file changed, 39 insertions(+)\n create mode 100755 src/py/examples/hotplug-monitor.py", "diff": "diff --git a/src/py/examples/hotplug-monitor.py b/src/py/examples/hotplug-monitor.py\nnew file mode 100755\nindex 00000000..5f42970c\n--- /dev/null\n+++ b/src/py/examples/hotplug-monitor.py\n@@ -0,0 +1,39 @@\n+#!/usr/bin/env python3\n+\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+# Copyright (C) 2022, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n+\n+import libcamera as libcam\n+import selectors\n+import sys\n+\n+\n+def main():\n+ cm = libcam.CameraManager.singleton()\n+\n+ sel = selectors.DefaultSelector()\n+ sel.register(cm.event_fd, selectors.EVENT_READ)\n+\n+ print('Waiting for camera hotplug events... (CTRL-C to exit)')\n+\n+ while True:\n+ try:\n+ events = sel.select()\n+ if not events:\n+ continue\n+ except KeyboardInterrupt:\n+ break\n+\n+ events = cm.get_events()\n+\n+ for ev in events:\n+ if ev.type == libcam.Event.Type.CameraAdded:\n+ print('Camera added:', ev.camera)\n+ elif ev.type == libcam.Event.Type.CameraRemoved:\n+ print('Camera removed:', ev.camera)\n+\n+ return 0\n+\n+\n+if __name__ == '__main__':\n+ sys.exit(main())\n", "prefixes": [ "libcamera-devel", "v5", "10/13" ] }