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

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

Issue 2996643002: BWE allocation strategy
Patch Set: Comments handling Created 3 years, 3 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
« no previous file with comments | « webrtc/modules/pacing/paced_sender.h ('k') | webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/pacing/paced_sender.cc
diff --git a/webrtc/modules/pacing/paced_sender.cc b/webrtc/modules/pacing/paced_sender.cc
index acfcd1fbffc98dcf94eddb90966fe3b353dd7c84..d2808a2f9cc828376208605d1641228af21827bc 100644
--- a/webrtc/modules/pacing/paced_sender.cc
+++ b/webrtc/modules/pacing/paced_sender.cc
@@ -256,7 +256,8 @@ PacedSender::PacedSender(const Clock* clock,
packets_(new paced_sender::PacketQueue(clock)),
packet_counter_(0),
pacing_factor_(kDefaultPaceMultiplier),
- queue_time_limit(kMaxQueueLengthMs) {
+ queue_time_limit(kMaxQueueLengthMs),
+ account_for_audio_(false) {
UpdateBudgetWithElapsedTime(kMinPacketLimitMs);
}
@@ -347,6 +348,11 @@ void PacedSender::InsertPacket(RtpPacketSender::Priority priority,
retransmission, packet_counter_++));
}
+void PacedSender::SetAccountForAudioPackets(bool account_for_audio) {
+ rtc::CritScope cs(&critsect_);
+ account_for_audio_ = account_for_audio;
+}
+
int64_t PacedSender::ExpectedQueueTimeMs() const {
rtc::CritScope cs(&critsect_);
RTC_DCHECK_GT(pacing_bitrate_kbps_, 0);
@@ -512,9 +518,7 @@ bool PacedSender::SendPacket(const paced_sender::Packet& packet,
critsect_.Enter();
if (success) {
- // TODO(holmer): High priority packets should only be accounted for if we
- // are allocating bandwidth for audio.
- if (packet.priority != kHighPriority) {
+ if (packet.priority != kHighPriority || account_for_audio_) {
// Update media bytes sent.
// TODO(eladalon): TimeToSendPacket() can also return |true| in some
// situations where nothing actually ended up being sent to the network,
« no previous file with comments | « webrtc/modules/pacing/paced_sender.h ('k') | webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698