mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Print the rtp packets cache capacity
This commit is contained in:
parent
cc831be985
commit
b4a7566684
2 changed files with 10 additions and 4 deletions
|
@ -529,6 +529,11 @@ int SrsRtcPackets::size()
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SrsRtcPackets::capacity()
|
||||||
|
{
|
||||||
|
return (int)packets.size();
|
||||||
|
}
|
||||||
|
|
||||||
SrsRtpPacket2* SrsRtcPackets::at(int index)
|
SrsRtpPacket2* SrsRtcPackets::at(int index)
|
||||||
{
|
{
|
||||||
srs_assert(index < cursor);
|
srs_assert(index < cursor);
|
||||||
|
@ -736,7 +741,7 @@ srs_error_t SrsRtcSenderThread::cycle()
|
||||||
// Stat the bytes and paddings.
|
// Stat the bytes and paddings.
|
||||||
stat->perf_on_rtc_bytes(pkts.nn_bytes, pkts.nn_padding_bytes);
|
stat->perf_on_rtc_bytes(pkts.nn_bytes, pkts.nn_padding_bytes);
|
||||||
#if defined(SRS_DEBUG)
|
#if defined(SRS_DEBUG)
|
||||||
srs_trace("RTC PLAY done, msgs %d/%d, rtp %d, gso %d, %d audios, %d extras, %d videos, %d samples, %d/%d bytes",
|
srs_trace("RTC PLAY perf, msgs %d/%d, rtp %d, gso %d, %d audios, %d extras, %d videos, %d samples, %d/%d bytes",
|
||||||
msg_count, nn_rtc_packets, pkts.size(), pkts.nn_rtp_pkts, pkts.nn_audios, pkts.nn_extras, pkts.nn_videos,
|
msg_count, nn_rtc_packets, pkts.size(), pkts.nn_rtp_pkts, pkts.nn_audios, pkts.nn_extras, pkts.nn_videos,
|
||||||
pkts.nn_samples, pkts.nn_bytes, pkts.nn_padding_bytes);
|
pkts.nn_samples, pkts.nn_bytes, pkts.nn_padding_bytes);
|
||||||
#endif
|
#endif
|
||||||
|
@ -744,9 +749,9 @@ srs_error_t SrsRtcSenderThread::cycle()
|
||||||
pprint->elapse();
|
pprint->elapse();
|
||||||
if (pprint->can_print()) {
|
if (pprint->can_print()) {
|
||||||
// TODO: FIXME: Print stat like frame/s, packet/s, loss_packets.
|
// TODO: FIXME: Print stat like frame/s, packet/s, loss_packets.
|
||||||
srs_trace("-> RTC PLAY %d msgs, %d/%d packets, %d audios, %d extras, %d videos, %d samples, %d/%d bytes, %d pad",
|
srs_trace("-> RTC PLAY %d msgs, %d/%d packets, %d audios, %d extras, %d videos, %d samples, %d/%d bytes, %d pad, %d/%d cache",
|
||||||
msg_count, pkts.size(), pkts.nn_rtp_pkts, pkts.nn_audios, pkts.nn_extras, pkts.nn_videos,
|
msg_count, pkts.size(), pkts.nn_rtp_pkts, pkts.nn_audios, pkts.nn_extras, pkts.nn_videos, pkts.nn_samples, pkts.nn_bytes,
|
||||||
pkts.nn_samples, pkts.nn_bytes, pkts.nn_padding_bytes, pkts.nn_paddings);
|
pkts.nn_padding_bytes, pkts.nn_paddings, pkts.size(), pkts.capacity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,6 +159,7 @@ public:
|
||||||
SrsRtpPacket2* fetch();
|
SrsRtpPacket2* fetch();
|
||||||
SrsRtpPacket2* back();
|
SrsRtpPacket2* back();
|
||||||
int size();
|
int size();
|
||||||
|
int capacity();
|
||||||
SrsRtpPacket2* at(int index);
|
SrsRtpPacket2* at(int index);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue