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

Side by Side Diff: webrtc/modules/pacing/paced_sender.h

Issue 1962303002: Added cluster id to PacedSender::Callback::TimeToSendPacket. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Cluster id no longer a member of paced_sender::Packet. Created 4 years, 7 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 24 matching lines...) Expand all
35 public: 35 public:
36 class Callback { 36 class Callback {
37 public: 37 public:
38 // Note: packets sent as a result of a callback should not pass by this 38 // Note: packets sent as a result of a callback should not pass by this
39 // module again. 39 // module again.
40 // Called when it's time to send a queued packet. 40 // Called when it's time to send a queued packet.
41 // Returns false if packet cannot be sent. 41 // Returns false if packet cannot be sent.
42 virtual bool TimeToSendPacket(uint32_t ssrc, 42 virtual bool TimeToSendPacket(uint32_t ssrc,
43 uint16_t sequence_number, 43 uint16_t sequence_number,
44 int64_t capture_time_ms, 44 int64_t capture_time_ms,
45 bool retransmission) = 0; 45 bool retransmission,
46 int cluster_id) = 0;
46 // Called when it's a good time to send a padding data. 47 // Called when it's a good time to send a padding data.
47 // Returns the number of bytes sent. 48 // Returns the number of bytes sent.
48 virtual size_t TimeToSendPadding(size_t bytes) = 0; 49 virtual size_t TimeToSendPadding(size_t bytes) = 0;
49 50
50 protected: 51 protected:
51 virtual ~Callback() {} 52 virtual ~Callback() {}
52 }; 53 };
53 54
54 // Expected max pacer delay in ms. If ExpectedQueueTimeMs() is higher than 55 // Expected max pacer delay in ms. If ExpectedQueueTimeMs() is higher than
55 // this value, the packet producers should wait (eg drop frames rather than 56 // this value, the packet producers should wait (eg drop frames rather than
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 int64_t TimeUntilNextProcess() override; 123 int64_t TimeUntilNextProcess() override;
123 124
124 // Process any pending packets in the queue(s). 125 // Process any pending packets in the queue(s).
125 void Process() override; 126 void Process() override;
126 127
127 private: 128 private:
128 // Updates the number of bytes that can be sent for the next time interval. 129 // Updates the number of bytes that can be sent for the next time interval.
129 void UpdateBytesPerInterval(int64_t delta_time_in_ms) 130 void UpdateBytesPerInterval(int64_t delta_time_in_ms)
130 EXCLUSIVE_LOCKS_REQUIRED(critsect_); 131 EXCLUSIVE_LOCKS_REQUIRED(critsect_);
131 132
132 bool SendPacket(const paced_sender::Packet& packet) 133 bool SendPacket(const paced_sender::Packet& packet, int cluster_id)
133 EXCLUSIVE_LOCKS_REQUIRED(critsect_); 134 EXCLUSIVE_LOCKS_REQUIRED(critsect_);
134 void SendPadding(size_t padding_needed) EXCLUSIVE_LOCKS_REQUIRED(critsect_); 135 void SendPadding(size_t padding_needed) EXCLUSIVE_LOCKS_REQUIRED(critsect_);
135 136
136 Clock* const clock_; 137 Clock* const clock_;
137 Callback* const callback_; 138 Callback* const callback_;
138 139
139 std::unique_ptr<CriticalSectionWrapper> critsect_; 140 std::unique_ptr<CriticalSectionWrapper> critsect_;
140 bool paused_ GUARDED_BY(critsect_); 141 bool paused_ GUARDED_BY(critsect_);
141 bool probing_enabled_; 142 bool probing_enabled_;
142 // This is the media budget, keeping track of how many bits of media 143 // This is the media budget, keeping track of how many bits of media
(...skipping 12 matching lines...) Expand all
155 int bitrate_bps_ GUARDED_BY(critsect_); 156 int bitrate_bps_ GUARDED_BY(critsect_);
156 int max_bitrate_kbps_ GUARDED_BY(critsect_); 157 int max_bitrate_kbps_ GUARDED_BY(critsect_);
157 158
158 int64_t time_last_update_us_ GUARDED_BY(critsect_); 159 int64_t time_last_update_us_ GUARDED_BY(critsect_);
159 160
160 std::unique_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_); 161 std::unique_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_);
161 uint64_t packet_counter_; 162 uint64_t packet_counter_;
162 }; 163 };
163 } // namespace webrtc 164 } // namespace webrtc
164 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_ 165 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698