henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | /* |
| 2 | * libjingle |
| 3 | * Copyright 2012 Google Inc. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions are met: |
| 7 | * |
| 8 | * 1. Redistributions of source code must retain the above copyright notice, |
| 9 | * this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| 11 | * this list of conditions and the following disclaimer in the documentation |
| 12 | * and/or other materials provided with the distribution. |
| 13 | * 3. The name of the author may not be used to endorse or promote products |
| 14 | * derived from this software without specific prior written permission. |
| 15 | * |
| 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
| 19 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 21 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 22 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 24 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 25 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | */ |
| 27 | |
| 28 | #include "talk/media/base/rtpdataengine.h" |
| 29 | |
buildbot@webrtc.org | a09a999 | 2014-08-13 17:26:08 +0000 | [diff] [blame] | 30 | #include "talk/media/base/codec.h" |
| 31 | #include "talk/media/base/constants.h" |
| 32 | #include "talk/media/base/rtputils.h" |
| 33 | #include "talk/media/base/streamparams.h" |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 34 | #include "webrtc/base/buffer.h" |
| 35 | #include "webrtc/base/helpers.h" |
| 36 | #include "webrtc/base/logging.h" |
| 37 | #include "webrtc/base/ratelimiter.h" |
| 38 | #include "webrtc/base/timing.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 39 | |
| 40 | namespace cricket { |
| 41 | |
| 42 | // We want to avoid IP fragmentation. |
| 43 | static const size_t kDataMaxRtpPacketLen = 1200U; |
| 44 | // We reserve space after the RTP header for future wiggle room. |
| 45 | static const unsigned char kReservedSpace[] = { |
| 46 | 0x00, 0x00, 0x00, 0x00 |
| 47 | }; |
| 48 | |
| 49 | // Amount of overhead SRTP may take. We need to leave room in the |
| 50 | // buffer for it, otherwise SRTP will fail later. If SRTP ever uses |
| 51 | // more than this, we need to increase this number. |
| 52 | static const size_t kMaxSrtpHmacOverhead = 16; |
| 53 | |
| 54 | RtpDataEngine::RtpDataEngine() { |
| 55 | data_codecs_.push_back( |
| 56 | DataCodec(kGoogleRtpDataCodecId, |
| 57 | kGoogleRtpDataCodecName, 0)); |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 58 | SetTiming(new rtc::Timing()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | DataMediaChannel* RtpDataEngine::CreateChannel( |
| 62 | DataChannelType data_channel_type) { |
| 63 | if (data_channel_type != DCT_RTP) { |
| 64 | return NULL; |
| 65 | } |
| 66 | return new RtpDataMediaChannel(timing_.get()); |
| 67 | } |
| 68 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 69 | bool FindCodecByName(const std::vector<DataCodec>& codecs, |
| 70 | const std::string& name, DataCodec* codec_out) { |
| 71 | std::vector<DataCodec>::const_iterator iter; |
| 72 | for (iter = codecs.begin(); iter != codecs.end(); ++iter) { |
| 73 | if (iter->name == name) { |
| 74 | *codec_out = *iter; |
| 75 | return true; |
| 76 | } |
| 77 | } |
| 78 | return false; |
| 79 | } |
| 80 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 81 | RtpDataMediaChannel::RtpDataMediaChannel(rtc::Timing* timing) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 82 | Construct(timing); |
| 83 | } |
| 84 | |
| 85 | RtpDataMediaChannel::RtpDataMediaChannel() { |
| 86 | Construct(NULL); |
| 87 | } |
| 88 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 89 | void RtpDataMediaChannel::Construct(rtc::Timing* timing) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 90 | sending_ = false; |
| 91 | receiving_ = false; |
| 92 | timing_ = timing; |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 93 | send_limiter_.reset(new rtc::RateLimiter(kDataMaxBandwidth / 8, 1.0)); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | |
| 97 | RtpDataMediaChannel::~RtpDataMediaChannel() { |
| 98 | std::map<uint32, RtpClock*>::const_iterator iter; |
| 99 | for (iter = rtp_clock_by_send_ssrc_.begin(); |
| 100 | iter != rtp_clock_by_send_ssrc_.end(); |
| 101 | ++iter) { |
| 102 | delete iter->second; |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | void RtpClock::Tick( |
| 107 | double now, int* seq_num, uint32* timestamp) { |
| 108 | *seq_num = ++last_seq_num_; |
| 109 | *timestamp = timestamp_offset_ + static_cast<uint32>(now * clockrate_); |
| 110 | } |
| 111 | |
| 112 | const DataCodec* FindUnknownCodec(const std::vector<DataCodec>& codecs) { |
| 113 | DataCodec data_codec(kGoogleRtpDataCodecId, kGoogleRtpDataCodecName, 0); |
| 114 | std::vector<DataCodec>::const_iterator iter; |
| 115 | for (iter = codecs.begin(); iter != codecs.end(); ++iter) { |
| 116 | if (!iter->Matches(data_codec)) { |
| 117 | return &(*iter); |
| 118 | } |
| 119 | } |
| 120 | return NULL; |
| 121 | } |
| 122 | |
| 123 | const DataCodec* FindKnownCodec(const std::vector<DataCodec>& codecs) { |
| 124 | DataCodec data_codec(kGoogleRtpDataCodecId, kGoogleRtpDataCodecName, 0); |
| 125 | std::vector<DataCodec>::const_iterator iter; |
| 126 | for (iter = codecs.begin(); iter != codecs.end(); ++iter) { |
| 127 | if (iter->Matches(data_codec)) { |
| 128 | return &(*iter); |
| 129 | } |
| 130 | } |
| 131 | return NULL; |
| 132 | } |
| 133 | |
| 134 | bool RtpDataMediaChannel::SetRecvCodecs(const std::vector<DataCodec>& codecs) { |
| 135 | const DataCodec* unknown_codec = FindUnknownCodec(codecs); |
| 136 | if (unknown_codec) { |
| 137 | LOG(LS_WARNING) << "Failed to SetRecvCodecs because of unknown codec: " |
| 138 | << unknown_codec->ToString(); |
| 139 | return false; |
| 140 | } |
| 141 | |
| 142 | recv_codecs_ = codecs; |
| 143 | return true; |
| 144 | } |
| 145 | |
| 146 | bool RtpDataMediaChannel::SetSendCodecs(const std::vector<DataCodec>& codecs) { |
| 147 | const DataCodec* known_codec = FindKnownCodec(codecs); |
| 148 | if (!known_codec) { |
| 149 | LOG(LS_WARNING) << |
| 150 | "Failed to SetSendCodecs because there is no known codec."; |
| 151 | return false; |
| 152 | } |
| 153 | |
| 154 | send_codecs_ = codecs; |
| 155 | return true; |
| 156 | } |
| 157 | |
| 158 | bool RtpDataMediaChannel::AddSendStream(const StreamParams& stream) { |
| 159 | if (!stream.has_ssrcs()) { |
| 160 | return false; |
| 161 | } |
| 162 | |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 163 | if (GetStreamBySsrc(send_streams_, stream.first_ssrc())) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 164 | LOG(LS_WARNING) << "Not adding data send stream '" << stream.id |
| 165 | << "' with ssrc=" << stream.first_ssrc() |
| 166 | << " because stream already exists."; |
| 167 | return false; |
| 168 | } |
| 169 | |
| 170 | send_streams_.push_back(stream); |
| 171 | // TODO(pthatcher): This should be per-stream, not per-ssrc. |
| 172 | // And we should probably allow more than one per stream. |
| 173 | rtp_clock_by_send_ssrc_[stream.first_ssrc()] = new RtpClock( |
| 174 | kDataCodecClockrate, |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 175 | rtc::CreateRandomNonZeroId(), rtc::CreateRandomNonZeroId()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 176 | |
| 177 | LOG(LS_INFO) << "Added data send stream '" << stream.id |
| 178 | << "' with ssrc=" << stream.first_ssrc(); |
| 179 | return true; |
| 180 | } |
| 181 | |
| 182 | bool RtpDataMediaChannel::RemoveSendStream(uint32 ssrc) { |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 183 | if (!GetStreamBySsrc(send_streams_, ssrc)) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 184 | return false; |
| 185 | } |
| 186 | |
| 187 | RemoveStreamBySsrc(&send_streams_, ssrc); |
| 188 | delete rtp_clock_by_send_ssrc_[ssrc]; |
| 189 | rtp_clock_by_send_ssrc_.erase(ssrc); |
| 190 | return true; |
| 191 | } |
| 192 | |
| 193 | bool RtpDataMediaChannel::AddRecvStream(const StreamParams& stream) { |
| 194 | if (!stream.has_ssrcs()) { |
| 195 | return false; |
| 196 | } |
| 197 | |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 198 | if (GetStreamBySsrc(recv_streams_, stream.first_ssrc())) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 199 | LOG(LS_WARNING) << "Not adding data recv stream '" << stream.id |
| 200 | << "' with ssrc=" << stream.first_ssrc() |
| 201 | << " because stream already exists."; |
| 202 | return false; |
| 203 | } |
| 204 | |
| 205 | recv_streams_.push_back(stream); |
| 206 | LOG(LS_INFO) << "Added data recv stream '" << stream.id |
| 207 | << "' with ssrc=" << stream.first_ssrc(); |
| 208 | return true; |
| 209 | } |
| 210 | |
| 211 | bool RtpDataMediaChannel::RemoveRecvStream(uint32 ssrc) { |
| 212 | RemoveStreamBySsrc(&recv_streams_, ssrc); |
| 213 | return true; |
| 214 | } |
| 215 | |
wu@webrtc.org | a989080 | 2013-12-13 00:21:03 +0000 | [diff] [blame] | 216 | void RtpDataMediaChannel::OnPacketReceived( |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 217 | rtc::Buffer* packet, const rtc::PacketTime& packet_time) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 218 | RtpHeader header; |
kwiberg@webrtc.org | eebcab5 | 2015-03-24 09:19:06 +0000 | [diff] [blame^] | 219 | if (!GetRtpHeader(packet->data(), packet->size(), &header)) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 220 | // Don't want to log for every corrupt packet. |
| 221 | // LOG(LS_WARNING) << "Could not read rtp header from packet of length " |
| 222 | // << packet->length() << "."; |
| 223 | return; |
| 224 | } |
| 225 | |
| 226 | size_t header_length; |
kwiberg@webrtc.org | eebcab5 | 2015-03-24 09:19:06 +0000 | [diff] [blame^] | 227 | if (!GetRtpHeaderLen(packet->data(), packet->size(), &header_length)) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 228 | // Don't want to log for every corrupt packet. |
| 229 | // LOG(LS_WARNING) << "Could not read rtp header" |
| 230 | // << length from packet of length " |
| 231 | // << packet->length() << "."; |
| 232 | return; |
| 233 | } |
| 234 | const char* data = packet->data() + header_length + sizeof(kReservedSpace); |
kwiberg@webrtc.org | eebcab5 | 2015-03-24 09:19:06 +0000 | [diff] [blame^] | 235 | size_t data_len = packet->size() - header_length - sizeof(kReservedSpace); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 236 | |
| 237 | if (!receiving_) { |
| 238 | LOG(LS_WARNING) << "Not receiving packet " |
| 239 | << header.ssrc << ":" << header.seq_num |
| 240 | << " before SetReceive(true) called."; |
| 241 | return; |
| 242 | } |
| 243 | |
| 244 | DataCodec codec; |
| 245 | if (!FindCodecById(recv_codecs_, header.payload_type, &codec)) { |
sergeyu@chromium.org | 5bc25c4 | 2013-12-05 00:24:06 +0000 | [diff] [blame] | 246 | // For bundling, this will be logged for every message. |
| 247 | // So disable this logging. |
| 248 | // LOG(LS_WARNING) << "Not receiving packet " |
| 249 | // << header.ssrc << ":" << header.seq_num |
| 250 | // << " (" << data_len << ")" |
| 251 | // << " because unknown payload id: " << header.payload_type; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 252 | return; |
| 253 | } |
| 254 | |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 255 | if (!GetStreamBySsrc(recv_streams_, header.ssrc)) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 256 | LOG(LS_WARNING) << "Received packet for unknown ssrc: " << header.ssrc; |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | // Uncomment this for easy debugging. |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 261 | // const auto* found_stream = GetStreamBySsrc(recv_streams_, header.ssrc); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 262 | // LOG(LS_INFO) << "Received packet" |
| 263 | // << " groupid=" << found_stream.groupid |
| 264 | // << ", ssrc=" << header.ssrc |
| 265 | // << ", seqnum=" << header.seq_num |
| 266 | // << ", timestamp=" << header.timestamp |
| 267 | // << ", len=" << data_len; |
| 268 | |
| 269 | ReceiveDataParams params; |
| 270 | params.ssrc = header.ssrc; |
| 271 | params.seq_num = header.seq_num; |
| 272 | params.timestamp = header.timestamp; |
| 273 | SignalDataReceived(params, data, data_len); |
| 274 | } |
| 275 | |
sergeyu@chromium.org | 4b26e2e | 2014-01-15 23:15:54 +0000 | [diff] [blame] | 276 | bool RtpDataMediaChannel::SetMaxSendBandwidth(int bps) { |
| 277 | if (bps <= 0) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 278 | bps = kDataMaxBandwidth; |
| 279 | } |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 280 | send_limiter_.reset(new rtc::RateLimiter(bps / 8, 1.0)); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 281 | LOG(LS_INFO) << "RtpDataMediaChannel::SetSendBandwidth to " << bps << "bps."; |
| 282 | return true; |
| 283 | } |
| 284 | |
| 285 | bool RtpDataMediaChannel::SendData( |
| 286 | const SendDataParams& params, |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 287 | const rtc::Buffer& payload, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 288 | SendDataResult* result) { |
| 289 | if (result) { |
| 290 | // If we return true, we'll set this to SDR_SUCCESS. |
| 291 | *result = SDR_ERROR; |
| 292 | } |
| 293 | if (!sending_) { |
| 294 | LOG(LS_WARNING) << "Not sending packet with ssrc=" << params.ssrc |
kwiberg@webrtc.org | eebcab5 | 2015-03-24 09:19:06 +0000 | [diff] [blame^] | 295 | << " len=" << payload.size() << " before SetSend(true)."; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 296 | return false; |
| 297 | } |
| 298 | |
| 299 | if (params.type != cricket::DMT_TEXT) { |
| 300 | LOG(LS_WARNING) << "Not sending data because binary type is unsupported."; |
| 301 | return false; |
| 302 | } |
| 303 | |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 304 | const StreamParams* found_stream = |
| 305 | GetStreamBySsrc(send_streams_, params.ssrc); |
| 306 | if (!found_stream) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 307 | LOG(LS_WARNING) << "Not sending data because ssrc is unknown: " |
| 308 | << params.ssrc; |
| 309 | return false; |
| 310 | } |
| 311 | |
| 312 | DataCodec found_codec; |
| 313 | if (!FindCodecByName(send_codecs_, kGoogleRtpDataCodecName, &found_codec)) { |
| 314 | LOG(LS_WARNING) << "Not sending data because codec is unknown: " |
| 315 | << kGoogleRtpDataCodecName; |
| 316 | return false; |
| 317 | } |
| 318 | |
kwiberg@webrtc.org | eebcab5 | 2015-03-24 09:19:06 +0000 | [diff] [blame^] | 319 | size_t packet_len = (kMinRtpPacketLen + sizeof(kReservedSpace) + |
| 320 | payload.size() + kMaxSrtpHmacOverhead); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 321 | if (packet_len > kDataMaxRtpPacketLen) { |
| 322 | return false; |
| 323 | } |
| 324 | |
| 325 | double now = timing_->TimerNow(); |
| 326 | |
| 327 | if (!send_limiter_->CanUse(packet_len, now)) { |
| 328 | LOG(LS_VERBOSE) << "Dropped data packet of len=" << packet_len |
| 329 | << "; already sent " << send_limiter_->used_in_period() |
| 330 | << "/" << send_limiter_->max_per_period(); |
| 331 | return false; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 332 | } |
| 333 | |
| 334 | RtpHeader header; |
| 335 | header.payload_type = found_codec.id; |
| 336 | header.ssrc = params.ssrc; |
| 337 | rtp_clock_by_send_ssrc_[header.ssrc]->Tick( |
| 338 | now, &header.seq_num, &header.timestamp); |
| 339 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 340 | rtc::Buffer packet; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 341 | packet.SetCapacity(packet_len); |
kwiberg@webrtc.org | eebcab5 | 2015-03-24 09:19:06 +0000 | [diff] [blame^] | 342 | packet.SetSize(kMinRtpPacketLen); |
| 343 | if (!SetRtpHeader(packet.data(), packet.size(), header)) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 344 | return false; |
| 345 | } |
| 346 | packet.AppendData(&kReservedSpace, sizeof(kReservedSpace)); |
kwiberg@webrtc.org | eebcab5 | 2015-03-24 09:19:06 +0000 | [diff] [blame^] | 347 | packet.AppendData(payload.data(), payload.size()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 348 | |
mallinath@webrtc.org | a27be8e | 2013-09-27 23:04:10 +0000 | [diff] [blame] | 349 | LOG(LS_VERBOSE) << "Sent RTP data packet: " |
kwiberg@webrtc.org | eebcab5 | 2015-03-24 09:19:06 +0000 | [diff] [blame^] | 350 | << " stream=" << found_stream->id << " ssrc=" << header.ssrc |
mallinath@webrtc.org | a27be8e | 2013-09-27 23:04:10 +0000 | [diff] [blame] | 351 | << ", seqnum=" << header.seq_num |
| 352 | << ", timestamp=" << header.timestamp |
kwiberg@webrtc.org | eebcab5 | 2015-03-24 09:19:06 +0000 | [diff] [blame^] | 353 | << ", len=" << payload.size(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 354 | |
henrike@webrtc.org | 1e09a71 | 2013-07-26 19:17:59 +0000 | [diff] [blame] | 355 | MediaChannel::SendPacket(&packet); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 356 | send_limiter_->Use(packet_len, now); |
| 357 | if (result) { |
| 358 | *result = SDR_SUCCESS; |
| 359 | } |
| 360 | return true; |
| 361 | } |
| 362 | |
| 363 | } // namespace cricket |