debug
This commit is contained in:
parent
e089162220
commit
7c11d681f9
|
@ -109,6 +109,9 @@ int sendCustomAudioData(int16_t destChannelIndex, py::object pD,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
RetAudioFrame getData() {
|
||||||
|
return RTCContext::instance().getData();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
int sendCustomAudioData(const int16_t destChannelIndex, py::object pyData, int32_t sampleRate, uint64_t channelNum,
|
int sendCustomAudioData(const int16_t destChannelIndex, py::object pyData, int32_t sampleRate, uint64_t channelNum,
|
||||||
|
@ -200,6 +203,7 @@ BOOST_PYTHON_MODULE(rtc_plugins) {
|
||||||
py::def("initSend", &initSend);
|
py::def("initSend", &initSend);
|
||||||
py::def("sendCustomAudioData", &sendCustomAudioData);
|
py::def("sendCustomAudioData", &sendCustomAudioData);
|
||||||
py::def("getSize", &getSize);
|
py::def("getSize", &getSize);
|
||||||
|
py::def("getData", &getData);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
PyErr_SetString(PyExc_RuntimeError, "Module initialization failed");
|
PyErr_SetString(PyExc_RuntimeError, "Module initialization failed");
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,4 +58,6 @@ while True:
|
||||||
print("resend succ")
|
print("resend succ")
|
||||||
size = rtc_plugins.getSize()
|
size = rtc_plugins.getSize()
|
||||||
print(f"data size:{size}")
|
print(f"data size:{size}")
|
||||||
time.sleep(30)
|
frame = rtc_plugins.getData()
|
||||||
|
print(f"dataCount:{frame.dataCount}")
|
||||||
|
time.sleep(3)
|
||||||
|
|
|
@ -305,7 +305,7 @@ void printTimestamp() {
|
||||||
// 转换为本地时间(可读格式)
|
// 转换为本地时间(可读格式)
|
||||||
std::time_t time = std::chrono::system_clock::to_time_t(now);
|
std::time_t time = std::chrono::system_clock::to_time_t(now);
|
||||||
std::cout << "Timestamp: " << timestamp << "." << milliseconds
|
std::cout << "Timestamp: " << timestamp << "." << milliseconds
|
||||||
<< " (Local: " << std::ctime(&time) << ")";
|
<< " (Local: " << std::ctime(&time) << ")" << std::endl;
|
||||||
}
|
}
|
||||||
void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
||||||
mrtc::MRTCAudioFrame& audioFrame,
|
mrtc::MRTCAudioFrame& audioFrame,
|
||||||
|
|
|
@ -96,6 +96,8 @@ public:
|
||||||
bool initRecv(const char* destRoomId, const char* srcUserId, const int16_t destChannelIndex);
|
bool initRecv(const char* destRoomId, const char* srcUserId, const int16_t destChannelIndex);
|
||||||
bool initSend(const char* srcRoomId, const char* destRoomId, const int16_t destChannelIndex, const uint8_t channelNum);
|
bool initSend(const char* srcRoomId, const char* destRoomId, const int16_t destChannelIndex, const uint8_t channelNum);
|
||||||
int16_t getSize();
|
int16_t getSize();
|
||||||
|
void setData(const mrtc::MRTCAudioFrame& frame);
|
||||||
|
RetAudioFrame getData();
|
||||||
|
|
||||||
void* getpData() const;
|
void* getpData() const;
|
||||||
void setpData(void* pData);
|
void setpData(void* pData);
|
||||||
|
@ -137,6 +139,4 @@ private:
|
||||||
void onAudioProcess(const char* roomId, const char* peerId,
|
void onAudioProcess(const char* roomId, const char* peerId,
|
||||||
mrtc::MRTCAudioFrame& audioFrame, mrtc::MRTCAudioSourceType audioSourceType);
|
mrtc::MRTCAudioFrame& audioFrame, mrtc::MRTCAudioSourceType audioSourceType);
|
||||||
void onProducer(uint32_t msgId, mrtc::MRTCProducerInfo& info);
|
void onProducer(uint32_t msgId, mrtc::MRTCProducerInfo& info);
|
||||||
void setData(const mrtc::MRTCAudioFrame& frame);
|
|
||||||
RetAudioFrame getData();
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue