RTC: Stat the large buffer allocation

pull/2252/head
winlin 4 years ago
parent 439a7fa655
commit 65ba88de3f

@ -78,6 +78,7 @@ extern SrsPps* _srs_pps_rmnack;
extern SrsPps* _srs_pps_objs_rtps;
extern SrsPps* _srs_pps_objs_rraw;
extern SrsPps* _srs_pps_objs_rfua;
extern SrsPps* _srs_pps_objs_rbuf;
SrsRtcBlackhole::SrsRtcBlackhole()
{
@ -684,9 +685,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(); _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());
_srs_pps_objs_rtps->update(); _srs_pps_objs_rraw->update(); _srs_pps_objs_rfua->update(); _srs_pps_objs_rbuf->update();
if (_srs_pps_objs_rtps->r10s() || _srs_pps_objs_rraw->r10s() || _srs_pps_objs_rfua->r10s() || _srs_pps_objs_rbuf->r10s()) {
snprintf(buf, sizeof(buf), ", objs=%d,%d,%d,%d", _srs_pps_objs_rtps->r10s(), _srs_pps_objs_rraw->r10s(), _srs_pps_objs_rfua->r10s(), _srs_pps_objs_rbuf->r10s());
objs_desc = buf;
}

@ -39,6 +39,7 @@ using namespace std;
SrsPps* _srs_pps_objs_rtps = new SrsPps();
SrsPps* _srs_pps_objs_rraw = new SrsPps();
SrsPps* _srs_pps_objs_rfua = new SrsPps();
SrsPps* _srs_pps_objs_rbuf = new SrsPps();
/* @see https://tools.ietf.org/html/rfc1889#section-5.1
0 1 2 3
@ -867,6 +868,8 @@ char* SrsRtpPacket2::wrap(int size)
srs_freep(cache_buffer_);
cache_buffer_ = new SrsBuffer(buf, size);
++_srs_pps_objs_rbuf->sugar;
return buf;
}

Loading…
Cancel
Save