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

Side by Side Diff: webrtc/modules/congestion_controller/probe_controller.h

Issue 2504023002: Implement periodic bandwidth probing in application-limited region. (Closed)
Patch Set: address feedback Created 4 years 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 18 matching lines...) Expand all
29 ProbeController(PacedSender* pacer, Clock* clock); 29 ProbeController(PacedSender* pacer, Clock* clock);
30 30
31 void SetBitrates(int min_bitrate_bps, 31 void SetBitrates(int min_bitrate_bps,
32 int start_bitrate_bps, 32 int start_bitrate_bps,
33 int max_bitrate_bps); 33 int max_bitrate_bps);
34 34
35 void OnNetworkStateChanged(NetworkState state); 35 void OnNetworkStateChanged(NetworkState state);
36 36
37 void SetEstimatedBitrate(int bitrate_bps); 37 void SetEstimatedBitrate(int bitrate_bps);
38 38
39 void EnablePeriodicAlrProbing(bool enable);
40 void Process();
41
39 private: 42 private:
40 enum class State { 43 enum class State {
41 // Initial state where no probing has been triggered yet. 44 // Initial state where no probing has been triggered yet.
42 kInit, 45 kInit,
43 // Waiting for probing results to continue further probing. 46 // Waiting for probing results to continue further probing.
44 kWaitingForProbingResult, 47 kWaitingForProbingResult,
45 // Probing is complete. 48 // Probing is complete.
46 kProbingComplete, 49 kProbingComplete,
47 }; 50 };
48 51
49 void InitiateExponentialProbing() EXCLUSIVE_LOCKS_REQUIRED(critsect_); 52 void InitiateExponentialProbing() EXCLUSIVE_LOCKS_REQUIRED(critsect_);
50 void InitiateProbing(std::initializer_list<int> bitrates_to_probe, 53 void InitiateProbing(int64_t now_ms,
54 std::initializer_list<int> bitrates_to_probe,
51 int min_bitrate_to_probe_further_bps) 55 int min_bitrate_to_probe_further_bps)
52 EXCLUSIVE_LOCKS_REQUIRED(critsect_); 56 EXCLUSIVE_LOCKS_REQUIRED(critsect_);
53 57
54 rtc::CriticalSection critsect_; 58 rtc::CriticalSection critsect_;
55 PacedSender* const pacer_; 59 PacedSender* const pacer_;
56 Clock* const clock_; 60 Clock* const clock_;
57 NetworkState network_state_ GUARDED_BY(critsect_); 61 NetworkState network_state_ GUARDED_BY(critsect_);
58 State state_ GUARDED_BY(critsect_); 62 State state_ GUARDED_BY(critsect_);
59 int min_bitrate_to_probe_further_bps_ GUARDED_BY(critsect_); 63 int min_bitrate_to_probe_further_bps_ GUARDED_BY(critsect_);
60 int64_t time_last_probing_initiated_ms_ GUARDED_BY(critsect_); 64 int64_t time_last_probing_initiated_ms_ GUARDED_BY(critsect_);
61 int estimated_bitrate_bps_ GUARDED_BY(critsect_); 65 int estimated_bitrate_bps_ GUARDED_BY(critsect_);
62 int start_bitrate_bps_ GUARDED_BY(critsect_); 66 int start_bitrate_bps_ GUARDED_BY(critsect_);
63 int max_bitrate_bps_ GUARDED_BY(critsect_); 67 int max_bitrate_bps_ GUARDED_BY(critsect_);
64 int64_t last_alr_probing_time_ GUARDED_BY(critsect_); 68 int64_t last_alr_probing_time_ GUARDED_BY(critsect_);
69 bool enable_periodic_alr_probing_ GUARDED_BY(critsect_);
65 70
66 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(ProbeController); 71 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(ProbeController);
67 }; 72 };
68 73
69 } // namespace webrtc 74 } // namespace webrtc
70 75
71 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_PROBE_CONTROLLER_H_ 76 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_PROBE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698