Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc

Issue 1198853004: Add statistics gathering for packet loss. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Another hopeful Mac build fix Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
index a79774d16029a0f992d111f2cb95e9ac0dde1f0a..142fce3336966f211b0233bcd99538a0fbf75167 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -611,6 +611,31 @@ void ModuleRtpRtcpImpl::GetSendStreamDataCounters(
rtp_sender_.GetDataCounters(rtp_counters, rtx_counters);
}
+void ModuleRtpRtcpImpl::GetRtpPacketLossStats(
+ bool outgoing,
+ uint32_t ssrc,
+ struct RtpPacketLossStats* loss_stats) const {
+ if (!loss_stats) return;
+ const PacketLossStats* stats_source = NULL;
+ if (outgoing) {
+ if (SSRC() == ssrc) {
+ stats_source = &send_loss_stats_;
+ }
+ } else {
+ if (rtcp_receiver_.RemoteSSRC() == ssrc) {
+ stats_source = &receive_loss_stats_;
+ }
+ }
+ if (stats_source) {
+ loss_stats->single_packet_loss_count =
+ stats_source->GetSingleLossCount();
+ loss_stats->multiple_packet_loss_event_count =
+ stats_source->GetMultipleLossEventCount();
+ loss_stats->multiple_packet_loss_packet_count =
+ stats_source->GetMultipleLossPacketCount();
+ }
+}
+
int32_t ModuleRtpRtcpImpl::RemoteRTCPStat(RTCPSenderInfo* sender_info) {
return rtcp_receiver_.SenderInfoReceived(sender_info);
}
@@ -684,6 +709,9 @@ int ModuleRtpRtcpImpl::SetSelectiveRetransmissions(uint8_t settings) {
// Send a Negative acknowledgment packet.
int32_t ModuleRtpRtcpImpl::SendNACK(const uint16_t* nack_list,
const uint16_t size) {
+ for (int i = 0; i < size; ++i) {
+ receive_loss_stats_.AddLostPacket(nack_list[i]);
+ }
uint16_t nack_length = size;
uint16_t start_id = 0;
int64_t now = clock_->TimeInMilliseconds();
@@ -899,6 +927,9 @@ bool ModuleRtpRtcpImpl::SendTimeOfXrRrReport(
void ModuleRtpRtcpImpl::OnReceivedNACK(
const std::list<uint16_t>& nack_sequence_numbers) {
+ for (uint16_t nack_sequence_number : nack_sequence_numbers) {
+ send_loss_stats_.AddLostPacket(nack_sequence_number);
+ }
if (!rtp_sender_.StorePackets() ||
nack_sequence_numbers.size() == 0) {
return;
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698