Index: webrtc/modules/pacing/bitrate_prober.h |
diff --git a/webrtc/modules/pacing/bitrate_prober.h b/webrtc/modules/pacing/bitrate_prober.h |
index c2f9ad8c4713db52ea8d000b6ca1d554d31d5adf..ef1d179ff216fb007e5bede5f6f178ccf902f1a7 100644 |
--- a/webrtc/modules/pacing/bitrate_prober.h |
+++ b/webrtc/modules/pacing/bitrate_prober.h |
@@ -25,6 +25,19 @@ class BitrateProber { |
public: |
BitrateProber(); |
+ enum class State { |
+ // Probing will not be triggered in this state at all times. |
+ kDisabled, |
+ // Probing is enabled, but currently inactive. |
+ kInactive, |
+ // Probe cluster is filled with the set of data rates to be probed and |
+ // probing is active. |
+ kActive, |
+ // Probing is enabled and complete. No active probing until an explicit |
+ // request comes in again. |
+ kComplete, |
+ }; |
+ |
void SetEnabled(bool enable); |
// Returns true if the prober is in a probing session, i.e., it currently |
@@ -32,12 +45,11 @@ class BitrateProber { |
// TimeUntilNextProbe(). |
bool IsProbing() const; |
- // Initializes a new probing session if the prober is allowed to probe. Does |
- // not initialize the prober unless the packet size is large enough to probe |
- // with. |
- void OnIncomingPacket(uint32_t bitrate_bps, |
- size_t packet_size, |
- int64_t now_ms); |
+ // Initializes a new probing session. |
+ // Returns true on success, false on failure. |
+ bool InitiateProbing(uint32_t bitrate_bps, |
+ const int* multipliers, |
+ int multiplier_count); |
// Returns the number of milliseconds until the next packet should be sent to |
// get accurate probing. |
@@ -50,24 +62,12 @@ class BitrateProber { |
// packet. |
size_t RecommendedPacketSize() const; |
- // Called to report to the prober that a packet has been sent, which helps the |
- // prober know when to move to the next packet in a probe. |
- void PacketSent(int64_t now_ms, size_t packet_size); |
+ // Notifies the prober that a probe packet has been sent, which helps the |
+ // prober move to the next packet in a probe. |
+ // Returns |probing_state_| after the call. |
+ State PacketSent(int64_t now_ms, size_t packet_size); |
private: |
- enum class ProbingState { |
- // Probing will not be triggered in this state at all times. |
- kDisabled, |
- // Probing is enabled and ready to trigger on the first packet arrival. |
- kInactive, |
- // Probe cluster is filled with the set of data rates to be probed and |
- // probes are being sent. |
- kActive, |
- // Probing is enabled, but currently suspended until an explicit trigger |
- // to start probing again. |
- kSuspended, |
- }; |
- |
struct ProbeCluster { |
int max_probe_packets = 0; |
int sent_probe_packets = 0; |
@@ -78,7 +78,7 @@ class BitrateProber { |
// Resets the state of the prober and clears any cluster/timing data tracked. |
void ResetState(); |
- ProbingState probing_state_; |
+ State probing_state_; |
// Probe bitrate per packet. These are used to compute the delta relative to |
// the previous probe packet based on the size and time when that packet was |
// sent. |