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

Unified Diff: webrtc/video_engine/vie_channel.cc

Issue 1213603002: Remove ResetStatistics from RTP feedback. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove more data counter resetting. Created 5 years, 6 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/video_engine/vie_channel.h ('k') | webrtc/voice_engine/channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video_engine/vie_channel.cc
diff --git a/webrtc/video_engine/vie_channel.cc b/webrtc/video_engine/vie_channel.cc
index 61096b39630eacb83fa325e278fa2fed7796c491..83f59ba0f5729dfe912633a4b022d2519e1b696b 100644
--- a/webrtc/video_engine/vie_channel.cc
+++ b/webrtc/video_engine/vie_channel.cc
@@ -244,6 +244,48 @@ void ViEChannel::UpdateHistograms() {
RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.SentPacketsLostInPercent",
fraction_lost);
}
+
+ StreamDataCounters rtp;
åsapersson 2015/07/07 12:18:43 move this outside if-statement above
pbos-webrtc 2015/07/07 13:31:26 Done.
+ StreamDataCounters rtx;
+ GetSendStreamDataCounters(&rtp, &rtx);
+ StreamDataCounters rtp_rtx = rtp;
+ rtp_rtx.Add(rtx);
+ elapsed_sec =
+ rtp_rtx.TimeSinceFirstPacketInMs(
+ Clock::GetRealTimeClock()->TimeInMilliseconds()) /
+ 1000;
+ if (elapsed_sec > metrics::kMinRunTimeInSeconds) {
+ RTC_HISTOGRAM_COUNTS_100000(
+ "WebRTC.Video.BitrateSentInKbps",
+ static_cast<int>(rtp_rtx.transmitted.TotalBytes() * 8 /
+ elapsed_sec / 1000));
+ RTC_HISTOGRAM_COUNTS_10000(
+ "WebRTC.Video.MediaBitrateSentInKbps",
+ static_cast<int>(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000));
+ RTC_HISTOGRAM_COUNTS_10000(
+ "WebRTC.Video.PaddingBitrateSentInKbps",
+ static_cast<int>(rtp_rtx.transmitted.padding_bytes * 8 /
+ elapsed_sec / 1000));
+ RTC_HISTOGRAM_COUNTS_10000(
+ "WebRTC.Video.RetransmittedBitrateSentInKbps",
+ static_cast<int>(rtp_rtx.retransmitted.TotalBytes() * 8 /
+ elapsed_sec / 1000));
+ if (rtp_rtcp_->RtxSendStatus() != kRtxOff) {
+ RTC_HISTOGRAM_COUNTS_10000(
+ "WebRTC.Video.RtxBitrateSentInKbps",
+ static_cast<int>(rtx.transmitted.TotalBytes() * 8 / elapsed_sec /
+ 1000));
+ }
+ bool fec_enabled = false;
+ uint8_t pltype_red;
+ uint8_t pltype_fec;
+ rtp_rtcp_->GenericFECStatus(fec_enabled, pltype_red, pltype_fec);
+ if (fec_enabled) {
+ RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.FecBitrateSentInKbps",
+ static_cast<int>(rtp_rtx.fec.TotalBytes() *
+ 8 / elapsed_sec / 1000));
+ }
+ }
}
} else if (vie_receiver_.GetRemoteSsrc() > 0) {
// Get receive stats if we are receiving packets, i.e. there is a remote
@@ -302,49 +344,6 @@ void ViEChannel::UpdateHistograms() {
}
}
-void ViEChannel::UpdateHistogramsAtStopSend() {
- StreamDataCounters rtp;
- StreamDataCounters rtx;
- GetSendStreamDataCounters(&rtp, &rtx);
- StreamDataCounters rtp_rtx = rtp;
- rtp_rtx.Add(rtx);
-
- int64_t elapsed_sec = rtp_rtx.TimeSinceFirstPacketInMs(
- Clock::GetRealTimeClock()->TimeInMilliseconds()) / 1000;
- if (elapsed_sec < metrics::kMinRunTimeInSeconds) {
- return;
- }
- RTC_HISTOGRAM_COUNTS_100000(
- "WebRTC.Video.BitrateSentInKbps",
- static_cast<int>(rtp_rtx.transmitted.TotalBytes() * 8 / elapsed_sec /
- 1000));
- RTC_HISTOGRAM_COUNTS_10000(
- "WebRTC.Video.MediaBitrateSentInKbps",
- static_cast<int>(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000));
- RTC_HISTOGRAM_COUNTS_10000(
- "WebRTC.Video.PaddingBitrateSentInKbps",
- static_cast<int>(rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec /
- 1000));
- RTC_HISTOGRAM_COUNTS_10000(
- "WebRTC.Video.RetransmittedBitrateSentInKbps",
- static_cast<int>(rtp_rtx.retransmitted.TotalBytes() * 8 / elapsed_sec /
- 1000));
- if (rtp_rtcp_->RtxSendStatus() != kRtxOff) {
- RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtxBitrateSentInKbps",
- static_cast<int>(rtx.transmitted.TotalBytes() *
- 8 / elapsed_sec / 1000));
- }
- bool fec_enabled = false;
- uint8_t pltype_red;
- uint8_t pltype_fec;
- rtp_rtcp_->GenericFECStatus(fec_enabled, pltype_red, pltype_fec);
- if (fec_enabled) {
- RTC_HISTOGRAM_COUNTS_10000(
- "WebRTC.Video.FecBitrateSentInKbps",
- static_cast<int>(rtp_rtx.fec.TotalBytes() * 8 / elapsed_sec / 1000));
- }
-}
-
int32_t ViEChannel::SetSendCodec(const VideoCodec& video_codec,
bool new_stream) {
if (!sender_) {
@@ -1335,7 +1334,6 @@ int32_t ViEChannel::StartSend() {
}
int32_t ViEChannel::StopSend() {
- UpdateHistogramsAtStopSend();
send_payload_router_->set_active(false);
CriticalSectionScoped cs(rtp_rtcp_cs_.get());
rtp_rtcp_->SetSendingMediaStatus(false);
@@ -1349,8 +1347,6 @@ int32_t ViEChannel::StopSend() {
return -1;
}
- // Reset.
- rtp_rtcp_->ResetSendDataCountersRTP();
if (rtp_rtcp_->SetSendingStatus(false) != 0) {
return -1;
}
@@ -1358,7 +1354,6 @@ int32_t ViEChannel::StopSend() {
it != simulcast_rtp_rtcp_.end();
it++) {
RtpRtcp* rtp_rtcp = *it;
- rtp_rtcp->ResetSendDataCountersRTP();
rtp_rtcp->SetSendingStatus(false);
}
return 0;
@@ -1706,13 +1701,6 @@ void ViEChannel::OnIncomingCSRCChanged(const int32_t id,
CriticalSectionScoped cs(callback_cs_.get());
}
-void ViEChannel::ResetStatistics(uint32_t ssrc) {
- StreamStatistician* statistician =
- vie_receiver_.GetReceiveStatistics()->GetStatistician(ssrc);
- if (statistician)
- statistician->ResetStatistics();
-}
-
void ViEChannel::RegisterSendFrameCountObserver(
FrameCountObserver* observer) {
send_frame_count_observer_.Set(observer);
« no previous file with comments | « webrtc/video_engine/vie_channel.h ('k') | webrtc/voice_engine/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698