Renamed PacketQueue2 to RoundRobinPacketQueue.
The previous name packet queue 2 had no indication on what the difference was compared to the regular packet queue. This rename makes it easier to understand the codebase. Additionally the PacketQueueInterface class was introduced to make the class hierarchy easier to follow. The round robin packet queue did not extend the packet queue so there was no reason for inheriting from the specific implementation. Bug: None Change-Id: Idbce081c751fbacd927632f5e71220887d0b5991 Reviewed-on: https://webrtc-review.googlesource.com/49120 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21931}
This commit is contained in:
committed by
Commit Bot
parent
17cdcbb57b
commit
b537496520
@ -16,62 +16,29 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "modules/pacing/packet_queue_interface.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class PacketQueue {
|
||||
class PacketQueue : public PacketQueueInterface {
|
||||
public:
|
||||
explicit PacketQueue(const Clock* clock);
|
||||
virtual ~PacketQueue();
|
||||
~PacketQueue() override;
|
||||
|
||||
struct 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);
|
||||
using Packet = PacketQueueInterface::Packet;
|
||||
|
||||
Packet(const Packet& other);
|
||||
|
||||
virtual ~Packet();
|
||||
|
||||
bool operator<(const Packet& other) const {
|
||||
if (priority != other.priority)
|
||||
return priority > other.priority;
|
||||
if (retransmission != other.retransmission)
|
||||
return other.retransmission;
|
||||
|
||||
return enqueue_order > other.enqueue_order;
|
||||
}
|
||||
|
||||
RtpPacketSender::Priority priority;
|
||||
uint32_t ssrc;
|
||||
uint16_t sequence_number;
|
||||
int64_t capture_time_ms; // Absolute time of frame capture.
|
||||
int64_t enqueue_time_ms; // Absolute time of pacer queue entry.
|
||||
int64_t sum_paused_ms;
|
||||
size_t bytes;
|
||||
bool retransmission;
|
||||
uint64_t enqueue_order;
|
||||
std::list<Packet>::iterator this_it;
|
||||
std::multiset<int64_t>::iterator enqueue_time_it;
|
||||
};
|
||||
|
||||
virtual void Push(const Packet& packet);
|
||||
virtual const Packet& BeginPop();
|
||||
virtual void CancelPop(const Packet& packet);
|
||||
virtual void FinalizePop(const Packet& packet);
|
||||
virtual bool Empty() const;
|
||||
virtual size_t SizeInPackets() const;
|
||||
virtual uint64_t SizeInBytes() const;
|
||||
virtual int64_t OldestEnqueueTimeMs() const;
|
||||
virtual void UpdateQueueTime(int64_t timestamp_ms);
|
||||
virtual void SetPauseState(bool paused, int64_t timestamp_ms);
|
||||
virtual int64_t AverageQueueTimeMs() const;
|
||||
void Push(const Packet& packet) override;
|
||||
const Packet& BeginPop() override;
|
||||
void CancelPop(const Packet& packet) override;
|
||||
void FinalizePop(const Packet& packet) override;
|
||||
bool Empty() const override;
|
||||
size_t SizeInPackets() const override;
|
||||
uint64_t SizeInBytes() const override;
|
||||
int64_t OldestEnqueueTimeMs() const override;
|
||||
void UpdateQueueTime(int64_t timestamp_ms) override;
|
||||
void SetPauseState(bool paused, int64_t timestamp_ms) override;
|
||||
int64_t AverageQueueTimeMs() const override;
|
||||
|
||||
private:
|
||||
// Try to add a packet to the set of ssrc/seqno identifiers currently in the
|
||||
|
||||
Reference in New Issue
Block a user