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

Side by Side Diff: webrtc/video/vie_channel.cc

Issue 1726503003: Move histograms for rtp receive counters to ReceiveStatisticsProxy (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « webrtc/video/vie_channel.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 rtcp_counter.nack_packets * 60 / elapsed_sec); 252 rtcp_counter.nack_packets * 60 / elapsed_sec);
253 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.FirPacketsSentPerMinute", 253 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.FirPacketsSentPerMinute",
254 rtcp_counter.fir_packets * 60 / elapsed_sec); 254 rtcp_counter.fir_packets * 60 / elapsed_sec);
255 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.PliPacketsSentPerMinute", 255 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.PliPacketsSentPerMinute",
256 rtcp_counter.pli_packets * 60 / elapsed_sec); 256 rtcp_counter.pli_packets * 60 / elapsed_sec);
257 if (rtcp_counter.nack_requests > 0) { 257 if (rtcp_counter.nack_requests > 0) {
258 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.UniqueNackRequestsSentInPercent", 258 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.UniqueNackRequestsSentInPercent",
259 rtcp_counter.UniqueNackRequestsInPercent()); 259 rtcp_counter.UniqueNackRequestsInPercent());
260 } 260 }
261 } 261 }
262
263 StreamDataCounters rtp;
264 StreamDataCounters rtx;
265 GetReceiveStreamDataCounters(&rtp, &rtx);
266 StreamDataCounters rtp_rtx = rtp;
267 rtp_rtx.Add(rtx);
268 elapsed_sec = rtp_rtx.TimeSinceFirstPacketInMs(now) / 1000;
269 if (elapsed_sec > metrics::kMinRunTimeInSeconds) {
270 RTC_HISTOGRAM_COUNTS_10000(
271 "WebRTC.Video.BitrateReceivedInKbps",
272 static_cast<int>(rtp_rtx.transmitted.TotalBytes() * 8 / elapsed_sec /
273 1000));
274 RTC_HISTOGRAM_COUNTS_10000(
275 "WebRTC.Video.MediaBitrateReceivedInKbps",
276 static_cast<int>(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000));
277 RTC_HISTOGRAM_COUNTS_10000(
278 "WebRTC.Video.PaddingBitrateReceivedInKbps",
279 static_cast<int>(rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec /
280 1000));
281 RTC_HISTOGRAM_COUNTS_10000(
282 "WebRTC.Video.RetransmittedBitrateReceivedInKbps",
283 static_cast<int>(rtp_rtx.retransmitted.TotalBytes() * 8 /
284 elapsed_sec / 1000));
285 uint32_t ssrc = 0;
286 if (vie_receiver_.GetRtxSsrc(&ssrc)) {
287 RTC_HISTOGRAM_COUNTS_10000(
288 "WebRTC.Video.RtxBitrateReceivedInKbps",
289 static_cast<int>(rtx.transmitted.TotalBytes() * 8 / elapsed_sec /
290 1000));
291 }
292 if (vie_receiver_.IsFecEnabled()) {
293 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.FecBitrateReceivedInKbps",
294 static_cast<int>(rtp_rtx.fec.TotalBytes() *
295 8 / elapsed_sec / 1000));
296 }
297 }
298 } 262 }
299 } 263 }
300 264
301 int32_t ViEChannel::SetSendCodec(const VideoCodec& video_codec, 265 int32_t ViEChannel::SetSendCodec(const VideoCodec& video_codec,
302 bool new_stream) { 266 bool new_stream) {
303 RTC_DCHECK(sender_); 267 RTC_DCHECK(sender_);
304 if (video_codec.codecType == kVideoCodecRED || 268 if (video_codec.codecType == kVideoCodecRED ||
305 video_codec.codecType == kVideoCodecULPFEC) { 269 video_codec.codecType == kVideoCodecULPFEC) {
306 LOG_F(LS_ERROR) << "Not a valid send codec " << video_codec.codecType; 270 LOG_F(LS_ERROR) << "Not a valid send codec " << video_codec.codecType;
307 return -1; 271 return -1;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 *rtx_counters = StreamDataCounters(); 506 *rtx_counters = StreamDataCounters();
543 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 507 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
544 StreamDataCounters rtp_data; 508 StreamDataCounters rtp_data;
545 StreamDataCounters rtx_data; 509 StreamDataCounters rtx_data;
546 rtp_rtcp->GetSendStreamDataCounters(&rtp_data, &rtx_data); 510 rtp_rtcp->GetSendStreamDataCounters(&rtp_data, &rtx_data);
547 rtp_counters->Add(rtp_data); 511 rtp_counters->Add(rtp_data);
548 rtx_counters->Add(rtx_data); 512 rtx_counters->Add(rtx_data);
549 } 513 }
550 } 514 }
551 515
552 void ViEChannel::GetReceiveStreamDataCounters(
553 StreamDataCounters* rtp_counters,
554 StreamDataCounters* rtx_counters) const {
555 StreamStatistician* statistician = vie_receiver_.GetReceiveStatistics()->
556 GetStatistician(vie_receiver_.GetRemoteSsrc());
557 if (statistician) {
558 statistician->GetReceiveStreamDataCounters(rtp_counters);
559 }
560 uint32_t rtx_ssrc = 0;
561 if (vie_receiver_.GetRtxSsrc(&rtx_ssrc)) {
562 StreamStatistician* statistician =
563 vie_receiver_.GetReceiveStatistics()->GetStatistician(rtx_ssrc);
564 if (statistician) {
565 statistician->GetReceiveStreamDataCounters(rtx_counters);
566 }
567 }
568 }
569
570 void ViEChannel::GetSendRtcpPacketTypeCounter( 516 void ViEChannel::GetSendRtcpPacketTypeCounter(
571 RtcpPacketTypeCounter* packet_counter) const { 517 RtcpPacketTypeCounter* packet_counter) const {
572 std::map<uint32_t, RtcpPacketTypeCounter> counter_map = 518 std::map<uint32_t, RtcpPacketTypeCounter> counter_map =
573 rtcp_packet_type_counter_observer_.GetPacketTypeCounterMap(); 519 rtcp_packet_type_counter_observer_.GetPacketTypeCounterMap();
574 520
575 RtcpPacketTypeCounter counter; 521 RtcpPacketTypeCounter counter;
576 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) 522 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
577 counter.Add(counter_map[rtp_rtcp->SSRC()]); 523 counter.Add(counter_map[rtp_rtcp->SSRC()]);
578 *packet_counter = counter; 524 *packet_counter = counter;
579 } 525 }
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 rtc::CritScope lock(&crit_); 792 rtc::CritScope lock(&crit_);
847 receive_stats_callback_ = receive_statistics_proxy; 793 receive_stats_callback_ = receive_statistics_proxy;
848 } 794 }
849 795
850 void ViEChannel::SetIncomingVideoStream( 796 void ViEChannel::SetIncomingVideoStream(
851 IncomingVideoStream* incoming_video_stream) { 797 IncomingVideoStream* incoming_video_stream) {
852 rtc::CritScope lock(&crit_); 798 rtc::CritScope lock(&crit_);
853 incoming_video_stream_ = incoming_video_stream; 799 incoming_video_stream_ = incoming_video_stream;
854 } 800 }
855 } // namespace webrtc 801 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/vie_channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698