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 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 RTC_DCHECK(signal_thread_checker_.CalledOnValidThread()); | 975 RTC_DCHECK(signal_thread_checker_.CalledOnValidThread()); |
976 return recv_codecs_; | 976 return recv_codecs_; |
977 } | 977 } |
978 | 978 |
979 RtpCapabilities WebRtcVoiceEngine::GetCapabilities() const { | 979 RtpCapabilities WebRtcVoiceEngine::GetCapabilities() const { |
980 RTC_DCHECK(signal_thread_checker_.CalledOnValidThread()); | 980 RTC_DCHECK(signal_thread_checker_.CalledOnValidThread()); |
981 RtpCapabilities capabilities; | 981 RtpCapabilities capabilities; |
982 capabilities.header_extensions.push_back( | 982 capabilities.header_extensions.push_back( |
983 webrtc::RtpExtension(webrtc::RtpExtension::kAudioLevelUri, | 983 webrtc::RtpExtension(webrtc::RtpExtension::kAudioLevelUri, |
984 webrtc::RtpExtension::kAudioLevelDefaultId)); | 984 webrtc::RtpExtension::kAudioLevelDefaultId)); |
985 if (webrtc::field_trial::FindFullName("WebRTC-Audio-SendSideBwe") == | 985 if (webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe")) { |
986 "Enabled") { | |
987 capabilities.header_extensions.push_back(webrtc::RtpExtension( | 986 capabilities.header_extensions.push_back(webrtc::RtpExtension( |
988 webrtc::RtpExtension::kTransportSequenceNumberUri, | 987 webrtc::RtpExtension::kTransportSequenceNumberUri, |
989 webrtc::RtpExtension::kTransportSequenceNumberDefaultId)); | 988 webrtc::RtpExtension::kTransportSequenceNumberDefaultId)); |
990 } | 989 } |
991 return capabilities; | 990 return capabilities; |
992 } | 991 } |
993 | 992 |
994 int WebRtcVoiceEngine::GetLastEngineError() { | 993 int WebRtcVoiceEngine::GetLastEngineError() { |
995 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 994 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
996 return voe_wrapper_->error(); | 995 return voe_wrapper_->error(); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 const std::string& c_name, | 1186 const std::string& c_name, |
1188 const webrtc::AudioSendStream::Config::SendCodecSpec& send_codec_spec, | 1187 const webrtc::AudioSendStream::Config::SendCodecSpec& send_codec_spec, |
1189 const std::vector<webrtc::RtpExtension>& extensions, | 1188 const std::vector<webrtc::RtpExtension>& extensions, |
1190 int max_send_bitrate_bps, | 1189 int max_send_bitrate_bps, |
1191 const rtc::Optional<std::string>& audio_network_adaptor_config, | 1190 const rtc::Optional<std::string>& audio_network_adaptor_config, |
1192 webrtc::Call* call, | 1191 webrtc::Call* call, |
1193 webrtc::Transport* send_transport) | 1192 webrtc::Transport* send_transport) |
1194 : voe_audio_transport_(voe_audio_transport), | 1193 : voe_audio_transport_(voe_audio_transport), |
1195 call_(call), | 1194 call_(call), |
1196 config_(send_transport), | 1195 config_(send_transport), |
1197 send_side_bwe_with_overhead_(webrtc::field_trial::FindFullName( | 1196 send_side_bwe_with_overhead_( |
1198 "WebRTC-SendSideBwe-WithOverhead") == "Enabled"), | 1197 webrtc::field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")), |
1199 max_send_bitrate_bps_(max_send_bitrate_bps), | 1198 max_send_bitrate_bps_(max_send_bitrate_bps), |
1200 rtp_parameters_(CreateRtpParametersWithOneEncoding()) { | 1199 rtp_parameters_(CreateRtpParametersWithOneEncoding()) { |
1201 RTC_DCHECK_GE(ch, 0); | 1200 RTC_DCHECK_GE(ch, 0); |
1202 // TODO(solenberg): Once we're not using FakeWebRtcVoiceEngine anymore: | 1201 // TODO(solenberg): Once we're not using FakeWebRtcVoiceEngine anymore: |
1203 // RTC_DCHECK(voe_audio_transport); | 1202 // RTC_DCHECK(voe_audio_transport); |
1204 RTC_DCHECK(call); | 1203 RTC_DCHECK(call); |
1205 config_.rtp.ssrc = ssrc; | 1204 config_.rtp.ssrc = ssrc; |
1206 config_.rtp.c_name = c_name; | 1205 config_.rtp.c_name = c_name; |
1207 config_.voe_channel_id = ch; | 1206 config_.voe_channel_id = ch; |
1208 config_.rtp.extensions = extensions; | 1207 config_.rtp.extensions = extensions; |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 } | 1414 } |
1416 } | 1415 } |
1417 | 1416 |
1418 void RecreateAudioSendStream() { | 1417 void RecreateAudioSendStream() { |
1419 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1418 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1420 if (stream_) { | 1419 if (stream_) { |
1421 call_->DestroyAudioSendStream(stream_); | 1420 call_->DestroyAudioSendStream(stream_); |
1422 stream_ = nullptr; | 1421 stream_ = nullptr; |
1423 } | 1422 } |
1424 RTC_DCHECK(!stream_); | 1423 RTC_DCHECK(!stream_); |
1425 if (webrtc::field_trial::FindFullName("WebRTC-Audio-SendSideBwe") == | 1424 if (webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe")) { |
1426 "Enabled") { | |
1427 config_.min_bitrate_bps = kOpusMinBitrateBps; | 1425 config_.min_bitrate_bps = kOpusMinBitrateBps; |
1428 config_.max_bitrate_bps = kOpusBitrateFbBps; | 1426 config_.max_bitrate_bps = kOpusBitrateFbBps; |
1429 // TODO(mflodman): Keep testing this and set proper values. | 1427 // TODO(mflodman): Keep testing this and set proper values. |
1430 // Note: This is an early experiment currently only supported by Opus. | 1428 // Note: This is an early experiment currently only supported by Opus. |
1431 if (send_side_bwe_with_overhead_) { | 1429 if (send_side_bwe_with_overhead_) { |
1432 auto packet_sizes_ms = WebRtcVoiceCodecs::GetPacketSizesMs( | 1430 auto packet_sizes_ms = WebRtcVoiceCodecs::GetPacketSizesMs( |
1433 config_.send_codec_spec.codec_inst); | 1431 config_.send_codec_spec.codec_inst); |
1434 if (!packet_sizes_ms.empty()) { | 1432 if (!packet_sizes_ms.empty()) { |
1435 int max_packet_size_ms = | 1433 int max_packet_size_ms = |
1436 *std::max_element(packet_sizes_ms.begin(), packet_sizes_ms.end()); | 1434 *std::max_element(packet_sizes_ms.begin(), packet_sizes_ms.end()); |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2662 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2660 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
2663 const auto it = send_streams_.find(ssrc); | 2661 const auto it = send_streams_.find(ssrc); |
2664 if (it != send_streams_.end()) { | 2662 if (it != send_streams_.end()) { |
2665 return it->second->channel(); | 2663 return it->second->channel(); |
2666 } | 2664 } |
2667 return -1; | 2665 return -1; |
2668 } | 2666 } |
2669 } // namespace cricket | 2667 } // namespace cricket |
2670 | 2668 |
2671 #endif // HAVE_WEBRTC_VOICE | 2669 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |