{"id":10515,"url":"https://patchwork.libcamera.org/api/1.1/covers/10515/?format=json","web_url":"https://patchwork.libcamera.org/cover/10515/","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":"<20201127133738.880859-1-tomi.valkeinen@iki.fi>","date":"2020-11-27T13:37:34","name":"[libcamera-devel,RFC,v2,0/4] prototype python bindings","submitter":{"id":70,"url":"https://patchwork.libcamera.org/api/1.1/people/70/?format=json","name":"Tomi Valkeinen","email":"tomi.valkeinen@iki.fi"},"mbox":"https://patchwork.libcamera.org/cover/10515/mbox/","series":[{"id":1487,"url":"https://patchwork.libcamera.org/api/1.1/series/1487/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1487","date":"2020-11-27T13:37:34","name":"prototype python bindings","version":2,"mbox":"https://patchwork.libcamera.org/series/1487/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/10515/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 5FC2BBE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Nov 2020 13:37:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DAEDF63470;\n\tFri, 27 Nov 2020 14:37:58 +0100 (CET)","from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com\n\t[IPv6:2a00:1450:4864:20::12e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CA545632EE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Nov 2020 14:37:57 +0100 (CET)","by mail-lf1-x12e.google.com with SMTP id d20so7049894lfe.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Nov 2020 05:37:57 -0800 (PST)","from deskari.ti.com (91-152-83-50.elisa-laajakaista.fi.\n\t[91.152.83.50]) by smtp.gmail.com with ESMTPSA id\n\tz199sm690892lfc.42.2020.11.27.05.37.56\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 27 Nov 2020 05:37:56 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"J2m0VtWl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=S7DTAGg+Rnwaz+fYTbm5QhnIQDCJ8kGR1Kx3UP0xdiY=;\n\tb=J2m0VtWlllLCYPMsMsa9unRzcIxzpfN7cOwrSJvKA9imsEyLH3ZfOxK4HdGzSwhpLB\n\tTTA8p+p89vXnQ/e4SXB6El5OaYMTx/GS8rKv6R5WPcoNH/G+mXkiMBXeSvixf41a02Ov\n\tcSYm9/T3pf4/5houCkEWx3qqrE4jgxzcGh1RdIA7vc6Hx+r78Vwzz7gkG3RtXX6uznZ+\n\tTKMZW6o16i6SSwYQTXMizt5r8tPg6uwSViqTUXUHBC6ayL5yGyL3WG8Q48vj/YGGPODL\n\tXxRf/PNqS45xX3zlvMvsGRJuAwKgS9AFif4T6FGzuLYxs/i7Oe17c/tk2Akh43rdpX7d\n\thw+A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:mime-version:content-transfer-encoding;\n\tbh=S7DTAGg+Rnwaz+fYTbm5QhnIQDCJ8kGR1Kx3UP0xdiY=;\n\tb=ikMr2cNzyXh85zxz/onZ9aJ35W2MCVwPGpVJBJpWGTvqcIP1ANOpDvmfoewlRskYNu\n\ttugum2i/tNCqlN0Buyk5kIlWAtOndvVeCjJ4R22Y35qPygUVIxDUFnlXNPi5hLZ/ZVDw\n\t2PX2QXyEXfcF9Ux7trklhH0zK7tAjUyqkbx76vCeDLYJvzS7HthOtlluINbbSd5aQ4C6\n\t1eTVAFTZ1QErtrvSVJbWl1Kt/uqbCXwi5LRly9i8PojLMdqTwhmQrjpF6eQpKmGr/XRc\n\tGVQ9yYvl4wIeqjA7cpuSiZOpzqQUNJJoN/1obA9ThUgMs2Lw8ySmOTCvRjBjNV9tZ2J9\n\tIyRA==","X-Gm-Message-State":"AOAM53359LGWYL6rMieplAmpUv8O7IyYB4hBDpRrNxGHXnl5+1z8iZ2F\n\tjC9u9WBThIvivDxkZgkECXLqnRf+A10=","X-Google-Smtp-Source":"ABdhPJzJumx501yqEaN6aODtM/ntbmI/a1LqbDjUImS2SDlXSfp5eOBFN/USshZstJBU8WxICBP43w==","X-Received":"by 2002:a19:22c9:: with SMTP id\n\ti192mr3685935lfi.65.1606484276901; \n\tFri, 27 Nov 2020 05:37:56 -0800 (PST)","From":"Tomi Valkeinen <tomi.valkeinen@iki.fi>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 27 Nov 2020 15:37:34 +0200","Message-Id":"<20201127133738.880859-1-tomi.valkeinen@iki.fi>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Subject":"[libcamera-devel] [RFC v2 0/4] prototype python bindings","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>","Cc":"Tomi Valkeinen <tomi.valkeinen@iki.fi>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Hi,\n\nIt's been a while since the v1 RFC, and even if I haven't had much time\nto work on this, I thought it's time to send a new version, at least to\navoid anyone testing the old one.\n\nToo many changes to v1 to mention them all (not that I even\nremember...), but a few here:\n\n- Use meson subprojects for pybind11. The public subproject repository\n  didn't have a recent pybind11, so I have pybind11 2.6.0 packaged here\n  in a separate patch.\n\n- Use eventfd to convey events from C++ to Python. This gets rid of\n  multiple issues, e.g. the locking problems and the callback\n  subscriptions.\n\n- simplecamera.py: a \"simple\" camera class which hopefully makes\n  libcamera more natural to use from python (compared to the very c++\n  like API that the basic bindings provide).\n\n- Some new tests:\n  * test.py: simple test that just captures frames and exists\n  * drmtest.py: uses kms++ python bindings to show the captured images\n    on screen.\n  * icam.py: Meant to run in an interactive python session. Uses Qt to\n  * show (possibly from multiple cameras) captured images. One can\n    adjust the cameras & controls via the python shell.\n\nSome clear issues are still present:\n- Memory management, especially related to Requests and FBs is still not\n  clear.\n- Not all control types are supported.\n- There are open parts in the SimpleCamera config sequences. It must be\n  simple, but you also have to be able to do everything, and at the\n  moment it's a bit of a mess.\n\nThis is not a request to review as such, as I know there are plenty of\nthings to fix. I think the best feedback would be on the area of\nthoughts about the API in general, or ideas on how to solve the issues.\n\n Tomi\n\nTomi Valkeinen (4):\n  hack: Camera public destructor\n  HACK: expose Camera* from Request\n  libcamera python bindings\n  py: update pybind11 wrap to 2.6.0\n\n .gitignore                                    |   2 +\n include/libcamera/camera.h                    |   2 +-\n include/libcamera/request.h                   |   1 +\n meson_options.txt                             |   2 +\n src/libcamera/request.cpp                     |   5 +\n src/meson.build                               |   1 +\n src/py/meson.build                            |   1 +\n src/py/pycamera/__init__.py                   |  11 +\n src/py/pycamera/meson.build                   |  38 ++\n src/py/pycamera/pymain.cpp                    | 382 ++++++++++++++++++\n src/py/test/drmtest.py                        | 129 ++++++\n src/py/test/icam.py                           | 154 +++++++\n src/py/test/run-valgrind.sh                   |   6 +\n src/py/test/run.sh                            |   3 +\n src/py/test/simplecamera.py                   | 198 +++++++++\n src/py/test/test.py                           | 210 ++++++++++\n src/py/test/valgrind-pycamera.supp            |  17 +\n .../packagecache/pybind11-2.6.0-wrap.zip      | Bin 0 -> 1456 bytes\n subprojects/packagecache/pybind11-2.6.0.zip   | Bin 0 -> 727287 bytes\n subprojects/pybind11.wrap                     |  10 +\n 20 files changed, 1171 insertions(+), 1 deletion(-)\n create mode 100644 src/py/meson.build\n create mode 100644 src/py/pycamera/__init__.py\n create mode 100644 src/py/pycamera/meson.build\n create mode 100644 src/py/pycamera/pymain.cpp\n create mode 100755 src/py/test/drmtest.py\n create mode 100755 src/py/test/icam.py\n create mode 100755 src/py/test/run-valgrind.sh\n create mode 100755 src/py/test/run.sh\n create mode 100644 src/py/test/simplecamera.py\n create mode 100755 src/py/test/test.py\n create mode 100644 src/py/test/valgrind-pycamera.supp\n create mode 100644 subprojects/packagecache/pybind11-2.6.0-wrap.zip\n create mode 100644 subprojects/packagecache/pybind11-2.6.0.zip\n create mode 100644 subprojects/pybind11.wrap"}