From e96a0e9b7aecc5c3b3cc3fbf705a0942bf105c9e Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 3 Jan 2017 10:38:32 +0200 Subject: Update pybind11 to v2.0 --- py/pykms/pyvid.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'py/pykms/pyvid.cpp') 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_(m, "VideoDevice") + py::class_(m, "VideoDevice") .def(py::init()) .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_(m, "VideoStreamer") + py::class_(m, "VideoStreamer") .def_property_readonly("fd", &VideoStreamer::fd) .def_property_readonly("ports", &VideoStreamer::get_ports) .def("set_port", &VideoStreamer::set_port) -- cgit v1.2.3