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

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

Issue 1972083002: Move logic for calculating needed bitrate overhead used by NACK and FEC to VideoSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed Åsas comments. Created 4 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 unified diff | Download patch
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | webrtc/video/video_send_stream.h » ('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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 } 506 }
507 last_sent_frame_timestamp_ = encoded_image._timeStamp; 507 last_sent_frame_timestamp_ = encoded_image._timeStamp;
508 uma_container_->max_sent_width_per_timestamp_ = 508 uma_container_->max_sent_width_per_timestamp_ =
509 std::max(uma_container_->max_sent_width_per_timestamp_, 509 std::max(uma_container_->max_sent_width_per_timestamp_,
510 static_cast<int>(encoded_image._encodedWidth)); 510 static_cast<int>(encoded_image._encodedWidth));
511 uma_container_->max_sent_height_per_timestamp_ = 511 uma_container_->max_sent_height_per_timestamp_ =
512 std::max(uma_container_->max_sent_height_per_timestamp_, 512 std::max(uma_container_->max_sent_height_per_timestamp_,
513 static_cast<int>(encoded_image._encodedHeight)); 513 static_cast<int>(encoded_image._encodedHeight));
514 } 514 }
515 515
516 int SendStatisticsProxy::GetSendFrameRate() const {
517 rtc::CritScope lock(&crit_);
518 return stats_.encode_frame_rate;
519 }
520
516 void SendStatisticsProxy::OnIncomingFrame(int width, int height) { 521 void SendStatisticsProxy::OnIncomingFrame(int width, int height) {
517 rtc::CritScope lock(&crit_); 522 rtc::CritScope lock(&crit_);
518 uma_container_->input_frame_rate_tracker_.AddSamples(1); 523 uma_container_->input_frame_rate_tracker_.AddSamples(1);
519 uma_container_->input_width_counter_.Add(width); 524 uma_container_->input_width_counter_.Add(width);
520 uma_container_->input_height_counter_.Add(height); 525 uma_container_->input_height_counter_.Add(height);
521 } 526 }
522 527
523 void SendStatisticsProxy::RtcpPacketTypesCounterUpdated( 528 void SendStatisticsProxy::RtcpPacketTypesCounterUpdated(
524 uint32_t ssrc, 529 uint32_t ssrc,
525 const RtcpPacketTypeCounter& packet_counter) { 530 const RtcpPacketTypeCounter& packet_counter) {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 return Fraction(min_required_samples, 1000.0f); 627 return Fraction(min_required_samples, 1000.0f);
623 } 628 }
624 629
625 int SendStatisticsProxy::BoolSampleCounter::Fraction( 630 int SendStatisticsProxy::BoolSampleCounter::Fraction(
626 int min_required_samples, float multiplier) const { 631 int min_required_samples, float multiplier) const {
627 if (num_samples < min_required_samples || num_samples == 0) 632 if (num_samples < min_required_samples || num_samples == 0)
628 return -1; 633 return -1;
629 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); 634 return static_cast<int>((sum * multiplier / num_samples) + 0.5f);
630 } 635 }
631 } // namespace webrtc 636 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | webrtc/video/video_send_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698