aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart2017-12-07 10:06:40 -0600
committerTomi Valkeinen2017-12-08 00:48:03 -0600
commit74a4a777627029dc51d4b1df89bedda501dc7543 (patch)
treeea1e9054d4150c3ea7c510082b12bf964b938714
parentc13047e3f7674a5a05b107ef3fd97d9ff4165639 (diff)
downloadexternal-kmsxx-74a4a777627029dc51d4b1df89bedda501dc7543.tar.gz
external-kmsxx-74a4a777627029dc51d4b1df89bedda501dc7543.tar.xz
external-kmsxx-74a4a777627029dc51d4b1df89bedda501dc7543.zip
Fix Python bindings for Connector::get_possible_crtcs() method
The method returns an std::vector of DRMObject, which isn't supported by the latest pybind11 as explained in commit 706a44abb3aa. Fix it by wrapping the method manually. Fixes: 706a44abb3aa ("Update to latest pybind11") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--py/pykms/pykmsbase.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp
index 96ebe7a..79c502c 100644
--- a/py/pykms/pykmsbase.cpp
+++ b/py/pykms/pykmsbase.cpp
@@ -54,7 +54,12 @@ void init_pykmsbase(py::module &m)
54 .def_property_readonly("fullname", &Connector::fullname) 54 .def_property_readonly("fullname", &Connector::fullname)
55 .def("get_default_mode", &Connector::get_default_mode) 55 .def("get_default_mode", &Connector::get_default_mode)
56 .def("get_current_crtc", &Connector::get_current_crtc) 56 .def("get_current_crtc", &Connector::get_current_crtc)
57 .def("get_possible_crtcs", &Connector::get_possible_crtcs) 57 .def("get_possible_crtcs", [](Connector* self) {
58 vector<unique_ptr<Crtc, py::nodelete>> v;
59 for (Crtc* p : self->get_possible_crtcs())
60 v.push_back(unique_ptr<Crtc, py::nodelete>(p));
61 return v;
62 })
58 .def("get_modes", &Connector::get_modes) 63 .def("get_modes", &Connector::get_modes)
59 .def("get_mode", (Videomode (Connector::*)(const string& mode) const)&Connector::get_mode) 64 .def("get_mode", (Videomode (Connector::*)(const string& mode) const)&Connector::get_mode)
60 .def("get_mode", (Videomode (Connector::*)(unsigned xres, unsigned yres, float refresh, bool ilace) const)&Connector::get_mode) 65 .def("get_mode", (Videomode (Connector::*)(unsigned xres, unsigned yres, float refresh, bool ilace) const)&Connector::get_mode)