Index: webrtc/modules/pacing/paced_sender.cc |
diff --git a/webrtc/modules/pacing/paced_sender.cc b/webrtc/modules/pacing/paced_sender.cc |
index b56d28510f2dc7c6cd377076506da81b987fd09f..55f3972dcb74205b2ba824a5218ad0d228e849aa 100644 |
--- a/webrtc/modules/pacing/paced_sender.cc |
+++ b/webrtc/modules/pacing/paced_sender.cc |
@@ -47,7 +47,8 @@ struct Packet { |
int64_t enqueue_time_ms, |
size_t length_in_bytes, |
bool retransmission, |
- uint64_t enqueue_order) |
+ uint64_t enqueue_order, |
+ int cluster_id = -1) |
danilchap
2016/05/10 15:31:39
try to avoid default arguments. Here it is easy: c
philipel
2016/05/11 09:39:16
Removed default argument, |cluster_id| is not init
|
: priority(priority), |
ssrc(ssrc), |
sequence_number(seq_number), |
@@ -55,7 +56,8 @@ struct Packet { |
enqueue_time_ms(enqueue_time_ms), |
bytes(length_in_bytes), |
retransmission(retransmission), |
- enqueue_order(enqueue_order) {} |
+ enqueue_order(enqueue_order), |
+ cluster_id(cluster_id) {} |
RtpPacketSender::Priority priority; |
uint32_t ssrc; |
@@ -66,6 +68,7 @@ struct Packet { |
bool retransmission; |
uint64_t enqueue_order; |
std::list<Packet>::iterator this_it; |
+ int cluster_id; |
danilchap
2016/05/10 15:31:39
may be instead of modifying Packet structure, usin
philipel
2016/05/11 09:39:16
I agree, removed |cluster_id| From Packet class.
|
}; |
// Used by priority queue to sort packets. |
@@ -113,8 +116,8 @@ class PacketQueue { |
bytes_ += packet.bytes; |
} |
- const Packet& BeginPop() { |
- const Packet& packet = *prio_queue_.top(); |
+ Packet& BeginPop() { |
danilchap
2016/05/10 15:31:39
If you want return a non-const object, return a po
philipel
2016/05/11 09:39:16
True, but now it's const again :)
|
+ Packet& packet = *prio_queue_.top(); |
prio_queue_.pop(); |
return packet; |
} |
@@ -389,7 +392,9 @@ void PacedSender::Process() { |
// Since we need to release the lock in order to send, we first pop the |
// element from the priority queue but keep it in storage, so that we can |
// reinsert it if send fails. |
- const paced_sender::Packet& packet = packets_->BeginPop(); |
+ paced_sender::Packet& packet = packets_->BeginPop(); |
+ if (prober_->IsProbing()) |
+ packet.cluster_id = prober_->CurrentClusterId(); |
danilchap
2016/05/10 15:31:39
should you clear cluster_id if not probing? Either
|
if (SendPacket(packet)) { |
// Send succeeded, remove it from the queue. |
@@ -425,10 +430,9 @@ bool PacedSender::SendPacket(const paced_sender::Packet& packet) { |
if (paused_ && packet.priority != kHighPriority) |
return false; |
critsect_->Leave(); |
- const bool success = callback_->TimeToSendPacket(packet.ssrc, |
- packet.sequence_number, |
- packet.capture_time_ms, |
- packet.retransmission); |
+ const bool success = callback_->TimeToSendPacket( |
+ packet.ssrc, packet.sequence_number, packet.capture_time_ms, |
+ packet.retransmission, packet.cluster_id); |
critsect_->Enter(); |
if (success) { |