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

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

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/paced_sender.cc
diff --git a/webrtc/modules/pacing/paced_sender.cc b/webrtc/modules/pacing/paced_sender.cc
index 2e5af7ab40b62fb66d02dc91e4324c33a744718f..23bfbb8dd25368c8e265833354e6368d5c2a307d 100644
--- a/webrtc/modules/pacing/paced_sender.cc
+++ b/webrtc/modules/pacing/paced_sender.cc
@@ -298,6 +298,7 @@ void PacedSender::SetEstimatedBitrate(int bitrate_bps) {
pacing_bitrate_kbps_ =
std::max(min_send_bitrate_kbps_, estimated_bitrate_bps_ / 1000) *
kDefaultPaceMultiplier;
+ prober_->SetEstimatedBitrate(bitrate_bps);
}
void PacedSender::SetSendBitrateLimits(int min_send_bitrate_bps,
@@ -323,7 +324,7 @@ void PacedSender::InsertPacket(RtpPacketSender::Priority priority,
<< "SetEstimatedBitrate must be called before InsertPacket.";
int64_t now_ms = clock_->TimeInMilliseconds();
- prober_->OnIncomingPacket(bytes);
+ prober_->OnIncomingPacket(now_ms, bytes);
if (capture_time_ms < 0)
capture_time_ms = now_ms;
@@ -373,6 +374,11 @@ int64_t PacedSender::TimeUntilNextProcess() {
return std::max<int64_t>(kMinPacketLimitMs - elapsed_time_ms, 0);
}
+bool PacedSender::IsExpectingProbingResults() const {
+ CriticalSectionScoped cs(critsect_.get());
+ return prober_->IsExpectingProbingResults();
+}
+
void PacedSender::Process() {
int64_t now_us = clock_->TimeInMicroseconds();
CriticalSectionScoped cs(critsect_.get());
@@ -458,7 +464,9 @@ bool PacedSender::SendPacket(const paced_sender::Packet& packet,
critsect_->Enter();
if (success) {
- prober_->PacketSent(clock_->TimeInMilliseconds(), packet.bytes);
+ // Is this a probe ?
+ if (probe_cluster_id != PacketInfo::kNotAProbe)
+ prober_->PacketSent(clock_->TimeInMilliseconds(), packet.bytes);
// TODO(holmer): High priority packets should only be accounted for if we
// are allocating bandwidth for audio.
if (packet.priority != kHighPriority) {
@@ -478,7 +486,9 @@ void PacedSender::SendPadding(size_t padding_needed, int probe_cluster_id) {
critsect_->Enter();
if (bytes_sent > 0) {
- prober_->PacketSent(clock_->TimeInMilliseconds(), bytes_sent);
+ // Is this a probe ?
+ if (probe_cluster_id != PacketInfo::kNotAProbe)
+ prober_->PacketSent(clock_->TimeInMilliseconds(), bytes_sent);
media_budget_->UseBudget(bytes_sent);
padding_budget_->UseBudget(bytes_sent);
}

Powered by Google App Engine
This is Rietveld 408576698