修复rtx包未修改rtp ext id的问题
This commit is contained in:
parent
d4ff84e447
commit
7cdd5ed9df
|
|
@ -269,7 +269,7 @@ void WebRtcTransport::inputSockData(char *buf, size_t len, RTC::TransportTuple *
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebRtcTransport::sendRtpPacket(char *buf, size_t len, bool flush, void *ctx) {
|
void WebRtcTransport::sendRtpPacket(const char *buf, size_t len, bool flush, void *ctx) {
|
||||||
if (_srtp_session_send) {
|
if (_srtp_session_send) {
|
||||||
//预留rtx加入的两个字节
|
//预留rtx加入的两个字节
|
||||||
CHECK(len + SRTP_MAX_TRAILER_LEN + 2 <= sizeof(_srtp_buf));
|
CHECK(len + SRTP_MAX_TRAILER_LEN + 2 <= sizeof(_srtp_buf));
|
||||||
|
|
@ -281,7 +281,7 @@ void WebRtcTransport::sendRtpPacket(char *buf, size_t len, bool flush, void *ctx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebRtcTransport::sendRtcpPacket(char *buf, size_t len, bool flush, void *ctx){
|
void WebRtcTransport::sendRtcpPacket(const char *buf, size_t len, bool flush, void *ctx){
|
||||||
if (_srtp_session_send) {
|
if (_srtp_session_send) {
|
||||||
CHECK(len + SRTP_MAX_TRAILER_LEN <= sizeof(_srtp_buf));
|
CHECK(len + SRTP_MAX_TRAILER_LEN <= sizeof(_srtp_buf));
|
||||||
memcpy(_srtp_buf, buf, len);
|
memcpy(_srtp_buf, buf, len);
|
||||||
|
|
@ -720,13 +720,13 @@ void WebRtcTransportImp::onRtp_l(const char *buf, size_t len, bool rtx) {
|
||||||
if (!rtx) {
|
if (!rtx) {
|
||||||
//统计rtp接受情况,便于生成nack rtcp包
|
//统计rtp接受情况,便于生成nack rtcp包
|
||||||
info->nack_ctx.received(seq);
|
info->nack_ctx.received(seq);
|
||||||
//修改ext id至统一
|
|
||||||
changeRtpExtId(rtp, _rtp_ext_id_to_type);
|
|
||||||
//时间戳转换成毫秒
|
//时间戳转换成毫秒
|
||||||
auto stamp_ms = ntohl(rtp->stamp) * uint64_t(1000) / info->plan_rtp->sample_rate;
|
auto stamp_ms = ntohl(rtp->stamp) * uint64_t(1000) / info->plan_rtp->sample_rate;
|
||||||
//统计rtp收到的情况,好做rr汇报
|
//统计rtp收到的情况,好做rr汇报
|
||||||
info->rtcp_context_recv->onRtp(seq, stamp_ms, len);
|
info->rtcp_context_recv->onRtp(seq, stamp_ms, len);
|
||||||
}
|
}
|
||||||
|
//修改ext id至统一
|
||||||
|
changeRtpExtId(rtp, _rtp_ext_id_to_type);
|
||||||
//解析并排序rtp
|
//解析并排序rtp
|
||||||
info->receiver->inputRtp(info->media->type, info->plan_rtp->sample_rate, (uint8_t *) buf, len);
|
info->receiver->inputRtp(info->media->type, info->plan_rtp->sample_rate, (uint8_t *) buf, len);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,8 @@ public:
|
||||||
* @param flush 是否flush socket
|
* @param flush 是否flush socket
|
||||||
* @param ctx 用户指针
|
* @param ctx 用户指针
|
||||||
*/
|
*/
|
||||||
void sendRtpPacket(char *buf, size_t len, bool flush, void *ctx = nullptr);
|
void sendRtpPacket(const char *buf, size_t len, bool flush, void *ctx = nullptr);
|
||||||
void sendRtcpPacket(char *buf, size_t len, bool flush, void *ctx = nullptr);
|
void sendRtcpPacket(const char *buf, size_t len, bool flush, void *ctx = nullptr);
|
||||||
|
|
||||||
const EventPoller::Ptr& getPoller() const;
|
const EventPoller::Ptr& getPoller() const;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue