[libcamera-devel] [RFC v3 0/5] Python bindings

Tomi Valkeinen tomi.valkeinen at ideasonboard.com
Thu Dec 9 10:29:01 CET 2021


Hi,

Third RFC of the python bindings. I believe it's over a year since the
last version, and I've been tinkering with the bindings every now and
then.

This version includes cam.py, which mimics 'cam' tool. The idea is not
to try to replace 'cam', but to test the bindings in a real use case,
rather than artificial tests.

There are a few clear items that should be done to make this more
usable:

- Fix the ControlValue handling, as arrays are not handled at all.
  Possibly other types are not handled correctly.
- Add ControlList parameter to Camera.start()
- Add Transform

 Tomi

Tomi Valkeinen (5):
  HACK: Camera public destructor
  libcamera: Request: expose Camera from Request
  gitignore: add .cache
  Add Python bindings
  py: Add cam.py

 .gitignore                  |   2 +
 include/libcamera/camera.h  |   2 +-
 include/libcamera/request.h |   2 +
 meson.build                 |   1 +
 meson_options.txt           |   5 +
 src/libcamera/request.cpp   |   5 +
 src/meson.build             |   1 +
 src/py/meson.build          |   1 +
 src/py/pycamera/__init__.py |  10 +
 src/py/pycamera/meson.build |  43 ++++
 src/py/pycamera/pymain.cpp  | 424 ++++++++++++++++++++++++++++++++
 src/py/test/cam.py          | 464 ++++++++++++++++++++++++++++++++++++
 src/py/test/cam_kms.py      | 185 ++++++++++++++
 src/py/test/cam_null.py     |  46 ++++
 src/py/test/cam_qt.py       | 355 +++++++++++++++++++++++++++
 src/py/test/cam_qtgl.py     | 385 ++++++++++++++++++++++++++++++
 src/py/test/gl_helpers.py   |  67 ++++++
 subprojects/pybind11.wrap   |  12 +
 18 files changed, 2009 insertions(+), 1 deletion(-)
 create mode 100644 src/py/meson.build
 create mode 100644 src/py/pycamera/__init__.py
 create mode 100644 src/py/pycamera/meson.build
 create mode 100644 src/py/pycamera/pymain.cpp
 create mode 100755 src/py/test/cam.py
 create mode 100644 src/py/test/cam_kms.py
 create mode 100644 src/py/test/cam_null.py
 create mode 100644 src/py/test/cam_qt.py
 create mode 100644 src/py/test/cam_qtgl.py
 create mode 100644 src/py/test/gl_helpers.py
 create mode 100644 subprojects/pybind11.wrap

-- 
2.25.1



More information about the libcamera-devel mailing list