add build script

This commit is contained in:
wangjiyu 2025-04-09 16:51:49 +08:00
parent d2e50cf622
commit dc585389d6
2 changed files with 8 additions and 4 deletions

7
build.sh Normal file
View File

@ -0,0 +1,7 @@
g++ -shared -fPIC \
-I/usr/include/python3.10 -I./include \
-L./lib \
rtc_plugins.cpp util/RTCContext.cpp \
-lMRTCEngine -lboost_python310 -lpython3.10 \
-Wl,-rpath='$ORIGIN/lib' \
-o rtc_plugins.so

View File

@ -5,10 +5,8 @@
#include "./util/RTCContext.h" #include "./util/RTCContext.h"
void setPyCallback(boost::python::object callback) { int init(const char* selfUserId, const char* selfDisplayName, const char* selfRoomId, boost::python::object callback) {
RTCContext::instance().setPyCallback(callback); RTCContext::instance().setPyCallback(callback);
}
int init(const char* selfUserId, const char* selfDisplayName, const char* selfRoomId) {
bool res = RTCContext::instance().init(selfUserId, selfDisplayName, selfRoomId); bool res = RTCContext::instance().init(selfUserId, selfDisplayName, selfRoomId);
if (res) { if (res) {
return 0; return 0;
@ -39,7 +37,6 @@ int sendCustomAudioData(const int16_t channelIndex, void* customData, int32_t sa
BOOST_PYTHON_MODULE(rtc_plugins) { BOOST_PYTHON_MODULE(rtc_plugins) {
namespace py = boost::python; namespace py = boost::python;
py::def("setPyCallback", &setPyCallback);
py::def("init", &init); py::def("init", &init);
py::def("initRecv", &initRecv); py::def("initRecv", &initRecv);
py::def("initSend", &initSend); py::def("initSend", &initSend);