mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 00:37:39 +08:00
接收到rtp包
This commit is contained in:
parent
9ffa5c2135
commit
1978748f2e
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user