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

Side by Side Diff: webrtc/modules/pacing/bitrate_prober.h

Issue 2628563003: Propagate packet pacing information to SenTimeHistory (Closed)
Patch Set: . Created 3 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
OLDNEW
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/typedefs.h" 17 #include "webrtc/typedefs.h"
18 18
19 namespace webrtc { 19 namespace webrtc {
20 20
21 class ProbeClusterCreatedObserver {
22 public:
23 virtual ~ProbeClusterCreatedObserver() {}
24 virtual void OnProbingClusterCreated(int cluster_id,
nisse-webrtc 2017/01/10 16:04:41 Please document what the parameters mean. Might a
philipel 2017/01/11 09:03:33 Done
nisse-webrtc 2017/01/11 09:10:32 Even if it delegates the processing, I still don't
25 int min_bytes,
26 int min_probes) = 0;
27 };
28
21 // Note that this class isn't thread-safe by itself and therefore relies 29 // Note that this class isn't thread-safe by itself and therefore relies
22 // on being protected by the caller. 30 // on being protected by the caller.
23 class BitrateProber { 31 class BitrateProber {
24 public: 32 public:
25 BitrateProber(); 33 BitrateProber();
26 34
35 explicit BitrateProber(ProbeClusterCreatedObserver* cluster_created_observer);
36
27 void SetEnabled(bool enable); 37 void SetEnabled(bool enable);
28 38
29 // Returns true if the prober is in a probing session, i.e., it currently 39 // Returns true if the prober is in a probing session, i.e., it currently
30 // wants packets to be sent out according to the time returned by 40 // wants packets to be sent out according to the time returned by
31 // TimeUntilNextProbe(). 41 // TimeUntilNextProbe().
32 bool IsProbing() const; 42 bool IsProbing() const;
33 43
34 // Initializes a new probing session if the prober is allowed to probe. Does 44 // Initializes a new probing session if the prober is allowed to probe. Does
35 // not initialize the prober unless the packet size is large enough to probe 45 // not initialize the prober unless the packet size is large enough to probe
36 // with. 46 // with.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 103
94 // Probe bitrate per packet. These are used to compute the delta relative to 104 // Probe bitrate per packet. These are used to compute the delta relative to
95 // the previous probe packet based on the size and time when that packet was 105 // the previous probe packet based on the size and time when that packet was
96 // sent. 106 // sent.
97 std::queue<ProbeCluster> clusters_; 107 std::queue<ProbeCluster> clusters_;
98 108
99 // Time the next probe should be sent when in kActive state. 109 // Time the next probe should be sent when in kActive state.
100 int64_t next_probe_time_ms_; 110 int64_t next_probe_time_ms_;
101 111
102 int next_cluster_id_; 112 int next_cluster_id_;
113
114 ProbeClusterCreatedObserver* cluster_created_observer_;
103 }; 115 };
104 116
105 } // namespace webrtc 117 } // namespace webrtc
106 118
107 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ 119 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698