debug
This commit is contained in:
parent
c668b06ef8
commit
80fe99160f
|
@ -303,7 +303,7 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
||||||
|
|
||||||
// 1. 获取GIL
|
// 1. 获取GIL
|
||||||
std::cout << "[1] 获取GIL锁..." << std::endl;
|
std::cout << "[1] 获取GIL锁..." << std::endl;
|
||||||
PyGILState_STATE gstate = PyGILState_Ensure();
|
//PyGILState_STATE gstate = PyGILState_Ensure();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 2. 输入参数校验
|
// 2. 输入参数校验
|
||||||
|
@ -321,7 +321,8 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
||||||
// 3. 创建共享内存
|
// 3. 创建共享内存
|
||||||
std::cout << "[3] 创建共享内存..." << std::endl;
|
std::cout << "[3] 创建共享内存..." << std::endl;
|
||||||
char shm_name[32];
|
char shm_name[32];
|
||||||
snprintf(shm_name, sizeof(shm_name), "/audio_shm_%d", getpid());
|
//snprintf(shm_name, sizeof(shm_name), "/audio_shm_%d", getpid());
|
||||||
|
snprintf(shm_name, sizeof(shm_name), "/audio_shm_test");
|
||||||
|
|
||||||
int fd = shm_open(shm_name, O_CREAT | O_RDWR, 0666);
|
int fd = shm_open(shm_name, O_CREAT | O_RDWR, 0666);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
|
@ -452,12 +453,12 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
||||||
shm_unlink(shm_name);
|
shm_unlink(shm_name);
|
||||||
|
|
||||||
std::cout << "[9] 释放GIL..." << std::endl;
|
std::cout << "[9] 释放GIL..." << std::endl;
|
||||||
PyGILState_Release(gstate);
|
//PyGILState_Release(gstate);
|
||||||
std::cout << "=== 音频处理完成 ===" << std::endl;
|
std::cout << "=== 音频处理完成 ===" << std::endl;
|
||||||
|
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
std::cout << "[EXCEPTION] 异常捕获: " << e.what() << std::endl;
|
std::cout << "[EXCEPTION] 异常捕获: " << e.what() << std::endl;
|
||||||
PyGILState_Release(gstate);
|
//PyGILState_Release(gstate);
|
||||||
std::cerr << "Audio process error: " << e.what() << std::endl;
|
std::cerr << "Audio process error: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue