[libcamera-devel] [RFC 0/4] prototype python bindings

David Plowman david.plowman at raspberrypi.com
Mon Sep 21 13:08:24 CEST 2020


Hi Tomi

Thank you for sharing this, I think it is very interesting work.

I was wondering, is there a discussion anywhere of what this Python API
will look like for end users and how it would be used? You may know that
Raspberry Pi has something called PiCamera which is a set of Python
bindings for our existing (non-libcamera) camera stack. However, I think
it's probably at a rather higher level that what is being envisaged for
libcamera and therefore cannot be compared directly. But I'm definitely
interested to understand more about it, and how (for example) we might
build on top of it to provide something closer to what our users have been
accustomed to.

Thanks again!
David

On Fri, 18 Sep 2020 at 16:21, Tomi Valkeinen <tomi.valkeinen at iki.fi> wrote:

> Hi,
>
> Laurent asked me to send these to get discussions about the challenges
> on the list (rather than in private chats...).
>
> This is a prototype, RFC, hack, whatever you want to call it, but it
> works for me for the small subset of features used in test.py.
>
> The main patch "libcamera python bindings" has some questions/issues
> listed in the description, and I've added comments to the code where I'm
> not sure where to go.
>
> There were no submodules in libcamera, so I used the same convention
> I've used in kms++: ext/<submodule>. pybind11 could be added as
> something that comes from the system (at least Ubuntu 20.04 has it), but
> as it's header only, I think having it as a submodule is the easiest and
> most manageable way to add it.
>
>  Tomi
>
> Tomi Valkeinen (4):
>   Add pybind11 submodule
>   Add BoundMethodFunction
>   hack: Camera public destructor
>   libcamera python bindings
>
>  .gitmodules                      |   3 +
>  ext/pybind11                     |   1 +
>  include/libcamera/bound_method.h |  25 +++++
>  include/libcamera/camera.h       |   2 +-
>  include/libcamera/signal.h       |   6 ++
>  meson.build                      |   1 +
>  meson_options.txt                |   2 +
>  py/meson.build                   |   1 +
>  py/pycamera/__init__.py          |  29 +++++
>  py/pycamera/meson.build          |  35 ++++++
>  py/pycamera/pymain.cpp           | 169 +++++++++++++++++++++++++++++
>  py/test/run-valgrind.sh          |   3 +
>  py/test/run.sh                   |   3 +
>  py/test/test.py                  | 177 +++++++++++++++++++++++++++++++
>  py/test/valgrind-pycamera.supp   |  17 +++
>  15 files changed, 473 insertions(+), 1 deletion(-)
>  create mode 100644 .gitmodules
>  create mode 160000 ext/pybind11
>  create mode 100644 py/meson.build
>  create mode 100644 py/pycamera/__init__.py
>  create mode 100644 py/pycamera/meson.build
>  create mode 100644 py/pycamera/pymain.cpp
>  create mode 100755 py/test/run-valgrind.sh
>  create mode 100755 py/test/run.sh
>  create mode 100755 py/test/test.py
>  create mode 100644 py/test/valgrind-pycamera.supp
>
> --
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20200921/da4dff43/attachment-0001.htm>


More information about the libcamera-devel mailing list