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

Side by Side Diff: webrtc/base/bandwidthsmoother.h

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 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/base/autodetectproxy_unittest.cc ('k') | webrtc/base/bandwidthsmoother.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 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 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 13 matching lines...) Expand all
24 // at least as large as the current estimation * percent_increase 24 // at least as large as the current estimation * percent_increase
25 // for at least time_between_increase time. If a sampled bandwidth 25 // for at least time_between_increase time. If a sampled bandwidth
26 // is less than our current estimation we immediately decrease our estimation 26 // is less than our current estimation we immediately decrease our estimation
27 // to that sampled value. 27 // to that sampled value.
28 // We retain the initial bandwidth guess as our current bandwidth estimation 28 // We retain the initial bandwidth guess as our current bandwidth estimation
29 // until we have received (min_sample_count_percent * samples_count_to_average) 29 // until we have received (min_sample_count_percent * samples_count_to_average)
30 // number of samples. Min_sample_count_percent must be in range [0, 1]. 30 // number of samples. Min_sample_count_percent must be in range [0, 1].
31 class BandwidthSmoother { 31 class BandwidthSmoother {
32 public: 32 public:
33 BandwidthSmoother(int initial_bandwidth_guess, 33 BandwidthSmoother(int initial_bandwidth_guess,
34 uint32 time_between_increase, 34 uint32_t time_between_increase,
35 double percent_increase, 35 double percent_increase,
36 size_t samples_count_to_average, 36 size_t samples_count_to_average,
37 double min_sample_count_percent); 37 double min_sample_count_percent);
38 ~BandwidthSmoother(); 38 ~BandwidthSmoother();
39 39
40 // Samples a new bandwidth measurement. 40 // Samples a new bandwidth measurement.
41 // bandwidth is expected to be non-negative. 41 // bandwidth is expected to be non-negative.
42 // returns true if the bandwidth estimation changed 42 // returns true if the bandwidth estimation changed
43 bool Sample(uint32 sample_time, int bandwidth); 43 bool Sample(uint32_t sample_time, int bandwidth);
44 44
45 int get_bandwidth_estimation() const { 45 int get_bandwidth_estimation() const {
46 return bandwidth_estimation_; 46 return bandwidth_estimation_;
47 } 47 }
48 48
49 private: 49 private:
50 uint32 time_between_increase_; 50 uint32_t time_between_increase_;
51 double percent_increase_; 51 double percent_increase_;
52 uint32 time_at_last_change_; 52 uint32_t time_at_last_change_;
53 int bandwidth_estimation_; 53 int bandwidth_estimation_;
54 RollingAccumulator<int> accumulator_; 54 RollingAccumulator<int> accumulator_;
55 double min_sample_count_percent_; 55 double min_sample_count_percent_;
56 }; 56 };
57 57
58 } // namespace rtc 58 } // namespace rtc
59 59
60 #endif // WEBRTC_BASE_BANDWIDTHSMOOTHER_H_ 60 #endif // WEBRTC_BASE_BANDWIDTHSMOOTHER_H_
OLDNEW
« no previous file with comments | « webrtc/base/autodetectproxy_unittest.cc ('k') | webrtc/base/bandwidthsmoother.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698