summaryrefslogtreecommitdiff
path: root/py/pyvid.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-20 08:53:36 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-20 08:53:36 +0300
commitc1138d9e30a3426a1d734c1de28218102bcb05d4 (patch)
treeac73959ce506b4a21c26edc3cc1503223ff446b4 /py/pyvid.cpp
parent33c98598a79b8cd15ded9c91b0bc580fe1ed6fb9 (diff)
parent6f5d1817fdb305b9f63a5e8abfbcf46da41d3245 (diff)
Merge V4L2 related work
Diffstat (limited to 'py/pyvid.cpp')
-rw-r--r--py/pyvid.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/py/pyvid.cpp b/py/pyvid.cpp
new file mode 100644
index 0000000..01177d5
--- /dev/null
+++ b/py/pyvid.cpp
@@ -0,0 +1,38 @@
+#include <pybind11/pybind11.h>
+#include <pybind11/stl.h>
+#include <kms++/kms++.h>
+#include <kms++util/kms++util.h>
+#include <kms++util/videodevice.h>
+
+namespace py = pybind11;
+
+using namespace kms;
+using namespace std;
+
+void init_pyvid(py::module &m)
+{
+ py::class_<VideoDevice, VideoDevice*>(m, "VideoDevice")
+ .def(py::init<const string&>())
+ .def_property_readonly("fd", &VideoDevice::fd)
+ .def_property_readonly("has_capture", &VideoDevice::has_capture)
+ .def_property_readonly("has_output", &VideoDevice::has_output)
+ .def_property_readonly("has_m2m", &VideoDevice::has_m2m)
+ .def_property_readonly("capture_streamer", &VideoDevice::get_capture_streamer)
+ .def_property_readonly("output_streamer", &VideoDevice::get_output_streamer)
+ .def_property_readonly("discrete_frame_sizes", &VideoDevice::get_discrete_frame_sizes)
+ .def_property_readonly("frame_sizes", &VideoDevice::get_frame_sizes)
+ .def("get_capture_devices", &VideoDevice::get_capture_devices)
+ ;
+
+ py::class_<VideoStreamer, VideoStreamer*>(m, "VideoStreamer")
+ .def_property_readonly("fd", &VideoStreamer::fd)
+ .def_property_readonly("ports", &VideoStreamer::get_ports)
+ .def("set_port", &VideoStreamer::set_port)
+ .def_property_readonly("formats", &VideoStreamer::get_formats)
+ .def("set_format", &VideoStreamer::set_format)
+ .def("set_queue_size", &VideoStreamer::set_queue_size)
+ .def("queue", &VideoStreamer::queue)
+ .def("dequeue", &VideoStreamer::dequeue)
+ .def("stream_on", &VideoStreamer::stream_on)
+ ;
+}