| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |