| 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 28 matching lines...) Expand all Loading... |
| 39 // Implements TransportFeedbackObserver. | 39 // Implements TransportFeedbackObserver. |
| 40 void AddPacket(uint16_t sequence_number, | 40 void AddPacket(uint16_t sequence_number, |
| 41 size_t length, | 41 size_t length, |
| 42 const PacedPacketInfo& pacing_info) override; | 42 const PacedPacketInfo& pacing_info) override; |
| 43 void OnSentPacket(uint16_t sequence_number, int64_t send_time_ms); | 43 void OnSentPacket(uint16_t sequence_number, int64_t send_time_ms); |
| 44 | 44 |
| 45 // TODO(holmer): This method should return DelayBasedBwe::Result so that we | 45 // TODO(holmer): This method should return DelayBasedBwe::Result so that we |
| 46 // can get rid of the dependency on BitrateController. Requires changes | 46 // can get rid of the dependency on BitrateController. Requires changes |
| 47 // to the CongestionController interface. | 47 // to the CongestionController interface. |
| 48 void OnTransportFeedback(const rtcp::TransportFeedback& feedback) override; | 48 void OnTransportFeedback(const rtcp::TransportFeedback& feedback) override; |
| 49 std::vector<PacketInfo> GetTransportFeedbackVector() const override; | 49 std::vector<PacketFeedback> GetTransportFeedbackVector() const override; |
| 50 | 50 |
| 51 // Implements CallStatsObserver. | 51 // Implements CallStatsObserver. |
| 52 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; | 52 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; |
| 53 | 53 |
| 54 void SetStartBitrate(int start_bitrate_bps); | 54 void SetStartBitrate(int start_bitrate_bps); |
| 55 void SetMinBitrate(int min_bitrate_bps); | 55 void SetMinBitrate(int min_bitrate_bps); |
| 56 void SetTransportOverhead(int transport_overhead_bytes_per_packet); | 56 void SetTransportOverhead(int transport_overhead_bytes_per_packet); |
| 57 | 57 |
| 58 int64_t GetProbingIntervalMs() const; | 58 int64_t GetProbingIntervalMs() const; |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 std::vector<PacketInfo> GetPacketFeedbackVector( | 61 std::vector<PacketFeedback> GetPacketFeedbackVector( |
| 62 const rtcp::TransportFeedback& feedback); | 62 const rtcp::TransportFeedback& feedback); |
| 63 | 63 |
| 64 const bool send_side_bwe_with_overhead_; | 64 const bool send_side_bwe_with_overhead_; |
| 65 rtc::CriticalSection lock_; | 65 rtc::CriticalSection lock_; |
| 66 rtc::CriticalSection bwe_lock_; | 66 rtc::CriticalSection bwe_lock_; |
| 67 int transport_overhead_bytes_per_packet_ GUARDED_BY(&lock_); | 67 int transport_overhead_bytes_per_packet_ GUARDED_BY(&lock_); |
| 68 SendTimeHistory send_time_history_ GUARDED_BY(&lock_); | 68 SendTimeHistory send_time_history_ GUARDED_BY(&lock_); |
| 69 std::unique_ptr<DelayBasedBwe> delay_based_bwe_ GUARDED_BY(&bwe_lock_); | 69 std::unique_ptr<DelayBasedBwe> delay_based_bwe_ GUARDED_BY(&bwe_lock_); |
| 70 RtcEventLog* const event_log_; | 70 RtcEventLog* const event_log_; |
| 71 Clock* const clock_; | 71 Clock* const clock_; |
| 72 int64_t current_offset_ms_; | 72 int64_t current_offset_ms_; |
| 73 int64_t last_timestamp_us_; | 73 int64_t last_timestamp_us_; |
| 74 BitrateController* const bitrate_controller_; | 74 BitrateController* const bitrate_controller_; |
| 75 std::vector<PacketInfo> last_packet_feedback_vector_; | 75 std::vector<PacketFeedback> last_packet_feedback_vector_; |
| 76 | 76 |
| 77 // Three main threads are in play: | 77 // Three main threads are in play: |
| 78 // | 78 // |
| 79 // 1. Data packetized and scheduled for transmission (AddPacket). | 79 // 1. Data packetized and scheduled for transmission (AddPacket). |
| 80 // 2. After socket sends the data, a notification is produced (OnSentPacket). | 80 // 2. After socket sends the data, a notification is produced (OnSentPacket). |
| 81 // The same thread is also the one on which feedbacks are | 81 // The same thread is also the one on which feedbacks are |
| 82 // received (OnTransportFeedback). | 82 // received (OnTransportFeedback). |
| 83 // 3. RTT updates, etc., received from the module process thread (CallStats). | 83 // 3. RTT updates, etc., received from the module process thread (CallStats). |
| 84 // | 84 // |
| 85 // Note: Not everything falls into this division. GetProbingIntervalMs, for | 85 // Note: Not everything falls into this division. GetProbingIntervalMs, for |
| 86 // example, is called from multiple threads. | 86 // example, is called from multiple threads. |
| 87 rtc::ThreadChecker packetizer_thread_checker_; | 87 rtc::ThreadChecker packetizer_thread_checker_; |
| 88 rtc::ThreadChecker worker_thread_checker_; | 88 rtc::ThreadChecker worker_thread_checker_; |
| 89 rtc::ThreadChecker module_process_thread_checker_; | 89 rtc::ThreadChecker module_process_thread_checker_; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace webrtc | 92 } // namespace webrtc |
| 93 | 93 |
| 94 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_TRANSPORT_FEEDBACK_ADAPTER_H_ | 94 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_TRANSPORT_FEEDBACK_ADAPTER_H_ |
| OLD | NEW |