From 706a44abb3aa7b4535ded7d5c934147b7de06ed1 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 24 Nov 2017 09:50:42 +0200 Subject: Update to latest pybind11 Update to latest pybind11 HEAD. We can't use the latest tag (v2.2.0) as it has a regression. There were two problems when updating: 1) Difficulty in managing DrmObject derived classes Most of the DrmObjects are owned by Card, and can't be allocated or freed, but a few of them are allocated and freed by the user. For the former, we need to use unique_ptr with py::nodelete, but that prevents the latter from working. The solution was to not tell the python that the latter classes derive from DrmObject. This seems to be missing feature in pybind11, but I think we can live with it. 2) DrmObjects in STL containers vector where T is a DrmObject derived class doesn't work. We need to have a manual wrapper to return vector> instead. This also seems to be a pybind11 missing feature. Signed-off-by: Tomi Valkeinen --- py/pykms/pykmsomap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'py/pykms/pykmsomap.cpp') diff --git a/py/pykms/pykmsomap.cpp b/py/pykms/pykmsomap.cpp index 2662a18..4fc7084 100644 --- a/py/pykms/pykmsomap.cpp +++ b/py/pykms/pykmsomap.cpp @@ -10,11 +10,11 @@ using namespace std; void init_pykmsomap(py::module &m) { - py::class_(m, "OmapCard", py::base()) + py::class_(m, "OmapCard") .def(py::init<>()) ; - py::class_ omapfb(m, "OmapFramebuffer", py::base()); + py::class_ omapfb(m, "OmapFramebuffer"); // XXX we should use py::arithmetic() here to support or and and operators, but it's not supported in the pybind11 we use py::enum_(omapfb, "Flags") -- cgit v1.2.3