Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1413 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1413 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 1414 if (stream_) { | 1414 if (stream_) { |
| 1415 call_->DestroyAudioSendStream(stream_); | 1415 call_->DestroyAudioSendStream(stream_); |
| 1416 stream_ = nullptr; | 1416 stream_ = nullptr; |
| 1417 } | 1417 } |
| 1418 RTC_DCHECK(!stream_); | 1418 RTC_DCHECK(!stream_); |
| 1419 if (webrtc::field_trial::FindFullName("WebRTC-Audio-SendSideBwe") == | 1419 if (webrtc::field_trial::FindFullName("WebRTC-Audio-SendSideBwe") == |
| 1420 "Enabled") { | 1420 "Enabled") { |
| 1421 // TODO(mflodman): Keep testing this and set proper values. | 1421 // TODO(mflodman): Keep testing this and set proper values. |
| 1422 // Note: This is an early experiment currently only supported by Opus. | 1422 // Note: This is an early experiment currently only supported by Opus. |
| 1423 config_.min_bitrate_bps = kOpusMinBitrateBps; | 1423 if (webrtc::field_trial::FindFullName( |
| 1424 config_.max_bitrate_bps = kOpusBitrateFbBps; | 1424 "WebRTC-SendSideBwe-WithOverhead") == "Enabled") { |
| 1425 // TODO(michaelt): We should let the audio encoder decide which max/min | |
| 1426 // bitrate he would prefer. | |
|
minyue-webrtc
2017/01/10 22:16:19
he -> it
| |
| 1427 | |
| 1428 // OverheadPerPacket(58) = Ipv4(20B) + UDP(8B) + SRTP(10B) + RTP(12) | |
| 1429 // + RTP_ext(8); | |
| 1430 // kMaxOverheadBps = OverheadPerPacket * 8 * 1000ms / frame_length(20ms) | |
|
the sun
2017/01/09 15:03:55
nit: make the order
min
max
throughout the block.
michaelt
2017/01/09 15:56:57
Done.
| |
| 1431 // kMinOverheadBps = OverheadPerPacket * 8 * 1000ms / frame_length(60ms) | |
| 1432 constexpr int kMaxOverheadBps = 23200; | |
| 1433 constexpr int kMinOverheadBps = 7733; | |
| 1434 config_.min_bitrate_bps = kOpusMinBitrateBps + kMinOverheadBps; | |
| 1435 config_.max_bitrate_bps = kOpusBitrateFbBps + kMaxOverheadBps; | |
| 1436 } else { | |
| 1437 config_.min_bitrate_bps = kOpusMinBitrateBps; | |
| 1438 config_.max_bitrate_bps = kOpusBitrateFbBps; | |
| 1439 } | |
| 1425 } | 1440 } |
| 1426 stream_ = call_->CreateAudioSendStream(config_); | 1441 stream_ = call_->CreateAudioSendStream(config_); |
| 1427 RTC_CHECK(stream_); | 1442 RTC_CHECK(stream_); |
| 1428 UpdateSendState(); | 1443 UpdateSendState(); |
| 1429 } | 1444 } |
| 1430 | 1445 |
| 1431 rtc::ThreadChecker worker_thread_checker_; | 1446 rtc::ThreadChecker worker_thread_checker_; |
| 1432 rtc::RaceChecker audio_capture_race_checker_; | 1447 rtc::RaceChecker audio_capture_race_checker_; |
| 1433 webrtc::AudioTransport* const voe_audio_transport_ = nullptr; | 1448 webrtc::AudioTransport* const voe_audio_transport_ = nullptr; |
| 1434 webrtc::Call* call_ = nullptr; | 1449 webrtc::Call* call_ = nullptr; |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2638 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2653 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 2639 const auto it = send_streams_.find(ssrc); | 2654 const auto it = send_streams_.find(ssrc); |
| 2640 if (it != send_streams_.end()) { | 2655 if (it != send_streams_.end()) { |
| 2641 return it->second->channel(); | 2656 return it->second->channel(); |
| 2642 } | 2657 } |
| 2643 return -1; | 2658 return -1; |
| 2644 } | 2659 } |
| 2645 } // namespace cricket | 2660 } // namespace cricket |
| 2646 | 2661 |
| 2647 #endif // HAVE_WEBRTC_VOICE | 2662 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |