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

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

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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/pacing/bitrate_prober.cc
diff --git a/webrtc/modules/pacing/bitrate_prober.cc b/webrtc/modules/pacing/bitrate_prober.cc
index d4007cc1ad5c7f0acd84c48cc4fd0fe8e2eae5f5..4860a258362139d8701b34ca412479eabd8e647e 100644
--- a/webrtc/modules/pacing/bitrate_prober.cc
+++ b/webrtc/modules/pacing/bitrate_prober.cc
@@ -28,13 +28,16 @@ constexpr int kMinProbePacketsSent = 5;
// The minimum probing duration in ms.
constexpr int kMinProbeDurationMs = 15;
-
} // namespace
-BitrateProber::BitrateProber()
+BitrateProber::BitrateProber() : BitrateProber(nullptr) {}
+
+BitrateProber::BitrateProber(
+ ProbeClusterCreatedObserver* cluster_created_observer)
: probing_state_(ProbingState::kDisabled),
next_probe_time_ms_(-1),
- next_cluster_id_(0) {
+ next_cluster_id_(0),
+ cluster_created_observer_(cluster_created_observer) {
SetEnabled(true);
}
@@ -74,7 +77,6 @@ void BitrateProber::CreateProbeCluster(int bitrate_bps) {
cluster.bitrate_bps = bitrate_bps;
cluster.id = next_cluster_id_++;
clusters_.push(cluster);
-
LOG(LS_INFO) << "Probe cluster (bitrate:min bytes:min packets): ("
<< cluster.bitrate_bps << ":" << cluster.min_bytes << ":"
<< cluster.min_probes << ")";
@@ -82,6 +84,10 @@ void BitrateProber::CreateProbeCluster(int bitrate_bps) {
// kInactive and wait for OnIncomingPacket to start the probing.
if (probing_state_ != ProbingState::kActive)
probing_state_ = ProbingState::kInactive;
+ if (cluster_created_observer_) {
+ cluster_created_observer_->OnProbingClusterCreated(
+ cluster.id, cluster.min_bytes, cluster.min_probes);
+ }
}
void BitrateProber::ResetState() {

Powered by Google App Engine
This is Rietveld 408576698