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