OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_CAST_NET_PACING_PACED_SENDER_H_ | 5 #ifndef MEDIA_CAST_NET_PACING_PACED_SENDER_H_ |
6 #define MEDIA_CAST_NET_PACING_PACED_SENDER_H_ | 6 #define MEDIA_CAST_NET_PACING_PACED_SENDER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 public: | 89 public: |
90 virtual bool SendPackets(const SendPacketVector& packets) = 0; | 90 virtual bool SendPackets(const SendPacketVector& packets) = 0; |
91 virtual bool ResendPackets(const SendPacketVector& packets, | 91 virtual bool ResendPackets(const SendPacketVector& packets, |
92 const DedupInfo& dedup_info) = 0; | 92 const DedupInfo& dedup_info) = 0; |
93 virtual bool SendRtcpPacket(uint32_t ssrc, PacketRef packet) = 0; | 93 virtual bool SendRtcpPacket(uint32_t ssrc, PacketRef packet) = 0; |
94 virtual void CancelSendingPacket(const PacketKey& packet_key) = 0; | 94 virtual void CancelSendingPacket(const PacketKey& packet_key) = 0; |
95 | 95 |
96 virtual ~PacedPacketSender() {} | 96 virtual ~PacedPacketSender() {} |
97 }; | 97 }; |
98 | 98 |
99 class PacedSender : public PacedPacketSender, | 99 class PacedSender : public PacedPacketSender { |
100 public base::NonThreadSafe, | |
101 public base::SupportsWeakPtr<PacedSender> { | |
102 public: | 100 public: |
103 // |recent_packet_events| is an externally-owned vector where PacedSender will | 101 // |recent_packet_events| is an externally-owned vector where PacedSender will |
104 // add PacketEvents related to sending, retransmission, and rejection. The | 102 // add PacketEvents related to sending, retransmission, and rejection. The |
105 // |external_transport| should only be used by the Cast receiver and for | 103 // |external_transport| should only be used by the Cast receiver and for |
106 // testing. | 104 // testing. |
107 PacedSender( | 105 PacedSender( |
108 size_t target_burst_size, // Should normally be kTargetBurstSize. | 106 size_t target_burst_size, // Should normally be kTargetBurstSize. |
109 size_t max_burst_size, // Should normally be kMaxBurstSize. | 107 size_t max_burst_size, // Should normally be kMaxBurstSize. |
110 base::TickClock* clock, | 108 base::TickClock* clock, |
111 std::vector<PacketEvent>* recent_packet_events, | 109 std::vector<PacketEvent>* recent_packet_events, |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // NOTE: Weak pointers must be invalidated before all other member variables. | 243 // NOTE: Weak pointers must be invalidated before all other member variables. |
246 base::WeakPtrFactory<PacedSender> weak_factory_; | 244 base::WeakPtrFactory<PacedSender> weak_factory_; |
247 | 245 |
248 DISALLOW_COPY_AND_ASSIGN(PacedSender); | 246 DISALLOW_COPY_AND_ASSIGN(PacedSender); |
249 }; | 247 }; |
250 | 248 |
251 } // namespace cast | 249 } // namespace cast |
252 } // namespace media | 250 } // namespace media |
253 | 251 |
254 #endif // MEDIA_CAST_NET_PACING_PACED_SENDER_H_ | 252 #endif // MEDIA_CAST_NET_PACING_PACED_SENDER_H_ |
OLD | NEW |