#include #include #include #include "./util/RTCContext.h" void setPyCallback(boost::python::object callback) { RTCContext::instance().setPyCallback(callback); } int init(const char* selfUserId, const char* selfDisplayName, const char* selfRoomId) { bool res = RTCContext::instance().init(selfUserId, selfDisplayName, selfRoomId); if (res) { return 0; } else { return -1; } } int initRecv(const char* destRoomId, const char* srcUserId, const int16_t destChannelIndex) { bool res = RTCContext::instance().initRecv(destRoomId, srcUserId, destChannelIndex); if (res) { return 0; } else { return -1; } } int initSend(const char* destRoomId, const int16_t destChannelIndex) { bool res = RTCContext::instance().initSend(destRoomId, destChannelIndex); if (res) { return 0; } else { return -1; } } int sendCustomAudioData(const int16_t channelIndex, void* customData, int32_t sampleRate, uint64_t channelNum, uint64_t dataLen) { return RTCContext::instance().sendCustomAudioData(channelIndex, customData, sampleRate, channelNum, dataLen); } BOOST_PYTHON_MODULE(rtc_plugins) { namespace py = boost::python; py::def("setPyCallback", &setPyCallback); py::def("init", &init); py::def("initRecv", &initRecv); py::def("initSend", &initSend); py::def("sendCustomAudioData", &sendCustomAudioData); }