summaryrefslogtreecommitdiff
path: root/py/pykms/pyvid.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-01-03 10:38:32 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-02-12 17:01:37 +0200
commite96a0e9b7aecc5c3b3cc3fbf705a0942bf105c9e (patch)
tree3ed3ed667a53df405e41c15d517b98946166b603 /py/pykms/pyvid.cpp
parentf7198ea11d043768c27b9b0376c8810365aabe10 (diff)
Update pybind11 to v2.0
Diffstat (limited to 'py/pykms/pyvid.cpp')
-rw-r--r--py/pykms/pyvid.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/py/pykms/pyvid.cpp b/py/pykms/pyvid.cpp
index 01177d5..c441562 100644
--- a/py/pykms/pyvid.cpp
+++ b/py/pykms/pyvid.cpp
@@ -9,9 +9,15 @@ namespace py = pybind11;
using namespace kms;
using namespace std;
+PYBIND11_DECLARE_HOLDER_TYPE(T, T*, true);
+
+// XXX I don't think these are really needed. Use return value parameters.
+typedef VideoDevice* VideoDeviceHolder;
+typedef VideoStreamer* VideoStreamerHolder;
+
void init_pyvid(py::module &m)
{
- py::class_<VideoDevice, VideoDevice*>(m, "VideoDevice")
+ py::class_<VideoDevice, VideoDeviceHolder>(m, "VideoDevice")
.def(py::init<const string&>())
.def_property_readonly("fd", &VideoDevice::fd)
.def_property_readonly("has_capture", &VideoDevice::has_capture)
@@ -24,7 +30,7 @@ void init_pyvid(py::module &m)
.def("get_capture_devices", &VideoDevice::get_capture_devices)
;
- py::class_<VideoStreamer, VideoStreamer*>(m, "VideoStreamer")
+ py::class_<VideoStreamer, VideoStreamerHolder>(m, "VideoStreamer")
.def_property_readonly("fd", &VideoStreamer::fd)
.def_property_readonly("ports", &VideoStreamer::get_ports)
.def("set_port", &VideoStreamer::set_port)