Add RTCP packet type counter (for getting statistics such as sent/received NACK and FIR).

Add counter to RTCP sender and RTCP receiver.
Add video api GetRtcpPacketTypes().

BUG=2638
R=mflodman@webrtc.org, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/8179004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5575 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
asapersson@webrtc.org
2014-02-19 11:59:02 +00:00
parent b7a91fa95a
commit 8098e07478
15 changed files with 167 additions and 19 deletions

View File

@ -156,10 +156,7 @@ RTCPSender::RTCPSender(const int32_t id,
xrSendReceiverReferenceTimeEnabled_(false),
_xrSendVoIPMetric(false),
_xrVoIPMetric(),
_nackCount(0),
_pliCount(0),
_fullIntraRequestCount(0)
_xrVoIPMetric()
{
memset(_CNAME, 0, sizeof(_CNAME));
memset(_lastSendReport, 0, sizeof(_lastSendReport));
@ -239,10 +236,7 @@ RTCPSender::Init()
memset(_lastRTCPTime, 0, sizeof(_lastRTCPTime));
last_xr_rr_.clear();
_nackCount = 0;
_pliCount = 0;
_fullIntraRequestCount = 0;
memset(&packet_type_counter_, 0, sizeof(packet_type_counter_));
return 0;
}
@ -616,6 +610,12 @@ bool RTCPSender::SendTimeOfXrRrReport(uint32_t mid_ntp,
return true;
}
void RTCPSender::GetPacketTypeCounter(
RtcpPacketTypeCounter* packet_counter) const {
CriticalSectionScoped lock(_criticalSectionRTCPSender);
*packet_counter = packet_type_counter_;
}
int32_t RTCPSender::AddExternalReportBlock(
uint32_t SSRC,
const RTCPReportBlock* reportBlock) {
@ -1919,8 +1919,9 @@ int RTCPSender::PrepareRTCP(const FeedbackState& feedback_state,
return position;
}
TRACE_EVENT_INSTANT0("webrtc_rtp", "RTCPSender::PLI");
_pliCount++;
TRACE_COUNTER_ID1("webrtc_rtp", "RTCP_PLICount", _SSRC, _pliCount);
++packet_type_counter_.pli_packets;
TRACE_COUNTER_ID1("webrtc_rtp", "RTCP_PLICount", _SSRC,
packet_type_counter_.pli_packets);
}
if(rtcpPacketTypeFlags & kRtcpFir)
{
@ -1931,9 +1932,9 @@ int RTCPSender::PrepareRTCP(const FeedbackState& feedback_state,
return position;
}
TRACE_EVENT_INSTANT0("webrtc_rtp", "RTCPSender::FIR");
_fullIntraRequestCount++;
++packet_type_counter_.fir_packets;
TRACE_COUNTER_ID1("webrtc_rtp", "RTCP_FIRCount", _SSRC,
_fullIntraRequestCount);
packet_type_counter_.fir_packets);
}
if(rtcpPacketTypeFlags & kRtcpSli)
{
@ -2016,8 +2017,9 @@ int RTCPSender::PrepareRTCP(const FeedbackState& feedback_state,
}
TRACE_EVENT_INSTANT1("webrtc_rtp", "RTCPSender::NACK",
"nacks", TRACE_STR_COPY(nackString.c_str()));
_nackCount++;
TRACE_COUNTER_ID1("webrtc_rtp", "RTCP_NACKCount", _SSRC, _nackCount);
++packet_type_counter_.nack_packets;
TRACE_COUNTER_ID1("webrtc_rtp", "RTCP_NACKCount", _SSRC,
packet_type_counter_.nack_packets);
}
if(rtcpPacketTypeFlags & kRtcpXrVoipMetric)
{