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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // identified by SSRC is just sent. | 124 // identified by SSRC is just sent. |
125 int64_t GetLastByteSentForSsrc(uint32_t ssrc); | 125 int64_t GetLastByteSentForSsrc(uint32_t ssrc); |
126 | 126 |
127 // PacedPacketSender implementation. | 127 // PacedPacketSender implementation. |
128 bool SendPackets(const SendPacketVector& packets) final; | 128 bool SendPackets(const SendPacketVector& packets) final; |
129 bool ResendPackets(const SendPacketVector& packets, | 129 bool ResendPackets(const SendPacketVector& packets, |
130 const DedupInfo& dedup_info) final; | 130 const DedupInfo& dedup_info) final; |
131 bool SendRtcpPacket(uint32_t ssrc, PacketRef packet) final; | 131 bool SendRtcpPacket(uint32_t ssrc, PacketRef packet) final; |
132 void CancelSendingPacket(const PacketKey& packet_key) final; | 132 void CancelSendingPacket(const PacketKey& packet_key) final; |
133 | 133 |
| 134 void SetTargetBurstSize(int burst_size) { |
| 135 target_burst_size_ = current_max_burst_size_ = next_max_burst_size_ = |
| 136 next_next_max_burst_size_ = burst_size; |
| 137 } |
| 138 |
| 139 void SetMaxBurstSize(int burst_size) { max_burst_size_ = burst_size; } |
| 140 |
134 private: | 141 private: |
135 // Actually sends the packets to the transport. | 142 // Actually sends the packets to the transport. |
136 void SendStoredPackets(); | 143 void SendStoredPackets(); |
137 | 144 |
138 // Convenience method for building a PacketEvent and storing it in the | 145 // Convenience method for building a PacketEvent and storing it in the |
139 // externally-owned container of |recent_packet_events_|. | 146 // externally-owned container of |recent_packet_events_|. |
140 void LogPacketEvent(const Packet& packet, CastLoggingEvent event); | 147 void LogPacketEvent(const Packet& packet, CastLoggingEvent event); |
141 | 148 |
142 // Returns true if retransmission for packet indexed by |packet_key| is | 149 // Returns true if retransmission for packet indexed by |packet_key| is |
143 // accepted. |dedup_info| contains information to help deduplicate | 150 // accepted. |dedup_info| contains information to help deduplicate |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // NOTE: Weak pointers must be invalidated before all other member variables. | 241 // NOTE: Weak pointers must be invalidated before all other member variables. |
235 base::WeakPtrFactory<PacedSender> weak_factory_; | 242 base::WeakPtrFactory<PacedSender> weak_factory_; |
236 | 243 |
237 DISALLOW_COPY_AND_ASSIGN(PacedSender); | 244 DISALLOW_COPY_AND_ASSIGN(PacedSender); |
238 }; | 245 }; |
239 | 246 |
240 } // namespace cast | 247 } // namespace cast |
241 } // namespace media | 248 } // namespace media |
242 | 249 |
243 #endif // MEDIA_CAST_NET_PACING_PACED_SENDER_H_ | 250 #endif // MEDIA_CAST_NET_PACING_PACED_SENDER_H_ |
OLD | NEW |