OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ |
| 10 |
| 11 #ifndef WEBRTC_MODULES_PACING_BBR_PACED_SENDER_H_ |
| 12 #define WEBRTC_MODULES_PACING_BBR_PACED_SENDER_H_ |
| 13 |
| 14 #include <list> |
| 15 #include <memory> |
| 16 |
| 17 #include "webrtc/modules/pacing/paced_sender.h" |
| 18 #include "webrtc/modules/pacing/pacer.h" |
| 19 |
| 20 namespace webrtc { |
| 21 class Clock; |
| 22 class RtcEventLog; |
| 23 namespace bbr_paced_sender { |
| 24 struct Packet; |
| 25 } // namespace bbr_paced_sender |
| 26 class BbrPacedSender : public Pacer { |
| 27 public: |
| 28 BbrPacedSender(const Clock* clock, |
| 29 PacedSender::PacketSender* packet_sender, |
| 30 RtcEventLog* event_log); |
| 31 ~BbrPacedSender() override; |
| 32 void SetEstimatedBitrateAndCongestionWindow( |
| 33 uint32_t bitrate_bps, |
| 34 bool in_probe_rtt, |
| 35 uint64_t congestion_window) override; |
| 36 void SetMinBitrate(int min_send_bitrate_bps); |
| 37 void InsertPacket(RtpPacketSender::Priority priority, |
| 38 uint32_t ssrc, |
| 39 uint16_t sequence_number, |
| 40 int64_t capture_time_ms, |
| 41 size_t bytes, |
| 42 bool retransmission) override; |
| 43 int64_t TimeUntilNextProcess() override; |
| 44 void OnBytesAcked(size_t bytes) override; |
| 45 void Process() override; |
| 46 bool TryToSendPacket(bbr_paced_sender::Packet* packet); |
| 47 |
| 48 private: |
| 49 const Clock* const clock_; |
| 50 PacedSender::PacketSender* const packet_sender_; |
| 51 uint32_t estimated_bitrate_bps_; |
| 52 uint32_t min_send_bitrate_kbps_; |
| 53 uint32_t pacing_bitrate_kbps_; |
| 54 int64_t time_last_update_us_; |
| 55 int64_t time_last_update_ms_; |
| 56 int64_t next_packet_send_time_; |
| 57 float extra_time_; |
| 58 std::list<bbr_paced_sender::Packet*> packets_; |
| 59 size_t data_inflight_; |
| 60 size_t congestion_window_; |
| 61 bool in_probe_rtt_; |
| 62 }; |
| 63 } // namespace webrtc |
| 64 #endif // WEBRTC_MODULES_PACING_BBR_PACED_SENDER_H_ |
OLD | NEW |