Commit 1978748f by ziyue

接收到rtp包

parent 9ffa5c21
......@@ -1294,11 +1294,11 @@ void RtcConfigure::matchMedia(shared_ptr<RtcSession> &ret, TrackType type, const
answer_media.fingerprint = configure.fingerprint;
answer_media.ice_lite = configure.ice_lite;
switch (offer_media.role) {
case DtlsRole::actpass :
case DtlsRole::active : {
answer_media.role = DtlsRole::passive;
break;
}
case DtlsRole::actpass :
case DtlsRole::passive : {
answer_media.role = DtlsRole::active;
break;
......
......@@ -24,6 +24,10 @@ void WebRtcTransport::OnIceServerSelectedTuple(const RTC::IceServer *iceServer,
void WebRtcTransport::OnIceServerConnected(const RTC::IceServer *iceServer) {
InfoL;
}
void WebRtcTransport::OnIceServerCompleted(const RTC::IceServer *iceServer) {
InfoL;
if (_answer_sdp->media[0].role == DtlsRole::passive) {
dtls_transport_->Run(RTC::DtlsTransport::Role::SERVER);
} else {
......@@ -31,10 +35,6 @@ void WebRtcTransport::OnIceServerConnected(const RTC::IceServer *iceServer) {
}
}
void WebRtcTransport::OnIceServerCompleted(const RTC::IceServer *iceServer) {
InfoL;
}
void WebRtcTransport::OnIceServerDisconnected(const RTC::IceServer *iceServer) {
InfoL;
}
......@@ -141,16 +141,6 @@ bool is_rtcp(char *buf) {
}
void WebRtcTransport::OnInputDataPacket(char *buf, size_t len, RTC::TransportTuple *tuple) {
if (is_rtp(buf)) {
RtpHeader *header = (RtpHeader *) buf;
InfoL << "rtp:" << header->dumpString(len);
return;
}
if (is_rtcp(buf)) {
RtcpHeader *header = (RtcpHeader *) buf;
// InfoL << "rtcp:" << header->dumpString();
return;
}
if (RTC::StunPacket::IsStun((const uint8_t *) buf, len)) {
RTC::StunPacket *packet = RTC::StunPacket::Parse((const uint8_t *) buf, len);
if (packet == nullptr) {
......@@ -164,6 +154,16 @@ void WebRtcTransport::OnInputDataPacket(char *buf, size_t len, RTC::TransportTup
dtls_transport_->ProcessDtlsData((uint8_t *) buf, len);
return;
}
if (is_rtp(buf)) {
RtpHeader *header = (RtpHeader *) buf;
InfoL << "rtp:" << header->dumpString(len);
return;
}
if (is_rtcp(buf)) {
RtcpHeader *header = (RtcpHeader *) buf;
// InfoL << "rtcp:" << header->dumpString();
return;
}
}
void WebRtcTransport::WritRtpPacket(char *buf, size_t len) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论