This commit is contained in:
wangjiyu 2025-05-03 23:02:06 +08:00
parent 0228402b5b
commit b6a33bcfbd
1 changed files with 0 additions and 18 deletions

View File

@ -60,25 +60,7 @@ public:
static RTCContext instance;
return instance;
}
static void** numpy_api() {
static void** api = [](){
// 强制初始化NumPy
if (_import_array() < 0) {
PyErr_Print();
throw std::runtime_error("NumPy initialization failed");
}
void** ptr = reinterpret_cast<void**>(RTC_PLUGINS_ARRAY_API);
std::cout << "ptr:" << ptr << std::endl;
if (!ptr || !ptr[93]) {
std::cerr << "NumPy API corrupt! Expected at 93: "
<< (ptr ? (void*)ptr[93] : nullptr) << std::endl;
abort();
}
return ptr;
}();
return api;
}
RTCContext(const RTCContext&) = delete;
RTCContext& operator=(const RTCContext&) = delete;
mrtc::IMRTCEngine* getRtcEngine() const;