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

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

Issue 1543933004: Fix for stats updated twice when switching content type. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 11 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 | « no previous file | 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (max_delay_ms != -1) { 155 if (max_delay_ms != -1) {
156 RTC_HISTOGRAM_COUNTS_SPARSE_100000(uma_prefix_ + "SendSideDelayMaxInMs", 156 RTC_HISTOGRAM_COUNTS_SPARSE_100000(uma_prefix_ + "SendSideDelayMaxInMs",
157 max_delay_ms); 157 max_delay_ms);
158 } 158 }
159 } 159 }
160 160
161 void SendStatisticsProxy::SetContentType( 161 void SendStatisticsProxy::SetContentType(
162 VideoEncoderConfig::ContentType content_type) { 162 VideoEncoderConfig::ContentType content_type) {
163 rtc::CritScope lock(&crit_); 163 rtc::CritScope lock(&crit_);
164 if (content_type_ != content_type) { 164 if (content_type_ != content_type) {
165 uma_container_->UpdateHistograms();
166 uma_container_.reset(new UmaSamplesContainer(GetUmaPrefix(content_type))); 165 uma_container_.reset(new UmaSamplesContainer(GetUmaPrefix(content_type)));
167 content_type_ = content_type; 166 content_type_ = content_type;
168 } 167 }
169 } 168 }
170 169
171 void SendStatisticsProxy::OnEncoderImplementationName( 170 void SendStatisticsProxy::OnEncoderImplementationName(
172 const char* implementation_name) { 171 const char* implementation_name) {
173 rtc::CritScope lock(&crit_); 172 rtc::CritScope lock(&crit_);
174 stats_.encoder_implementation_name = implementation_name; 173 stats_.encoder_implementation_name = implementation_name;
175 } 174 }
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 return Fraction(min_required_samples, 1000.0f); 426 return Fraction(min_required_samples, 1000.0f);
428 } 427 }
429 428
430 int SendStatisticsProxy::BoolSampleCounter::Fraction( 429 int SendStatisticsProxy::BoolSampleCounter::Fraction(
431 int min_required_samples, float multiplier) const { 430 int min_required_samples, float multiplier) const {
432 if (num_samples < min_required_samples || num_samples == 0) 431 if (num_samples < min_required_samples || num_samples == 0)
433 return -1; 432 return -1;
434 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); 433 return static_cast<int>((sum * multiplier / num_samples) + 0.5f);
435 } 434 }
436 } // namespace webrtc 435 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/video/send_statistics_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698