OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void RunFor(int64_t time_ms, Packets* in_out) override; | 74 void RunFor(int64_t time_ms, Packets* in_out) override; |
75 | 75 |
76 virtual VideoSource* source() const { return source_; } | 76 virtual VideoSource* source() const { return source_; } |
77 | 77 |
78 uint32_t TargetBitrateKbps() override; | 78 uint32_t TargetBitrateKbps() override; |
79 | 79 |
80 // Implements BitrateObserver. | 80 // Implements BitrateObserver. |
81 void OnNetworkChanged(uint32_t target_bitrate_bps, | 81 void OnNetworkChanged(uint32_t target_bitrate_bps, |
82 uint8_t fraction_lost, | 82 uint8_t fraction_lost, |
83 int64_t rtt) override; | 83 int64_t rtt) override; |
84 | |
85 void Pause() override; | 84 void Pause() override; |
86 void Resume(int64_t paused_time_ms) override; | 85 void Resume(int64_t paused_time_ms) override; |
87 | 86 |
88 protected: | 87 protected: |
89 void ProcessFeedbackAndGeneratePackets(int64_t time_ms, | 88 void ProcessFeedbackAndGeneratePackets(int64_t time_ms, |
90 std::list<FeedbackPacket*>* feedbacks, | 89 std::list<FeedbackPacket*>* feedbacks, |
91 Packets* generated); | 90 Packets* generated); |
92 | 91 |
93 VideoSource* source_; | 92 VideoSource* source_; |
94 std::unique_ptr<BweSender> bwe_; | 93 std::unique_ptr<BweSender> bwe_; |
(...skipping 21 matching lines...) Expand all Loading... |
116 bool retransmission, | 115 bool retransmission, |
117 const PacedPacketInfo& pacing_info) override; | 116 const PacedPacketInfo& pacing_info) override; |
118 size_t TimeToSendPadding(size_t bytes, | 117 size_t TimeToSendPadding(size_t bytes, |
119 const PacedPacketInfo& pacing_info) override; | 118 const PacedPacketInfo& pacing_info) override; |
120 | 119 |
121 // Implements BitrateObserver. | 120 // Implements BitrateObserver. |
122 void OnNetworkChanged(uint32_t target_bitrate_bps, | 121 void OnNetworkChanged(uint32_t target_bitrate_bps, |
123 uint8_t fraction_lost, | 122 uint8_t fraction_lost, |
124 int64_t rtt) override; | 123 int64_t rtt) override; |
125 | 124 |
| 125 void OnNetworkChanged(uint32_t bitrate_for_encoder_bps, |
| 126 uint32_t bitrate_for_pacer_bps, |
| 127 bool in_probe_rtt, |
| 128 int64_t rtt, |
| 129 uint64_t congestion_window) override; |
| 130 size_t pacer_queue_size_in_bytes() override { |
| 131 return pacer_queue_size_in_bytes_; |
| 132 } |
| 133 void OnBytesAcked(size_t bytes) override; |
| 134 |
126 private: | 135 private: |
127 int64_t TimeUntilNextProcess(const std::list<Module*>& modules); | 136 int64_t TimeUntilNextProcess(const std::list<Module*>& modules); |
128 void CallProcess(const std::list<Module*>& modules); | 137 void CallProcess(const std::list<Module*>& modules); |
129 void QueuePackets(Packets* batch, int64_t end_of_batch_time_us); | 138 void QueuePackets(Packets* batch, int64_t end_of_batch_time_us); |
130 | 139 |
131 PacedSender pacer_; | 140 size_t pacer_queue_size_in_bytes_ = 0; |
| 141 std::unique_ptr<Pacer> pacer_; |
132 Packets queue_; | 142 Packets queue_; |
133 Packets pacer_queue_; | 143 Packets pacer_queue_; |
134 | 144 |
135 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(PacedVideoSender); | 145 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(PacedVideoSender); |
136 }; | 146 }; |
137 | 147 |
138 class TcpSender : public PacketSender { | 148 class TcpSender : public PacketSender { |
139 public: | 149 public: |
140 TcpSender(PacketProcessorListener* listener, int flow_id, int64_t offset_ms); | 150 TcpSender(PacketProcessorListener* listener, int flow_id, int64_t offset_ms); |
141 TcpSender(PacketProcessorListener* listener, | 151 TcpSender(PacketProcessorListener* listener, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 int total_sent_bytes_; | 198 int total_sent_bytes_; |
189 int send_limit_bytes_; // Initialized by default as kNoLimit. | 199 int send_limit_bytes_; // Initialized by default as kNoLimit. |
190 int64_t last_generated_packets_ms_; | 200 int64_t last_generated_packets_ms_; |
191 size_t num_recent_sent_packets_; | 201 size_t num_recent_sent_packets_; |
192 uint32_t bitrate_kbps_; | 202 uint32_t bitrate_kbps_; |
193 }; | 203 }; |
194 } // namespace bwe | 204 } // namespace bwe |
195 } // namespace testing | 205 } // namespace testing |
196 } // namespace webrtc | 206 } // namespace webrtc |
197 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_PACKET_SENDER_H_ | 207 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_PACKET_SENDER_H_ |
OLD | NEW |