#include #include #include #include "./util/RTCContext.h" int init(const char* selfUserId, const char* selfDisplayName, const char* selfRoomId, boost::python::object callback) { RTCContext::instance().setPyCallback(callback); 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 destChannelIndex, void* customData, int32_t sampleRate, uint64_t channelNum, uint64_t dataLen) { return RTCContext::instance().sendCustomAudioData(destChannelIndex, customData, sampleRate, channelNum, dataLen); } BOOST_PYTHON_MODULE(rtc_plugins) { namespace py = boost::python; py::def("init", &init); py::def("initRecv", &initRecv); py::def("initSend", &initSend); py::def("sendCustomAudioData", &sendCustomAudioData); }