mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Update stat for twcc and rr
This commit is contained in:
parent
4539ffa086
commit
515529eba9
2 changed files with 19 additions and 3 deletions
|
@ -61,6 +61,9 @@ using namespace std;
|
|||
#include <srs_protocol_kbps.hpp>
|
||||
|
||||
SrsPps* _srs_pps_pli = new SrsPps(_srs_clock);
|
||||
SrsPps* _srs_pps_twcc = new SrsPps(_srs_clock);
|
||||
SrsPps* _srs_pps_rr = new SrsPps(_srs_clock);
|
||||
SrsPps* _srs_pps_pub = new SrsPps(_srs_clock);
|
||||
|
||||
#define SRS_TICKID_RTCP 0
|
||||
#define SRS_TICKID_TWCC 2
|
||||
|
@ -1429,11 +1432,15 @@ srs_error_t SrsRtcPublishStream::notify(int type, srs_utime_t interval, srs_utim
|
|||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
++_srs_pps_pub->sugar;
|
||||
|
||||
if (!is_started) {
|
||||
return err;
|
||||
}
|
||||
|
||||
if (type == SRS_TICKID_RTCP) {
|
||||
++_srs_pps_rr->sugar;
|
||||
|
||||
if ((err = send_rtcp_rr()) != srs_success) {
|
||||
srs_warn("RR err %s", srs_error_desc(err).c_str());
|
||||
srs_freep(err);
|
||||
|
@ -1446,6 +1453,8 @@ srs_error_t SrsRtcPublishStream::notify(int type, srs_utime_t interval, srs_utim
|
|||
}
|
||||
|
||||
if (twcc_enabled_ && type == SRS_TICKID_TWCC) {
|
||||
++_srs_pps_twcc->sugar;
|
||||
|
||||
// We should not depends on the received packet,
|
||||
// instead we should send feedback every Nms.
|
||||
if ((err = send_periodic_twcc()) != srs_success) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue