srtp自动初始化,支持多线程

This commit is contained in:
ziyue
2021-03-27 09:38:13 +08:00
parent bdf2783a6b
commit 0d4cc2fc65
3 changed files with 66 additions and 63 deletions

View File

@@ -5,15 +5,16 @@
WebRtcTransport::WebRtcTransport() {
static onceToken token([](){
RTC::DtlsTransport::ClassInit();
RTC::DepLibSRTP::ClassInit();
RTC::SrtpSession::ClassInit();
});
dtls_transport_ = std::make_shared<RTC::DtlsTransport>(EventPollerPool::Instance().getFirstPoller(), this);
ice_server_ = std::make_shared<RTC::IceServer>(this, makeRandStr(4), makeRandStr(24));
}
WebRtcTransport::~WebRtcTransport() {}
WebRtcTransport::~WebRtcTransport() {
dtls_transport_ = nullptr;
ice_server_ = nullptr;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////