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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 : config_(config), | 86 : config_(config), |
87 audio_state_(audio_state), | 87 audio_state_(audio_state), |
88 rtp_header_parser_(RtpHeaderParser::Create()) { | 88 rtp_header_parser_(RtpHeaderParser::Create()) { |
89 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString(); | 89 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString(); |
90 RTC_DCHECK_NE(config_.voe_channel_id, -1); | 90 RTC_DCHECK_NE(config_.voe_channel_id, -1); |
91 RTC_DCHECK(audio_state_.get()); | 91 RTC_DCHECK(audio_state_.get()); |
92 RTC_DCHECK(congestion_controller); | 92 RTC_DCHECK(congestion_controller); |
93 RTC_DCHECK(rtp_header_parser_); | 93 RTC_DCHECK(rtp_header_parser_); |
94 | 94 |
95 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); | 95 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); |
96 channel_proxy_ = | 96 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); |
97 rtc::UniqueToScoped(voe_impl->GetChannelProxy(config_.voe_channel_id)); | |
98 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc); | 97 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc); |
99 for (const auto& extension : config.rtp.extensions) { | 98 for (const auto& extension : config.rtp.extensions) { |
100 if (extension.name == RtpExtension::kAudioLevel) { | 99 if (extension.name == RtpExtension::kAudioLevel) { |
101 channel_proxy_->SetReceiveAudioLevelIndicationStatus(true, extension.id); | 100 channel_proxy_->SetReceiveAudioLevelIndicationStatus(true, extension.id); |
102 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension( | 101 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension( |
103 kRtpExtensionAudioLevel, extension.id); | 102 kRtpExtensionAudioLevel, extension.id); |
104 RTC_DCHECK(registered); | 103 RTC_DCHECK(registered); |
105 } else if (extension.name == RtpExtension::kAbsSendTime) { | 104 } else if (extension.name == RtpExtension::kAbsSendTime) { |
106 channel_proxy_->SetReceiveAbsoluteSenderTimeStatus(true, extension.id); | 105 channel_proxy_->SetReceiveAbsoluteSenderTimeStatus(true, extension.id); |
107 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension( | 106 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension( |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 stats.decoding_calls_to_silence_generator = ds.calls_to_silence_generator; | 221 stats.decoding_calls_to_silence_generator = ds.calls_to_silence_generator; |
223 stats.decoding_calls_to_neteq = ds.calls_to_neteq; | 222 stats.decoding_calls_to_neteq = ds.calls_to_neteq; |
224 stats.decoding_normal = ds.decoded_normal; | 223 stats.decoding_normal = ds.decoded_normal; |
225 stats.decoding_plc = ds.decoded_plc; | 224 stats.decoding_plc = ds.decoded_plc; |
226 stats.decoding_cng = ds.decoded_cng; | 225 stats.decoding_cng = ds.decoded_cng; |
227 stats.decoding_plc_cng = ds.decoded_plc_cng; | 226 stats.decoding_plc_cng = ds.decoded_plc_cng; |
228 | 227 |
229 return stats; | 228 return stats; |
230 } | 229 } |
231 | 230 |
232 void AudioReceiveStream::SetSink(rtc::scoped_ptr<AudioSinkInterface> sink) { | 231 void AudioReceiveStream::SetSink(std::unique_ptr<AudioSinkInterface> sink) { |
233 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 232 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
234 channel_proxy_->SetSink(rtc::ScopedToUnique(std::move(sink))); | 233 channel_proxy_->SetSink(std::move(sink)); |
235 } | 234 } |
236 | 235 |
237 const webrtc::AudioReceiveStream::Config& AudioReceiveStream::config() const { | 236 const webrtc::AudioReceiveStream::Config& AudioReceiveStream::config() const { |
238 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 237 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
239 return config_; | 238 return config_; |
240 } | 239 } |
241 | 240 |
242 VoiceEngine* AudioReceiveStream::voice_engine() const { | 241 VoiceEngine* AudioReceiveStream::voice_engine() const { |
243 internal::AudioState* audio_state = | 242 internal::AudioState* audio_state = |
244 static_cast<internal::AudioState*>(audio_state_.get()); | 243 static_cast<internal::AudioState*>(audio_state_.get()); |
245 VoiceEngine* voice_engine = audio_state->voice_engine(); | 244 VoiceEngine* voice_engine = audio_state->voice_engine(); |
246 RTC_DCHECK(voice_engine); | 245 RTC_DCHECK(voice_engine); |
247 return voice_engine; | 246 return voice_engine; |
248 } | 247 } |
249 } // namespace internal | 248 } // namespace internal |
250 } // namespace webrtc | 249 } // namespace webrtc |
OLD | NEW |