summaryrefslogtreecommitdiff
path: root/py/pykms/pyvid.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-11-24 09:50:42 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-11-24 10:05:01 +0200
commit706a44abb3aa7b4535ded7d5c934147b7de06ed1 (patch)
tree41e0b10413ab6d24fdfeeaa6a28c3f335c7198c3 /py/pykms/pyvid.cpp
parent75e85e48c35f9e18a974af1c1e973d9482ed1fc4 (diff)
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<T> where T is a DrmObject derived class doesn't work. We need to have a manual wrapper to return vector<unique_ptr<T, py::nodelete>> instead. This also seems to be a pybind11 missing feature. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'py/pykms/pyvid.cpp')
-rw-r--r--py/pykms/pyvid.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/pykms/pyvid.cpp b/py/pykms/pyvid.cpp
index 01177d5..6a6080e 100644
--- a/py/pykms/pyvid.cpp
+++ b/py/pykms/pyvid.cpp
@@ -11,7 +11,7 @@ using namespace std;
void init_pyvid(py::module &m)
{
- py::class_<VideoDevice, VideoDevice*>(m, "VideoDevice")
+ py::class_<VideoDevice>(m, "VideoDevice")
.def(py::init<const string&>())
.def_property_readonly("fd", &VideoDevice::fd)
.def_property_readonly("has_capture", &VideoDevice::has_capture)
@@ -24,7 +24,7 @@ void init_pyvid(py::module &m)
.def("get_capture_devices", &VideoDevice::get_capture_devices)
;
- py::class_<VideoStreamer, VideoStreamer*>(m, "VideoStreamer")
+ py::class_<VideoStreamer>(m, "VideoStreamer")
.def_property_readonly("fd", &VideoStreamer::fd)
.def_property_readonly("ports", &VideoStreamer::get_ports)
.def("set_port", &VideoStreamer::set_port)