1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Tenfold: Connection support send rtcp packet

This commit is contained in:
winlin 2020-08-07 16:51:48 +08:00
parent 8c9935db44
commit 73eb60a9d5
2 changed files with 18 additions and 0 deletions

View file

@ -2190,6 +2190,23 @@ srs_error_t SrsRtcConnection::notify(int type, srs_utime_t interval, srs_utime_t
return err;
}
srs_error_t SrsRtcConnection::send_rtcp(char *data, int nb_data)
{
srs_error_t err = srs_success;
int nb_buf = nb_data;
char protected_buf[kRtpPacketSize];
if ((err = transport_->protect_rtcp(data, protected_buf, nb_buf)) != srs_success) {
return srs_error_wrap(err, "protect rtcp");
}
if ((err = sendonly_skt->sendto(protected_buf, nb_buf, 0)) != srs_success) {
return srs_error_wrap(err, "send");
}
return err;
}
void SrsRtcConnection::check_send_nacks(SrsRtpNackForReceiver* nack, uint32_t ssrc, uint32_t& sent_nacks)
{
// @see: https://tools.ietf.org/html/rfc4585#section-6.1

View file

@ -462,6 +462,7 @@ public:
virtual srs_error_t notify(int type, srs_utime_t interval, srs_utime_t tick);
public:
// send rtcp
srs_error_t send_rtcp(char *data, int nb_data);
void check_send_nacks(SrsRtpNackForReceiver* nack, uint32_t ssrc, uint32_t& sent_nacks);
srs_error_t send_rtcp_rr(uint32_t ssrc, SrsRtpRingBuffer* rtp_queue, const uint64_t& last_send_systime, const SrsNtp& last_send_ntp);
srs_error_t send_rtcp_xr_rrtr(uint32_t ssrc);