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

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

Issue 1616153005: Switch to use new implementation in metrics.h. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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 | « webrtc/video/receive_statistics_proxy.cc ('k') | webrtc/video/vie_channel.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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } else if (payload_name == "VP9") { 50 } else if (payload_name == "VP9") {
51 return kVideoVp9; 51 return kVideoVp9;
52 } else if (payload_name == "H264") { 52 } else if (payload_name == "H264") {
53 return kVideoH264; 53 return kVideoH264;
54 } else { 54 } else {
55 return kVideoUnknown; 55 return kVideoUnknown;
56 } 56 }
57 } 57 }
58 58
59 void UpdateCodecTypeHistogram(const std::string& payload_name) { 59 void UpdateCodecTypeHistogram(const std::string& payload_name) {
60 RTC_HISTOGRAM_ENUMERATION_SPARSE("WebRTC.Video.Encoder.CodecType", 60 RTC_HISTOGRAM_ENUMERATION("WebRTC.Video.Encoder.CodecType",
61 PayloadNameToHistogramCodecType(payload_name), kVideoMax); 61 PayloadNameToHistogramCodecType(payload_name),
62 kVideoMax);
62 } 63 }
63 } // namespace 64 } // namespace
64 65
65 66
66 const int SendStatisticsProxy::kStatsTimeoutMs = 5000; 67 const int SendStatisticsProxy::kStatsTimeoutMs = 5000;
67 68
68 SendStatisticsProxy::SendStatisticsProxy( 69 SendStatisticsProxy::SendStatisticsProxy(
69 Clock* clock, 70 Clock* clock,
70 const VideoSendStream::Config& config, 71 const VideoSendStream::Config& config,
71 VideoEncoderConfig::ContentType content_type) 72 VideoEncoderConfig::ContentType content_type)
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 return Fraction(min_required_samples, 1000.0f); 427 return Fraction(min_required_samples, 1000.0f);
427 } 428 }
428 429
429 int SendStatisticsProxy::BoolSampleCounter::Fraction( 430 int SendStatisticsProxy::BoolSampleCounter::Fraction(
430 int min_required_samples, float multiplier) const { 431 int min_required_samples, float multiplier) const {
431 if (num_samples < min_required_samples || num_samples == 0) 432 if (num_samples < min_required_samples || num_samples == 0)
432 return -1; 433 return -1;
433 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); 434 return static_cast<int>((sum * multiplier / num_samples) + 0.5f);
434 } 435 }
435 } // namespace webrtc 436 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | webrtc/video/vie_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698