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

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

Issue 1406903002: Expose codec implementation names in stats. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 5 years, 1 month 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
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.BandwidthLimitedResolutionInPercent", 116 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.BandwidthLimitedResolutionInPercent",
117 bw_limited); 117 bw_limited);
118 } 118 }
119 int num_disabled = bw_resolutions_disabled_counter_.Avg(kMinRequiredSamples); 119 int num_disabled = bw_resolutions_disabled_counter_.Avg(kMinRequiredSamples);
120 if (num_disabled != -1) { 120 if (num_disabled != -1) {
121 RTC_HISTOGRAM_ENUMERATION( 121 RTC_HISTOGRAM_ENUMERATION(
122 "WebRTC.Video.BandwidthLimitedResolutionsDisabled", num_disabled, 10); 122 "WebRTC.Video.BandwidthLimitedResolutionsDisabled", num_disabled, 10);
123 } 123 }
124 } 124 }
125 125
126 void SendStatisticsProxy::OnEncoderImplementationName(
127 const char* implementation_name) {
128 rtc::CritScope lock(&crit_);
129 stats_.encoder_implementation_name = implementation_name;
130 }
131
126 void SendStatisticsProxy::OnOutgoingRate(uint32_t framerate, uint32_t bitrate) { 132 void SendStatisticsProxy::OnOutgoingRate(uint32_t framerate, uint32_t bitrate) {
127 rtc::CritScope lock(&crit_); 133 rtc::CritScope lock(&crit_);
128 stats_.encode_frame_rate = framerate; 134 stats_.encode_frame_rate = framerate;
129 stats_.media_bitrate_bps = bitrate; 135 stats_.media_bitrate_bps = bitrate;
130 } 136 }
131 137
132 void SendStatisticsProxy::CpuOveruseMetricsUpdated( 138 void SendStatisticsProxy::CpuOveruseMetricsUpdated(
133 const CpuOveruseMetrics& metrics) { 139 const CpuOveruseMetrics& metrics) {
134 rtc::CritScope lock(&crit_); 140 rtc::CritScope lock(&crit_);
135 // TODO(asapersson): Change to use OnEncodedFrame() for avg_encode_time_ms. 141 // TODO(asapersson): Change to use OnEncodedFrame() for avg_encode_time_ms.
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 } 373 }
368 374
369 int SendStatisticsProxy::BoolSampleCounter::Fraction( 375 int SendStatisticsProxy::BoolSampleCounter::Fraction(
370 int min_required_samples, float multiplier) const { 376 int min_required_samples, float multiplier) const {
371 if (num_samples < min_required_samples || num_samples == 0) 377 if (num_samples < min_required_samples || num_samples == 0)
372 return -1; 378 return -1;
373 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); 379 return static_cast<int>((sum * multiplier / num_samples) + 0.5f);
374 } 380 }
375 381
376 } // namespace webrtc 382 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698