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

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

Issue 2122743003: Fix stats for encoder target bitrate when target rate is zero. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed bad logging. 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/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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc); 411 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc);
412 if (!stats) 412 if (!stats)
413 return; 413 return;
414 414
415 stats->total_bitrate_bps = 0; 415 stats->total_bitrate_bps = 0;
416 stats->retransmit_bitrate_bps = 0; 416 stats->retransmit_bitrate_bps = 0;
417 stats->height = 0; 417 stats->height = 0;
418 stats->width = 0; 418 stats->width = 0;
419 } 419 }
420 420
421 void SendStatisticsProxy::OnSetRates(uint32_t bitrate_bps, int framerate) { 421 void SendStatisticsProxy::OnSetEncoderTargetRate(uint32_t bitrate_bps) {
422 rtc::CritScope lock(&crit_); 422 rtc::CritScope lock(&crit_);
423 stats_.target_media_bitrate_bps = bitrate_bps; 423 stats_.target_media_bitrate_bps = bitrate_bps;
424 } 424 }
425 425
426 void SendStatisticsProxy::OnSendEncodedImage( 426 void SendStatisticsProxy::OnSendEncodedImage(
427 const EncodedImage& encoded_image, 427 const EncodedImage& encoded_image,
428 const CodecSpecificInfo* codec_info) { 428 const CodecSpecificInfo* codec_info) {
429 size_t simulcast_idx = 0; 429 size_t simulcast_idx = 0;
430 430
431 if (codec_info) { 431 if (codec_info) {
(...skipping 195 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/video_send_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698