lasp/src/lasp/pybind11/lasp_streammgr.cpp

30 lines
890 B
C++
Raw Normal View History

2022-07-20 12:58:48 +00:00
#include "lasp_streammgr.h"
#include <pybind11/numpy.h>
#include <pybind11/pybind11.h>
2022-07-20 12:58:48 +00:00
#include <pybind11/stl.h>
#include <stdint.h>
using std::cerr;
namespace py = pybind11;
void init_streammgr(py::module &m) {
py::class_<StreamMgr, std::unique_ptr<StreamMgr, py::nodelete>> smgr(
m, "StreamMgr");
py::enum_<StreamMgr::StreamType>(smgr, "StreamType")
.value("input", StreamMgr::StreamType::input)
.value("output", StreamMgr::StreamType::output)
.export_values();
2022-07-20 12:58:48 +00:00
smgr.def("startStream", &StreamMgr::startStream);
smgr.def("stopStream", &StreamMgr::stopStream);
2022-07-20 12:58:48 +00:00
smgr.def_static("getInstance", []() {
return std::unique_ptr<StreamMgr, py::nodelete>(&StreamMgr::getInstance());
});
smgr.def("stopAllStreams", &StreamMgr::stopAllStreams);
smgr.def("setSiggen", &StreamMgr::setSiggen);
smgr.def("getDeviceInfo", &StreamMgr::getDeviceInfo);
2022-07-20 12:58:48 +00:00
}