Index: webrtc/modules/pacing/bitrate_prober.h |
diff --git a/webrtc/modules/pacing/bitrate_prober.h b/webrtc/modules/pacing/bitrate_prober.h |
index cfeb4972f91f3b2c248c6ce9bf14eee0b27b2c33..ae79d48639bb49e5bda9f245863bb86948c10850 100644 |
--- a/webrtc/modules/pacing/bitrate_prober.h |
+++ b/webrtc/modules/pacing/bitrate_prober.h |
@@ -31,10 +31,14 @@ class BitrateProber { |
// TimeUntilNextProbe(). |
bool IsProbing() const; |
+ bool IsExpectingProbingResults() const; |
+ |
+ void SetEstimatedBitrate(int bitrate_bps); |
+ |
// 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(size_t packet_size); |
+ void OnIncomingPacket(int64_t now_ms, size_t packet_size); |
// Create a cluster used to probe for |bitrate_bps| with |num_packets| number |
// of packets. |
@@ -51,24 +55,11 @@ 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. |
+ // Notifies the prober that a probe packet has been sent, which helps the |
+ // prober move to the next packet in a probe. |
void 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; |
@@ -76,10 +67,24 @@ class BitrateProber { |
int id = -1; |
}; |
+ enum class State { |
+ // Initial state. No probe clusters have been set up yet for probing. |
+ kInit, |
+ // Probe clusters have been set up and probes are being sent. |
+ kSending, |
+ // Probes have been sent, waiting on probing results. |
+ kWaitForResult, |
+ // Probing is complete. No active probing until an explicit |
+ // request for probing. |
+ kComplete, |
+ // Probing disabled. No probing until explicitly enabled again. |
+ kDisabled, |
+ }; |
+ |
// 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. |
@@ -88,6 +93,8 @@ class BitrateProber { |
// The last time a probe was sent. |
int64_t time_last_probe_sent_ms_; |
int next_cluster_id_; |
+ int min_bitrate_to_probe_further_; |
+ int estimated_bitrate_bps_; |
}; |
} // namespace webrtc |
#endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ |