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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 // TODO(solenberg): Tests call this function on a network thread, libjingle | 298 // TODO(solenberg): Tests call this function on a network thread, libjingle |
299 // calls on the worker thread. We should move towards always using a network | 299 // calls on the worker thread. We should move towards always using a network |
300 // thread. Then this check can be enabled. | 300 // thread. Then this check can be enabled. |
301 // RTC_DCHECK(!worker_thread_checker_.CalledOnValidThread()); | 301 // RTC_DCHECK(!worker_thread_checker_.CalledOnValidThread()); |
302 return channel_proxy_->ReceivedRTCPPacket(packet, length); | 302 return channel_proxy_->ReceivedRTCPPacket(packet, length); |
303 } | 303 } |
304 | 304 |
305 uint32_t AudioSendStream::OnBitrateUpdated(uint32_t bitrate_bps, | 305 uint32_t AudioSendStream::OnBitrateUpdated(uint32_t bitrate_bps, |
306 uint8_t fraction_loss, | 306 uint8_t fraction_loss, |
307 int64_t rtt, | 307 int64_t rtt, |
308 int64_t probing_interval_ms) { | 308 int64_t bwe_period_ms) { |
309 // A send stream may be allocated a bitrate of zero if the allocator decides | 309 // A send stream may be allocated a bitrate of zero if the allocator decides |
310 // to disable it. For now we ignore this decision and keep sending on min | 310 // to disable it. For now we ignore this decision and keep sending on min |
311 // bitrate. | 311 // bitrate. |
312 if (bitrate_bps == 0) { | 312 if (bitrate_bps == 0) { |
313 bitrate_bps = config_.min_bitrate_bps; | 313 bitrate_bps = config_.min_bitrate_bps; |
314 } | 314 } |
315 RTC_DCHECK_GE(bitrate_bps, | 315 RTC_DCHECK_GE(bitrate_bps, |
316 static_cast<uint32_t>(config_.min_bitrate_bps)); | 316 static_cast<uint32_t>(config_.min_bitrate_bps)); |
317 // The bitrate allocator might allocate an higher than max configured bitrate | 317 // The bitrate allocator might allocate an higher than max configured bitrate |
318 // if there is room, to allow for, as example, extra FEC. Ignore that for now. | 318 // if there is room, to allow for, as example, extra FEC. Ignore that for now. |
319 const uint32_t max_bitrate_bps = config_.max_bitrate_bps; | 319 const uint32_t max_bitrate_bps = config_.max_bitrate_bps; |
320 if (bitrate_bps > max_bitrate_bps) | 320 if (bitrate_bps > max_bitrate_bps) |
321 bitrate_bps = max_bitrate_bps; | 321 bitrate_bps = max_bitrate_bps; |
322 | 322 |
323 channel_proxy_->SetBitrate(bitrate_bps, probing_interval_ms); | 323 channel_proxy_->SetBitrate(bitrate_bps, bwe_period_ms); |
324 | 324 |
325 // The amount of audio protection is not exposed by the encoder, hence | 325 // The amount of audio protection is not exposed by the encoder, hence |
326 // always returning 0. | 326 // always returning 0. |
327 return 0; | 327 return 0; |
328 } | 328 } |
329 | 329 |
330 void AudioSendStream::OnPacketAdded(uint32_t ssrc, uint16_t seq_num) { | 330 void AudioSendStream::OnPacketAdded(uint32_t ssrc, uint16_t seq_num) { |
331 RTC_DCHECK(pacer_thread_checker_.CalledOnValidThread()); | 331 RTC_DCHECK(pacer_thread_checker_.CalledOnValidThread()); |
332 // Only packets that belong to this stream are of interest. | 332 // Only packets that belong to this stream are of interest. |
333 if (ssrc == config_.rtp.ssrc) { | 333 if (ssrc == config_.rtp.ssrc) { |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 if (rtpRtcpModule->RegisterSendPayload(codec) != 0) { | 597 if (rtpRtcpModule->RegisterSendPayload(codec) != 0) { |
598 LOG(LS_ERROR) << "RegisterCngPayloadType() failed to register CN to " | 598 LOG(LS_ERROR) << "RegisterCngPayloadType() failed to register CN to " |
599 "RTP/RTCP module"; | 599 "RTP/RTCP module"; |
600 } | 600 } |
601 } | 601 } |
602 } | 602 } |
603 | 603 |
604 | 604 |
605 } // namespace internal | 605 } // namespace internal |
606 } // namespace webrtc | 606 } // namespace webrtc |
OLD | NEW |