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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 void SendStatisticsProxy::SetContentType( | 154 void SendStatisticsProxy::SetContentType( |
155 VideoEncoderConfig::ContentType content_type) { | 155 VideoEncoderConfig::ContentType content_type) { |
156 rtc::CritScope lock(&crit_); | 156 rtc::CritScope lock(&crit_); |
157 if (content_type_ != content_type) { | 157 if (content_type_ != content_type) { |
158 uma_container_->UpdateHistograms(); | 158 uma_container_->UpdateHistograms(); |
159 uma_container_.reset(new UmaSamplesContainer(GetUmaPrefix(content_type))); | 159 uma_container_.reset(new UmaSamplesContainer(GetUmaPrefix(content_type))); |
160 content_type_ = content_type; | 160 content_type_ = content_type; |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
| 164 void SendStatisticsProxy::OnEncoderImplementationName( |
| 165 const char* implementation_name) { |
| 166 rtc::CritScope lock(&crit_); |
| 167 stats_.encoder_implementation_name = implementation_name; |
| 168 } |
| 169 |
164 void SendStatisticsProxy::OnOutgoingRate(uint32_t framerate, uint32_t bitrate) { | 170 void SendStatisticsProxy::OnOutgoingRate(uint32_t framerate, uint32_t bitrate) { |
165 rtc::CritScope lock(&crit_); | 171 rtc::CritScope lock(&crit_); |
166 stats_.encode_frame_rate = framerate; | 172 stats_.encode_frame_rate = framerate; |
167 stats_.media_bitrate_bps = bitrate; | 173 stats_.media_bitrate_bps = bitrate; |
168 } | 174 } |
169 | 175 |
170 void SendStatisticsProxy::CpuOveruseMetricsUpdated( | 176 void SendStatisticsProxy::CpuOveruseMetricsUpdated( |
171 const CpuOveruseMetrics& metrics) { | 177 const CpuOveruseMetrics& metrics) { |
172 rtc::CritScope lock(&crit_); | 178 rtc::CritScope lock(&crit_); |
173 stats_.encode_usage_percent = metrics.encode_usage_percent; | 179 stats_.encode_usage_percent = metrics.encode_usage_percent; |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 return Fraction(min_required_samples, 1000.0f); | 420 return Fraction(min_required_samples, 1000.0f); |
415 } | 421 } |
416 | 422 |
417 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 423 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
418 int min_required_samples, float multiplier) const { | 424 int min_required_samples, float multiplier) const { |
419 if (num_samples < min_required_samples || num_samples == 0) | 425 if (num_samples < min_required_samples || num_samples == 0) |
420 return -1; | 426 return -1; |
421 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 427 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
422 } | 428 } |
423 } // namespace webrtc | 429 } // namespace webrtc |
OLD | NEW |