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

Unified Diff: webrtc/modules/pacing/bitrate_prober.h

Issue 2235373004: Probing: Add support for exponential startup probing (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@fix_probing2
Patch Set: Addressed comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/pacing/bitrate_prober.h
diff --git a/webrtc/modules/pacing/bitrate_prober.h b/webrtc/modules/pacing/bitrate_prober.h
index fc0e13fb676cf4b3072c52e5eeaca5bcb6709ced..169e6268f33afd8cbcb10298ad066dfaed650206 100644
--- a/webrtc/modules/pacing/bitrate_prober.h
+++ b/webrtc/modules/pacing/bitrate_prober.h
@@ -24,6 +24,20 @@ class BitrateProber {
public:
BitrateProber();
+ enum class State {
danilchap 2016/08/19 17:19:34 what move this enum type into public part? No publ
Irfan 2016/08/23 05:46:57 Done. It used to return in an earlier PS.
+ // 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,
+ };
+
void SetEnabled(bool enable);
// Returns true if the prober is in a probing session, i.e., it currently
@@ -31,14 +45,18 @@ 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.
- void ProbeAtBitrate(uint32_t bitrate_bps, int num_packets);
+ void ProbeAtBitrate(int bitrate_bps, int num_packets);
// Returns the number of milliseconds until the next packet should be sent to
// get accurate probing.
@@ -51,24 +69,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;
@@ -79,7 +84,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.
@@ -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_

Powered by Google App Engine
This is Rietveld 408576698