From dc585389d6d6bdfee1ae67338d82c0601b894e41 Mon Sep 17 00:00:00 2001 From: wangjiyu Date: Wed, 9 Apr 2025 16:51:49 +0800 Subject: [PATCH] add build script --- build.sh | 7 +++++++ rtc_plugins.cpp | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 build.sh diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..cec4eef --- /dev/null +++ b/build.sh @@ -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 \ No newline at end of file diff --git a/rtc_plugins.cpp b/rtc_plugins.cpp index 7d4e141..2ae7bb6 100644 --- a/rtc_plugins.cpp +++ b/rtc_plugins.cpp @@ -5,10 +5,8 @@ #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); -} -int init(const char* selfUserId, const char* selfDisplayName, const char* selfRoomId) { bool res = RTCContext::instance().init(selfUserId, selfDisplayName, selfRoomId); if (res) { return 0; @@ -39,7 +37,6 @@ int sendCustomAudioData(const int16_t channelIndex, void* customData, int32_t sa 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);