OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
11 #ifndef WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ | 11 #ifndef WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ |
12 #define WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ | 12 #define WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ |
13 | 13 |
14 #include <queue> | 14 #include <queue> |
15 | 15 |
16 #include "webrtc/base/basictypes.h" | 16 #include "webrtc/base/basictypes.h" |
17 #include "webrtc/modules/include/module_common_types.h" | 17 #include "webrtc/modules/include/module_common_types.h" |
18 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 class RtcEventLog; | |
22 | 21 |
23 // Note that this class isn't thread-safe by itself and therefore relies | 22 // Note that this class isn't thread-safe by itself and therefore relies |
24 // on being protected by the caller. | 23 // on being protected by the caller. |
25 class BitrateProber { | 24 class BitrateProber { |
26 public: | 25 public: |
27 BitrateProber(); | 26 BitrateProber(); |
28 explicit BitrateProber(RtcEventLog* event_log); | |
29 | 27 |
30 void SetEnabled(bool enable); | 28 void SetEnabled(bool enable); |
31 | 29 |
32 // Returns true if the prober is in a probing session, i.e., it currently | 30 // Returns true if the prober is in a probing session, i.e., it currently |
33 // wants packets to be sent out according to the time returned by | 31 // wants packets to be sent out according to the time returned by |
34 // TimeUntilNextProbe(). | 32 // TimeUntilNextProbe(). |
35 bool IsProbing() const; | 33 bool IsProbing() const; |
36 | 34 |
37 // Initializes a new probing session if the prober is allowed to probe. Does | 35 // Initializes a new probing session if the prober is allowed to probe. Does |
38 // not initialize the prober unless the packet size is large enough to probe | 36 // not initialize the prober unless the packet size is large enough to probe |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 93 |
96 // Probe bitrate per packet. These are used to compute the delta relative to | 94 // Probe bitrate per packet. These are used to compute the delta relative to |
97 // the previous probe packet based on the size and time when that packet was | 95 // the previous probe packet based on the size and time when that packet was |
98 // sent. | 96 // sent. |
99 std::queue<ProbeCluster> clusters_; | 97 std::queue<ProbeCluster> clusters_; |
100 | 98 |
101 // Time the next probe should be sent when in kActive state. | 99 // Time the next probe should be sent when in kActive state. |
102 int64_t next_probe_time_ms_; | 100 int64_t next_probe_time_ms_; |
103 | 101 |
104 int next_cluster_id_; | 102 int next_cluster_id_; |
105 RtcEventLog* const event_log_; | |
106 }; | 103 }; |
107 | 104 |
108 } // namespace webrtc | 105 } // namespace webrtc |
109 | 106 |
110 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ | 107 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ |
OLD | NEW |