Commit 1978748f by ziyue

接收到rtp包

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