debug
This commit is contained in:
parent
b9a981b57a
commit
8a2389bf68
|
@ -359,6 +359,7 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
||||||
std::cout << "step2" << std::endl;
|
std::cout << "step2" << std::endl;
|
||||||
np::dtype dtype = np::dtype::get_builtin<int16_t>();
|
np::dtype dtype = np::dtype::get_builtin<int16_t>();
|
||||||
std::cout << "step3" << std::endl;
|
std::cout << "step3" << std::endl;
|
||||||
|
/*
|
||||||
np::ndarray audioArray = np::from_data(
|
np::ndarray audioArray = np::from_data(
|
||||||
audioFrame.data, // 数据指针
|
audioFrame.data, // 数据指针
|
||||||
dtype, // 数据类型 (int16)
|
dtype, // 数据类型 (int16)
|
||||||
|
@ -366,6 +367,7 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
||||||
py::make_tuple(sizeof(int16_t)), // 步长
|
py::make_tuple(sizeof(int16_t)), // 步长
|
||||||
py::object() // 所有者(Python管理)
|
py::object() // 所有者(Python管理)
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
std::cout << " 数据拷贝完成" << std::endl;
|
std::cout << " 数据拷贝完成" << std::endl;
|
||||||
|
|
||||||
// 7. 执行回调
|
// 7. 执行回调
|
||||||
|
@ -380,7 +382,6 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
||||||
std::cout << " pyCallback_ repr: " << PyUnicode_AsUTF8(repr) << std::endl;
|
std::cout << " pyCallback_ repr: " << PyUnicode_AsUTF8(repr) << std::endl;
|
||||||
Py_DECREF(repr); // 必须手动释放
|
Py_DECREF(repr); // 必须手动释放
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
// 传递共享内存信息
|
// 传递共享内存信息
|
||||||
pyCallback_(
|
pyCallback_(
|
||||||
py::str(shm_name), // 共享内存名称
|
py::str(shm_name), // 共享内存名称
|
||||||
|
@ -390,7 +391,7 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
||||||
audioFrame.numChannels,
|
audioFrame.numChannels,
|
||||||
audioFrame.channelIndex
|
audioFrame.channelIndex
|
||||||
);
|
);
|
||||||
*/
|
/*
|
||||||
pyCallback_(
|
pyCallback_(
|
||||||
audioArray, // numpy 数组
|
audioArray, // numpy 数组
|
||||||
data_size, // 数据大小
|
data_size, // 数据大小
|
||||||
|
@ -399,6 +400,7 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
||||||
audioFrame.numChannels,
|
audioFrame.numChannels,
|
||||||
audioFrame.channelIndex
|
audioFrame.channelIndex
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
std::cout << " after callback" << std::endl;
|
std::cout << " after callback" << std::endl;
|
||||||
if (PyErr_Occurred()) {
|
if (PyErr_Occurred()) {
|
||||||
PyObject *type, *value, *traceback;
|
PyObject *type, *value, *traceback;
|
||||||
|
|
Loading…
Reference in New Issue