mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 20:01:56 +00:00
RTC: Stat the RTP and payload objects
This commit is contained in:
parent
1909cfb3ff
commit
8baf0867a0
2 changed files with 13 additions and 3 deletions
|
@ -76,6 +76,8 @@ extern SrsPps* _srs_pps_rhnack;
|
|||
extern SrsPps* _srs_pps_rmnack;
|
||||
|
||||
extern SrsPps* _srs_pps_objs_rtps;
|
||||
extern SrsPps* _srs_pps_objs_rraw;
|
||||
extern SrsPps* _srs_pps_objs_rfua;
|
||||
|
||||
SrsRtcBlackhole::SrsRtcBlackhole()
|
||||
{
|
||||
|
@ -679,9 +681,9 @@ srs_error_t SrsRtcServer::notify(int type, srs_utime_t interval, srs_utime_t tic
|
|||
static char buf[128];
|
||||
|
||||
string objs_desc;
|
||||
_srs_pps_objs_rtps->update();
|
||||
if (_srs_pps_objs_rtps->r10s()) {
|
||||
snprintf(buf, sizeof(buf), ", objs=%d", _srs_pps_objs_rtps->r10s());
|
||||
_srs_pps_objs_rtps->update(); _srs_pps_objs_rraw->update(); _srs_pps_objs_rfua->update();
|
||||
if (_srs_pps_objs_rtps->r10s() || _srs_pps_objs_rraw->r10s() || _srs_pps_objs_rfua->r10s()) {
|
||||
snprintf(buf, sizeof(buf), ", objs=%d,%d,%d", _srs_pps_objs_rtps->r10s(), _srs_pps_objs_rraw->r10s(), _srs_pps_objs_rfua->r10s());
|
||||
objs_desc = buf;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ using namespace std;
|
|||
#include <srs_kernel_kbps.hpp>
|
||||
|
||||
SrsPps* _srs_pps_objs_rtps = new SrsPps();
|
||||
SrsPps* _srs_pps_objs_rraw = new SrsPps();
|
||||
SrsPps* _srs_pps_objs_rfua = new SrsPps();
|
||||
|
||||
/* @see https://tools.ietf.org/html/rfc1889#section-5.1
|
||||
0 1 2 3
|
||||
|
@ -900,6 +902,8 @@ SrsRtpRawPayload::SrsRtpRawPayload()
|
|||
{
|
||||
payload = NULL;
|
||||
nn_payload = 0;
|
||||
|
||||
++_srs_pps_objs_rraw->sugar;
|
||||
}
|
||||
|
||||
SrsRtpRawPayload::~SrsRtpRawPayload()
|
||||
|
@ -1237,6 +1241,8 @@ SrsRtpFUAPayload::SrsRtpFUAPayload()
|
|||
{
|
||||
start = end = false;
|
||||
nri = nalu_type = (SrsAvcNaluType)0;
|
||||
|
||||
++_srs_pps_objs_rfua->sugar;
|
||||
}
|
||||
|
||||
SrsRtpFUAPayload::~SrsRtpFUAPayload()
|
||||
|
@ -1352,6 +1358,8 @@ SrsRtpFUAPayload2::SrsRtpFUAPayload2()
|
|||
|
||||
payload = NULL;
|
||||
size = 0;
|
||||
|
||||
++_srs_pps_objs_rfua->sugar;
|
||||
}
|
||||
|
||||
SrsRtpFUAPayload2::~SrsRtpFUAPayload2()
|
||||
|
|
Loading…
Reference in a new issue