Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: webrtc/modules/congestion_controller/transport_feedback_adapter.h

Issue 2918323002: Add functionality which limits the number of bytes on the network. (Closed)
Patch Set: Switch to max-rtt within a feedback message and fix race. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_TRANSPORT_FEEDBACK_ADAPTER_H_ 11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_TRANSPORT_FEEDBACK_ADAPTER_H_
12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_TRANSPORT_FEEDBACK_ADAPTER_H_ 12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_TRANSPORT_FEEDBACK_ADAPTER_H_
13 13
14 #include <deque>
14 #include <vector> 15 #include <vector>
15 16
16 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" 17 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h"
17 #include "webrtc/rtc_base/criticalsection.h" 18 #include "webrtc/rtc_base/criticalsection.h"
18 #include "webrtc/rtc_base/thread_annotations.h" 19 #include "webrtc/rtc_base/thread_annotations.h"
19 #include "webrtc/rtc_base/thread_checker.h" 20 #include "webrtc/rtc_base/thread_checker.h"
20 #include "webrtc/system_wrappers/include/clock.h" 21 #include "webrtc/system_wrappers/include/clock.h"
21 22
22 namespace webrtc { 23 namespace webrtc {
23 24
(...skipping 15 matching lines...) Expand all
39 uint16_t sequence_number, 40 uint16_t sequence_number,
40 size_t length, 41 size_t length,
41 const PacedPacketInfo& pacing_info); 42 const PacedPacketInfo& pacing_info);
42 void OnSentPacket(uint16_t sequence_number, int64_t send_time_ms); 43 void OnSentPacket(uint16_t sequence_number, int64_t send_time_ms);
43 44
44 // TODO(holmer): This method should return DelayBasedBwe::Result so that we 45 // TODO(holmer): This method should return DelayBasedBwe::Result so that we
45 // can get rid of the dependency on BitrateController. Requires changes 46 // can get rid of the dependency on BitrateController. Requires changes
46 // to the CongestionController interface. 47 // to the CongestionController interface.
47 void OnTransportFeedback(const rtcp::TransportFeedback& feedback); 48 void OnTransportFeedback(const rtcp::TransportFeedback& feedback);
48 std::vector<PacketFeedback> GetTransportFeedbackVector() const; 49 std::vector<PacketFeedback> GetTransportFeedbackVector() const;
50 rtc::Optional<int64_t> GetMinFeedbackLoopRtt() const;
49 51
50 void SetTransportOverhead(int transport_overhead_bytes_per_packet); 52 void SetTransportOverhead(int transport_overhead_bytes_per_packet);
51 53
52 void SetNetworkIds(uint16_t local_id, uint16_t remote_id); 54 void SetNetworkIds(uint16_t local_id, uint16_t remote_id);
53 55
56 size_t GetOutstandingBytes() const;
57
54 private: 58 private:
55 std::vector<PacketFeedback> GetPacketFeedbackVector( 59 std::vector<PacketFeedback> GetPacketFeedbackVector(
56 const rtcp::TransportFeedback& feedback); 60 const rtcp::TransportFeedback& feedback);
57 61
58 const bool send_side_bwe_with_overhead_; 62 const bool send_side_bwe_with_overhead_;
59 rtc::CriticalSection lock_; 63 rtc::CriticalSection lock_;
60 int transport_overhead_bytes_per_packet_ GUARDED_BY(&lock_); 64 int transport_overhead_bytes_per_packet_ GUARDED_BY(&lock_);
61 SendTimeHistory send_time_history_ GUARDED_BY(&lock_); 65 SendTimeHistory send_time_history_ GUARDED_BY(&lock_);
62 const Clock* const clock_; 66 const Clock* const clock_;
63 int64_t current_offset_ms_; 67 int64_t current_offset_ms_;
64 int64_t last_timestamp_us_; 68 int64_t last_timestamp_us_;
65 std::vector<PacketFeedback> last_packet_feedback_vector_; 69 std::vector<PacketFeedback> last_packet_feedback_vector_;
66 uint16_t local_net_id_ GUARDED_BY(&lock_); 70 uint16_t local_net_id_ GUARDED_BY(&lock_);
67 uint16_t remote_net_id_ GUARDED_BY(&lock_); 71 uint16_t remote_net_id_ GUARDED_BY(&lock_);
72 std::deque<int64_t> feedback_rtts_ GUARDED_BY(&lock_);
73 rtc::Optional<int64_t> min_feedback_rtt_ GUARDED_BY(&lock_);
68 74
69 rtc::CriticalSection observers_lock_; 75 rtc::CriticalSection observers_lock_;
70 std::vector<PacketFeedbackObserver*> observers_ GUARDED_BY(&observers_lock_); 76 std::vector<PacketFeedbackObserver*> observers_ GUARDED_BY(&observers_lock_);
71 }; 77 };
72 78
73 } // namespace webrtc 79 } // namespace webrtc
74 80
75 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_TRANSPORT_FEEDBACK_ADAPTER_H_ 81 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_TRANSPORT_FEEDBACK_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698