summaryrefslogtreecommitdiffstats
path: root/media/cast/net/pacing/paced_sender.h
diff options
context:
space:
mode:
Diffstat (limited to 'media/cast/net/pacing/paced_sender.h')
-rw-r--r--media/cast/net/pacing/paced_sender.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/media/cast/net/pacing/paced_sender.h b/media/cast/net/pacing/paced_sender.h
index 714fe9d..41609e7 100644
--- a/media/cast/net/pacing/paced_sender.h
+++ b/media/cast/net/pacing/paced_sender.h
@@ -42,6 +42,11 @@ struct PacketKey {
uint32_t frame_id;
uint16_t packet_id;
+ bool operator==(const PacketKey& key) const {
+ return std::tie(capture_time, ssrc, frame_id, packet_id) ==
+ std::tie(key.capture_time, key.ssrc, key.frame_id, key.packet_id);
+ }
+
bool operator<(const PacketKey& key) const {
return std::tie(capture_time, ssrc, frame_id, packet_id) <
std::tie(key.capture_time, key.ssrc, key.frame_id, key.packet_id);
@@ -171,9 +176,12 @@ class PacedSender : public PacedPacketSender,
bool empty() const;
size_t size() const;
- // Returns the next packet to send. RTCP packets have highest priority,
- // resend packets have second highest priority and then comes everything
- // else.
+ // Returns the next packet to send. RTCP packets have highest priority, then
+ // high-priority RTP packets, then normal-priority RTP packets. Packets
+ // within a frame are selected based on fairness to ensure all have an equal
+ // chance of being sent. Therefore, it is up to client code to ensure that
+ // packets acknowledged in NACK messages are removed from PacedSender (see
+ // CancelSendingPacket()), to avoid wasteful retransmission.
PacketRef PopNextPacket(PacketType* packet_type,
PacketKey* packet_key);
@@ -203,6 +211,7 @@ class PacedSender : public PacedPacketSender,
// packet was sent.
int64_t last_byte_sent_for_audio; // Number of bytes sent to network from
// audio stream just before this packet.
+ int cancel_count; // Number of times the packet was canceled (debugging).
};
typedef std::map<PacketKey, PacketSendRecord> PacketSendHistory;
PacketSendHistory send_history_;