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

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

Issue 2146013002: Reland of actor NACK bitrate allocation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | webrtc/video/send_statistics_proxy_unittest.cc » ('j') | 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 rtc::CritScope lock(&crit_); 557 rtc::CritScope lock(&crit_);
558 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc); 558 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc);
559 RTC_DCHECK(stats) << "DataCountersUpdated reported for unknown ssrc: " 559 RTC_DCHECK(stats) << "DataCountersUpdated reported for unknown ssrc: "
560 << ssrc; 560 << ssrc;
561 561
562 stats->rtp_stats = counters; 562 stats->rtp_stats = counters;
563 if (uma_container_->first_rtp_stats_time_ms_ == -1) 563 if (uma_container_->first_rtp_stats_time_ms_ == -1)
564 uma_container_->first_rtp_stats_time_ms_ = clock_->TimeInMilliseconds(); 564 uma_container_->first_rtp_stats_time_ms_ = clock_->TimeInMilliseconds();
565 } 565 }
566 566
567 void SendStatisticsProxy::Notify(const BitrateStatistics& total_stats, 567 void SendStatisticsProxy::Notify(uint32_t total_bitrate_bps,
568 const BitrateStatistics& retransmit_stats, 568 uint32_t retransmit_bitrate_bps,
569 uint32_t ssrc) { 569 uint32_t ssrc) {
570 rtc::CritScope lock(&crit_); 570 rtc::CritScope lock(&crit_);
571 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc); 571 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc);
572 if (!stats) 572 if (!stats)
573 return; 573 return;
574 574
575 stats->total_bitrate_bps = total_stats.bitrate_bps; 575 stats->total_bitrate_bps = total_bitrate_bps;
576 stats->retransmit_bitrate_bps = retransmit_stats.bitrate_bps; 576 stats->retransmit_bitrate_bps = retransmit_bitrate_bps;
577 } 577 }
578 578
579 void SendStatisticsProxy::FrameCountUpdated(const FrameCounts& frame_counts, 579 void SendStatisticsProxy::FrameCountUpdated(const FrameCounts& frame_counts,
580 uint32_t ssrc) { 580 uint32_t ssrc) {
581 rtc::CritScope lock(&crit_); 581 rtc::CritScope lock(&crit_);
582 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc); 582 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc);
583 if (!stats) 583 if (!stats)
584 return; 584 return;
585 585
586 stats->frame_counts = frame_counts; 586 stats->frame_counts = frame_counts;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 return Fraction(min_required_samples, 1000.0f); 627 return Fraction(min_required_samples, 1000.0f);
628 } 628 }
629 629
630 int SendStatisticsProxy::BoolSampleCounter::Fraction( 630 int SendStatisticsProxy::BoolSampleCounter::Fraction(
631 int min_required_samples, float multiplier) const { 631 int min_required_samples, float multiplier) const {
632 if (num_samples < min_required_samples || num_samples == 0) 632 if (num_samples < min_required_samples || num_samples == 0)
633 return -1; 633 return -1;
634 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); 634 return static_cast<int>((sum * multiplier / num_samples) + 0.5f);
635 } 635 }
636 } // namespace webrtc 636 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | webrtc/video/send_statistics_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698