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 11 matching lines...) Expand all Loading... |
22 active_(false) {} | 22 active_(false) {} |
23 | 23 |
24 PayloadRouter::~PayloadRouter() {} | 24 PayloadRouter::~PayloadRouter() {} |
25 | 25 |
26 size_t PayloadRouter::DefaultMaxPayloadLength() { | 26 size_t PayloadRouter::DefaultMaxPayloadLength() { |
27 const size_t kIpUdpSrtpLength = 44; | 27 const size_t kIpUdpSrtpLength = 44; |
28 return IP_PACKET_SIZE - kIpUdpSrtpLength; | 28 return IP_PACKET_SIZE - kIpUdpSrtpLength; |
29 } | 29 } |
30 | 30 |
31 void PayloadRouter::SetSendingRtpModules( | 31 void PayloadRouter::SetSendingRtpModules( |
32 const std::list<RtpRtcp*>& rtp_modules) { | 32 const std::vector<RtpRtcp*>& rtp_modules) { |
33 CriticalSectionScoped cs(crit_.get()); | 33 CriticalSectionScoped cs(crit_.get()); |
34 rtp_modules_.clear(); | 34 rtp_modules_ = rtp_modules; |
35 rtp_modules_.reserve(rtp_modules.size()); | |
36 for (auto* rtp_module : rtp_modules) { | |
37 rtp_modules_.push_back(rtp_module); | |
38 } | |
39 } | 35 } |
40 | 36 |
41 void PayloadRouter::set_active(bool active) { | 37 void PayloadRouter::set_active(bool active) { |
42 CriticalSectionScoped cs(crit_.get()); | 38 CriticalSectionScoped cs(crit_.get()); |
43 active_ = active; | 39 active_ = active; |
44 } | 40 } |
45 | 41 |
46 bool PayloadRouter::active() { | 42 bool PayloadRouter::active() { |
47 CriticalSectionScoped cs(crit_.get()); | 43 CriticalSectionScoped cs(crit_.get()); |
48 return active_ && !rtp_modules_.empty(); | 44 return active_ && !rtp_modules_.empty(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 CriticalSectionScoped cs(crit_.get()); | 88 CriticalSectionScoped cs(crit_.get()); |
93 for (auto* rtp_module : rtp_modules_) { | 89 for (auto* rtp_module : rtp_modules_) { |
94 size_t module_payload_length = rtp_module->MaxDataPayloadLength(); | 90 size_t module_payload_length = rtp_module->MaxDataPayloadLength(); |
95 if (module_payload_length < min_payload_length) | 91 if (module_payload_length < min_payload_length) |
96 min_payload_length = module_payload_length; | 92 min_payload_length = module_payload_length; |
97 } | 93 } |
98 return min_payload_length; | 94 return min_payload_length; |
99 } | 95 } |
100 | 96 |
101 } // namespace webrtc | 97 } // namespace webrtc |
OLD | NEW |