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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 bool PacketRouter::TimeToSendPacket(uint32_t ssrc, | 43 bool PacketRouter::TimeToSendPacket(uint32_t ssrc, |
44 uint16_t sequence_number, | 44 uint16_t sequence_number, |
45 int64_t capture_timestamp, | 45 int64_t capture_timestamp, |
46 bool retransmission, | 46 bool retransmission, |
47 int probe_cluster_id) { | 47 int probe_cluster_id) { |
48 RTC_DCHECK(pacer_thread_checker_.CalledOnValidThread()); | 48 RTC_DCHECK(pacer_thread_checker_.CalledOnValidThread()); |
49 rtc::CritScope cs(&modules_crit_); | 49 rtc::CritScope cs(&modules_crit_); |
50 for (auto* rtp_module : rtp_modules_) { | 50 for (auto* rtp_module : rtp_modules_) { |
51 if (rtp_module->SendingMedia() && ssrc == rtp_module->SSRC()) { | 51 if (rtp_module->SendingMedia() && ssrc == rtp_module->SSRC()) { |
52 return rtp_module->TimeToSendPacket(ssrc, sequence_number, | 52 return rtp_module->TimeToSendPacket(ssrc, sequence_number, |
53 capture_timestamp, retransmission); | 53 capture_timestamp, retransmission, |
| 54 probe_cluster_id); |
54 } | 55 } |
55 } | 56 } |
56 return true; | 57 return true; |
57 } | 58 } |
58 | 59 |
59 size_t PacketRouter::TimeToSendPadding(size_t bytes_to_send) { | 60 size_t PacketRouter::TimeToSendPadding(size_t bytes_to_send, |
| 61 int probe_cluster_id) { |
60 RTC_DCHECK(pacer_thread_checker_.CalledOnValidThread()); | 62 RTC_DCHECK(pacer_thread_checker_.CalledOnValidThread()); |
61 size_t total_bytes_sent = 0; | 63 size_t total_bytes_sent = 0; |
62 rtc::CritScope cs(&modules_crit_); | 64 rtc::CritScope cs(&modules_crit_); |
63 for (RtpRtcp* module : rtp_modules_) { | 65 for (RtpRtcp* module : rtp_modules_) { |
64 if (module->SendingMedia()) { | 66 if (module->SendingMedia()) { |
65 size_t bytes_sent = | 67 size_t bytes_sent = module->TimeToSendPadding( |
66 module->TimeToSendPadding(bytes_to_send - total_bytes_sent); | 68 bytes_to_send - total_bytes_sent, probe_cluster_id); |
67 total_bytes_sent += bytes_sent; | 69 total_bytes_sent += bytes_sent; |
68 if (total_bytes_sent >= bytes_to_send) | 70 if (total_bytes_sent >= bytes_to_send) |
69 break; | 71 break; |
70 } | 72 } |
71 } | 73 } |
72 return total_bytes_sent; | 74 return total_bytes_sent; |
73 } | 75 } |
74 | 76 |
75 void PacketRouter::SetTransportWideSequenceNumber(uint16_t sequence_number) { | 77 void PacketRouter::SetTransportWideSequenceNumber(uint16_t sequence_number) { |
76 rtc::AtomicOps::ReleaseStore(&transport_seq_, sequence_number); | 78 rtc::AtomicOps::ReleaseStore(&transport_seq_, sequence_number); |
(...skipping 21 matching lines...) Expand all Loading... |
98 rtc::CritScope cs(&modules_crit_); | 100 rtc::CritScope cs(&modules_crit_); |
99 for (auto* rtp_module : rtp_modules_) { | 101 for (auto* rtp_module : rtp_modules_) { |
100 packet->WithPacketSenderSsrc(rtp_module->SSRC()); | 102 packet->WithPacketSenderSsrc(rtp_module->SSRC()); |
101 if (rtp_module->SendFeedbackPacket(*packet)) | 103 if (rtp_module->SendFeedbackPacket(*packet)) |
102 return true; | 104 return true; |
103 } | 105 } |
104 return false; | 106 return false; |
105 } | 107 } |
106 | 108 |
107 } // namespace webrtc | 109 } // namespace webrtc |
OLD | NEW |