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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
153 const AudioOptions& options) { | 153 const AudioOptions& options) { |
154 if (options.audio_network_adaptor && *options.audio_network_adaptor && | 154 if (options.audio_network_adaptor && *options.audio_network_adaptor && |
155 options.audio_network_adaptor_config) { | 155 options.audio_network_adaptor_config) { |
156 // Turn on audio network adaptor only when |options_.audio_network_adaptor| | 156 // Turn on audio network adaptor only when |options_.audio_network_adaptor| |
157 // equals true and |options_.audio_network_adaptor_config| has a value. | 157 // equals true and |options_.audio_network_adaptor_config| has a value. |
158 return options.audio_network_adaptor_config; | 158 return options.audio_network_adaptor_config; |
159 } | 159 } |
160 return rtc::Optional<std::string>(); | 160 return rtc::Optional<std::string>(); |
161 } | 161 } |
162 | 162 |
163 #ifdef HAVE_MEDIA | |
163 webrtc::AudioState::Config MakeAudioStateConfig( | 164 webrtc::AudioState::Config MakeAudioStateConfig( |
164 VoEWrapper* voe_wrapper, | 165 VoEWrapper* voe_wrapper, |
165 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) { | 166 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) { |
166 webrtc::AudioState::Config config; | 167 webrtc::AudioState::Config config; |
167 config.voice_engine = voe_wrapper->engine(); | 168 config.voice_engine = voe_wrapper->engine(); |
168 if (audio_mixer) { | 169 if (audio_mixer) { |
169 config.audio_mixer = audio_mixer; | 170 config.audio_mixer = audio_mixer; |
170 } else { | 171 } else { |
171 config.audio_mixer = webrtc::AudioMixerImpl::Create(); | 172 config.audio_mixer = webrtc::AudioMixerImpl::Create(); |
172 } | 173 } |
173 return config; | 174 return config; |
174 } | 175 } |
176 #endif | |
pthatcher1
2017/05/03 18:05:53
Would it be easier to just not include this file i
Zhi Huang
2017/05/04 01:08:03
Oh, I just realized that I've already excluded thi
| |
175 | 177 |
176 // |max_send_bitrate_bps| is the bitrate from "b=" in SDP. | 178 // |max_send_bitrate_bps| is the bitrate from "b=" in SDP. |
177 // |rtp_max_bitrate_bps| is the bitrate from RtpSender::SetParameters. | 179 // |rtp_max_bitrate_bps| is the bitrate from RtpSender::SetParameters. |
178 rtc::Optional<int> ComputeSendBitrate(int max_send_bitrate_bps, | 180 rtc::Optional<int> ComputeSendBitrate(int max_send_bitrate_bps, |
179 rtc::Optional<int> rtp_max_bitrate_bps, | 181 rtc::Optional<int> rtp_max_bitrate_bps, |
180 const webrtc::AudioCodecSpec& spec) { | 182 const webrtc::AudioCodecSpec& spec) { |
181 // If application-configured bitrate is set, take minimum of that and SDP | 183 // If application-configured bitrate is set, take minimum of that and SDP |
182 // bitrate. | 184 // bitrate. |
183 const int bps = rtp_max_bitrate_bps | 185 const int bps = rtp_max_bitrate_bps |
184 ? MinPositive(max_send_bitrate_bps, *rtp_max_bitrate_bps) | 186 ? MinPositive(max_send_bitrate_bps, *rtp_max_bitrate_bps) |
(...skipping 26 matching lines...) Expand all Loading... | |
211 WebRtcVoiceEngine::WebRtcVoiceEngine( | 213 WebRtcVoiceEngine::WebRtcVoiceEngine( |
212 webrtc::AudioDeviceModule* adm, | 214 webrtc::AudioDeviceModule* adm, |
213 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, | 215 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, |
214 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, | 216 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
215 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) | 217 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) |
216 : WebRtcVoiceEngine(adm, | 218 : WebRtcVoiceEngine(adm, |
217 encoder_factory, | 219 encoder_factory, |
218 decoder_factory, | 220 decoder_factory, |
219 audio_mixer, | 221 audio_mixer, |
220 new VoEWrapper()) { | 222 new VoEWrapper()) { |
223 #ifdef HAVE_MEDIA | |
221 audio_state_ = | 224 audio_state_ = |
222 webrtc::AudioState::Create(MakeAudioStateConfig(voe(), audio_mixer)); | 225 webrtc::AudioState::Create(MakeAudioStateConfig(voe(), audio_mixer)); |
226 #endif | |
223 } | 227 } |
224 | 228 |
225 WebRtcVoiceEngine::WebRtcVoiceEngine( | 229 WebRtcVoiceEngine::WebRtcVoiceEngine( |
226 webrtc::AudioDeviceModule* adm, | 230 webrtc::AudioDeviceModule* adm, |
227 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, | 231 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, |
228 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, | 232 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
229 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, | 233 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, |
230 VoEWrapper* voe_wrapper) | 234 VoEWrapper* voe_wrapper) |
231 : adm_(adm), | 235 : adm_(adm), |
232 encoder_factory_(encoder_factory), | 236 encoder_factory_(encoder_factory), |
(...skipping 2094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2327 ssrc); | 2331 ssrc); |
2328 if (it != unsignaled_recv_ssrcs_.end()) { | 2332 if (it != unsignaled_recv_ssrcs_.end()) { |
2329 unsignaled_recv_ssrcs_.erase(it); | 2333 unsignaled_recv_ssrcs_.erase(it); |
2330 return true; | 2334 return true; |
2331 } | 2335 } |
2332 return false; | 2336 return false; |
2333 } | 2337 } |
2334 } // namespace cricket | 2338 } // namespace cricket |
2335 | 2339 |
2336 #endif // HAVE_WEBRTC_VOICE | 2340 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |