Chromium Code Reviews| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 if (encode_ms != -1) | 65 if (encode_ms != -1) |
| 66 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.EncodeTimeInMs", encode_ms); | 66 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.EncodeTimeInMs", encode_ms); |
| 67 | 67 |
| 68 int key_frames_permille = key_frame_counter_.Permille(kMinRequiredSamples); | 68 int key_frames_permille = key_frame_counter_.Permille(kMinRequiredSamples); |
| 69 if (key_frames_permille != -1) { | 69 if (key_frames_permille != -1) { |
| 70 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesSentInPermille", | 70 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesSentInPermille", |
| 71 key_frames_permille); | 71 key_frames_permille); |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 void SendStatisticsProxy::OnEncoderImplementationName( | |
| 76 const char* implementation_name) { | |
| 77 rtc::CritScope lock(&crit_); | |
| 78 stats_.encoder_implementation_name = implementation_name; | |
| 79 } | |
| 75 void SendStatisticsProxy::OnOutgoingRate(uint32_t framerate, uint32_t bitrate) { | 80 void SendStatisticsProxy::OnOutgoingRate(uint32_t framerate, uint32_t bitrate) { |
|
stefan-webrtc
2015/10/16 07:47:03
newline above
pbos-webrtc
2015/10/16 13:12:05
Done.
| |
| 76 rtc::CritScope lock(&crit_); | 81 rtc::CritScope lock(&crit_); |
| 77 stats_.encode_frame_rate = framerate; | 82 stats_.encode_frame_rate = framerate; |
| 78 stats_.media_bitrate_bps = bitrate; | 83 stats_.media_bitrate_bps = bitrate; |
| 79 } | 84 } |
| 80 | 85 |
| 81 void SendStatisticsProxy::CpuOveruseMetricsUpdated( | 86 void SendStatisticsProxy::CpuOveruseMetricsUpdated( |
| 82 const CpuOveruseMetrics& metrics) { | 87 const CpuOveruseMetrics& metrics) { |
| 83 rtc::CritScope lock(&crit_); | 88 rtc::CritScope lock(&crit_); |
| 84 // TODO(asapersson): Change to use OnEncodedFrame() for avg_encode_time_ms. | 89 // TODO(asapersson): Change to use OnEncodedFrame() for avg_encode_time_ms. |
| 85 stats_.avg_encode_time_ms = metrics.avg_encode_time_ms; | 90 stats_.avg_encode_time_ms = metrics.avg_encode_time_ms; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 } | 303 } |
| 299 | 304 |
| 300 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 305 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
| 301 int min_required_samples, float multiplier) const { | 306 int min_required_samples, float multiplier) const { |
| 302 if (num_samples < min_required_samples || num_samples == 0) | 307 if (num_samples < min_required_samples || num_samples == 0) |
| 303 return -1; | 308 return -1; |
| 304 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 309 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
| 305 } | 310 } |
| 306 | 311 |
| 307 } // namespace webrtc | 312 } // namespace webrtc |
| OLD | NEW |