Removes legacy PacketQueue implementation.

Also cleans up usage of the new RoundRobinPacketQueue to reduce code
bloat.

Bug: webrtc:8288
Change-Id: I90f17a4422b32c1d4e2d7d5065573157346d6a0b
Reviewed-on: https://webrtc-review.googlesource.com/100306
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24744}
This commit is contained in:
Sebastian Jansson
2018-09-13 17:11:06 +02:00
committed by Commit Bot
parent c7d935899a
commit 60570dc8c4
9 changed files with 91 additions and 382 deletions

View File

@ -17,6 +17,38 @@
namespace webrtc {
RoundRobinPacketQueue::Packet::Packet(RtpPacketSender::Priority priority,
uint32_t ssrc,
uint16_t seq_number,
int64_t capture_time_ms,
int64_t enqueue_time_ms,
size_t length_in_bytes,
bool retransmission,
uint64_t enqueue_order)
: priority(priority),
ssrc(ssrc),
sequence_number(seq_number),
capture_time_ms(capture_time_ms),
enqueue_time_ms(enqueue_time_ms),
sum_paused_ms(0),
bytes(length_in_bytes),
retransmission(retransmission),
enqueue_order(enqueue_order) {}
RoundRobinPacketQueue::Packet::Packet(const Packet& other) = default;
RoundRobinPacketQueue::Packet::~Packet() {}
bool RoundRobinPacketQueue::Packet::operator<(
const RoundRobinPacketQueue::Packet& other) const {
if (priority != other.priority)
return priority > other.priority;
if (retransmission != other.retransmission)
return other.retransmission;
return enqueue_order > other.enqueue_order;
}
RoundRobinPacketQueue::Stream::Stream() : bytes(0), ssrc(0) {}
RoundRobinPacketQueue::Stream::Stream(const Stream& stream) = default;
RoundRobinPacketQueue::Stream::~Stream() {}
@ -69,7 +101,7 @@ void RoundRobinPacketQueue::Push(const Packet& packet_to_insert) {
size_bytes_ += packet.bytes;
}
const PacketQueueInterface::Packet& RoundRobinPacketQueue::BeginPop() {
const RoundRobinPacketQueue::Packet& RoundRobinPacketQueue::BeginPop() {
RTC_CHECK(!pop_packet_ && !pop_stream_);
Stream* stream = GetHighestPriorityStream();