提交 5d394004 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Make Transport:SendRtcp() private

上级 1cc8a85f
......@@ -93,12 +93,12 @@ namespace RTC
void ChangeUfragPwd(std::string& usernameFragment, std::string& password);
void SendRtpPacket(RTC::RtpPacket* packet);
void SendRtcpPacket(RTC::RTCP::Packet* packet);
void SendRtcp(uint64_t now);
private:
bool IsConnected() const;
void MayRunDtlsTransport();
void HandleRtcpPacket(RTC::RTCP::Packet* packet);
void SendRtcp(uint64_t now);
void SendRtcpCompoundPacket(RTC::RTCP::CompoundPacket* packet);
RTC::Consumer* GetConsumer(uint32_t ssrc) const;
......
......@@ -575,30 +575,6 @@ namespace RTC
this->selectedTuple->Send(data, len);
}
void Transport::SendRtcpCompoundPacket(RTC::RTCP::CompoundPacket* packet)
{
MS_TRACE();
if (!IsConnected())
return;
// Ensure there is sending SRTP session.
if (this->srtpSendSession == nullptr)
{
MS_WARN_DEV("ignoring RTCP packet due to non sending SRTP session");
return;
}
const uint8_t* data = packet->GetData();
size_t len = packet->GetSize();
if (!this->srtpSendSession->EncryptRtcp(&data, &len))
return;
this->selectedTuple->Send(data, len);
}
inline void Transport::MayRunDtlsTransport()
{
MS_TRACE();
......@@ -918,6 +894,7 @@ namespace RTC
packet->Serialize(RTC::RTCP::Buffer);
SendRtcpCompoundPacket(packet.get());
// Reset the Compound packet.
packet.reset(new RTC::RTCP::CompoundPacket());
}
......@@ -944,6 +921,30 @@ namespace RTC
}
}
void Transport::SendRtcpCompoundPacket(RTC::RTCP::CompoundPacket* packet)
{
MS_TRACE();
if (!IsConnected())
return;
// Ensure there is sending SRTP session.
if (this->srtpSendSession == nullptr)
{
MS_WARN_DEV("ignoring RTCP packet due to non sending SRTP session");
return;
}
const uint8_t* data = packet->GetData();
size_t len = packet->GetSize();
if (!this->srtpSendSession->EncryptRtcp(&data, &len))
return;
this->selectedTuple->Send(data, len);
}
inline RTC::Consumer* Transport::GetConsumer(uint32_t ssrc) const
{
MS_TRACE();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论