diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2017-12-07 20:20:54 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-12-08 08:48:03 +0200 |
commit | 260f66b0863a77a7d6c3682afaa67fe2b9bb24b6 (patch) | |
tree | e6d7ce662464cb4067ed77f42a0753f91c02e8a5 /py | |
parent | 74a4a777627029dc51d4b1df89bedda501dc7543 (diff) |
py: Add Card crtcs and encoders properties back to the Python bindings
Commit 706a44abb3aa ("Update to latest pybind11") removed the crtcs and
encoders properties from the Card class. Add them back by wrapping the
associated C++ methods manually due to a limitation of pybind11.
Fixes: 706a44abb3aa ("Update to latest pybind11")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'py')
-rw-r--r-- | py/pykms/pykmsbase.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp index 79c502c..dd09fae 100644 --- a/py/pykms/pykmsbase.cpp +++ b/py/pykms/pykmsbase.cpp @@ -24,6 +24,20 @@ void init_pykmsbase(py::module &m) return v; }) + .def_property_readonly("crtcs", [](Card* self) { + vector<unique_ptr<Crtc, py::nodelete>> v; + for (Crtc* p : self->get_crtcs()) + v.push_back(unique_ptr<Crtc, py::nodelete>(p)); + return v; + }) + + .def_property_readonly("encoders", [](Card* self) { + vector<unique_ptr<Encoder, py::nodelete>> v; + for (Encoder* p : self->get_encoders()) + v.push_back(unique_ptr<Encoder, py::nodelete>(p)); + return v; + }) + .def_property_readonly("planes", [](Card* self) { vector<unique_ptr<Plane, py::nodelete>> v; for (Plane* p : self->get_planes()) |