[libcamera-devel] [PATCH] py: Add constructor for SensorConfiguration

David Plowman david.plowman at raspberrypi.com
Thu Sep 28 11:19:21 CEST 2023


Sorry, please ignore this patch. It's assuming the Python bindings
have been updated for the SensorConfiguration, but on master they
haven't been yet! Anyway, that patch needs submitting first so I'll do
that, and roll this fix in directly.

Thanks
David

On Wed, 27 Sept 2023 at 17:34, David Plowman
<david.plowman at raspberrypi.com> wrote:
>
> The SensorConfiguration is optional within the CameraConfiguration, so
> Python applications need a constructor to create a SensorConfiguration
> object that can be put there.
>
> Signed-off-by: David Plowman <david.plowman at raspberrypi.com>
> ---
>  src/py/libcamera/py_main.cpp | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp
> index c36e6e6c..8df04520 100644
> --- a/src/py/libcamera/py_main.cpp
> +++ b/src/py/libcamera/py_main.cpp
> @@ -283,6 +283,7 @@ PYBIND11_MODULE(_libcamera, m)
>                 });
>
>         pySensorConfiguration
> +               .def(py::init<>())
>                 .def_readwrite("bit_depth", &SensorConfiguration::bitDepth)
>                 .def_readwrite("output_size", &SensorConfiguration::outputSize);
>
> --
> 2.39.2
>


More information about the libcamera-devel mailing list