Add Python bindings

Add libcamera Python bindings. pybind11 is used to generate the C++ <->
Python layer.

We use pybind11 'smart_holder' version to avoid issues with private
destructors and shared_ptr. There is also an alternative solution here:

https://github.com/pybind/pybind11/pull/2067

Only a subset of libcamera classes are exposed. Implementing and testing
the wrapper classes is challenging, and as such only classes that I have
needed have been added so far.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Tomi Valkeinen 2022-05-09 13:10:20 +03:00 committed by Kieran Bingham
parent 5cb17e0c13
commit 8aa02271fd
11 changed files with 845 additions and 1 deletions

View file

@ -58,3 +58,8 @@ option('v4l2',
type : 'boolean',
value : false,
description : 'Compile the V4L2 compatibility layer')
option('pycamera',
type : 'feature',
value : 'auto',
description : 'Enable libcamera Python bindings (experimental)')