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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 ss << ", sync_group: " << sync_group; | 74 ss << ", sync_group: " << sync_group; |
75 } | 75 } |
76 ss << '}'; | 76 ss << '}'; |
77 return ss.str(); | 77 return ss.str(); |
78 } | 78 } |
79 | 79 |
80 namespace internal { | 80 namespace internal { |
81 AudioReceiveStream::AudioReceiveStream( | 81 AudioReceiveStream::AudioReceiveStream( |
82 CongestionController* congestion_controller, | 82 CongestionController* congestion_controller, |
83 const webrtc::AudioReceiveStream::Config& config, | 83 const webrtc::AudioReceiveStream::Config& config, |
84 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, | 84 const rtc::scoped_refptr<webrtc::AudioState>& audio_state) |
85 webrtc::RtcEventLog* event_log) | |
86 : config_(config), | 85 : config_(config), |
87 audio_state_(audio_state), | 86 audio_state_(audio_state), |
88 rtp_header_parser_(RtpHeaderParser::Create()) { | 87 rtp_header_parser_(RtpHeaderParser::Create()) { |
89 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString(); | 88 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString(); |
90 RTC_DCHECK_NE(config_.voe_channel_id, -1); | 89 RTC_DCHECK_NE(config_.voe_channel_id, -1); |
91 RTC_DCHECK(audio_state_.get()); | 90 RTC_DCHECK(audio_state_.get()); |
92 RTC_DCHECK(congestion_controller); | 91 RTC_DCHECK(congestion_controller); |
93 RTC_DCHECK(rtp_header_parser_); | 92 RTC_DCHECK(rtp_header_parser_); |
94 | 93 |
95 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); | 94 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); |
96 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); | 95 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); |
97 channel_proxy_->SetRtcEventLog(event_log); | |
98 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc); | 96 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc); |
99 // TODO(solenberg): Config NACK history window (which is a packet count), | 97 // TODO(solenberg): Config NACK history window (which is a packet count), |
100 // using the actual packet size for the configured codec. | 98 // using the actual packet size for the configured codec. |
101 channel_proxy_->SetNACKStatus(config_.rtp.nack.rtp_history_ms != 0, | 99 channel_proxy_->SetNACKStatus(config_.rtp.nack.rtp_history_ms != 0, |
102 config_.rtp.nack.rtp_history_ms / 20); | 100 config_.rtp.nack.rtp_history_ms / 20); |
103 | 101 |
104 // TODO(ossu): This is where we'd like to set the decoder factory to | 102 // TODO(ossu): This is where we'd like to set the decoder factory to |
105 // use. However, since it needs to be included when constructing Channel, we | 103 // use. However, since it needs to be included when constructing Channel, we |
106 // cannot do that until we're able to move Channel ownership into the | 104 // cannot do that until we're able to move Channel ownership into the |
107 // Audio{Send,Receive}Streams. The best we can do is check that we're not | 105 // Audio{Send,Receive}Streams. The best we can do is check that we're not |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 remote_bitrate_estimator_ = | 137 remote_bitrate_estimator_ = |
140 congestion_controller->GetRemoteBitrateEstimator(true); | 138 congestion_controller->GetRemoteBitrateEstimator(true); |
141 } | 139 } |
142 } | 140 } |
143 | 141 |
144 AudioReceiveStream::~AudioReceiveStream() { | 142 AudioReceiveStream::~AudioReceiveStream() { |
145 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 143 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
146 LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString(); | 144 LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString(); |
147 channel_proxy_->DeRegisterExternalTransport(); | 145 channel_proxy_->DeRegisterExternalTransport(); |
148 channel_proxy_->ResetCongestionControlObjects(); | 146 channel_proxy_->ResetCongestionControlObjects(); |
149 channel_proxy_->SetRtcEventLog(nullptr); | |
150 if (remote_bitrate_estimator_) { | 147 if (remote_bitrate_estimator_) { |
151 remote_bitrate_estimator_->RemoveStream(config_.rtp.remote_ssrc); | 148 remote_bitrate_estimator_->RemoveStream(config_.rtp.remote_ssrc); |
152 } | 149 } |
153 } | 150 } |
154 | 151 |
155 void AudioReceiveStream::Start() { | 152 void AudioReceiveStream::Start() { |
156 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 153 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
157 } | 154 } |
158 | 155 |
159 void AudioReceiveStream::Stop() { | 156 void AudioReceiveStream::Stop() { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 262 |
266 VoiceEngine* AudioReceiveStream::voice_engine() const { | 263 VoiceEngine* AudioReceiveStream::voice_engine() const { |
267 internal::AudioState* audio_state = | 264 internal::AudioState* audio_state = |
268 static_cast<internal::AudioState*>(audio_state_.get()); | 265 static_cast<internal::AudioState*>(audio_state_.get()); |
269 VoiceEngine* voice_engine = audio_state->voice_engine(); | 266 VoiceEngine* voice_engine = audio_state->voice_engine(); |
270 RTC_DCHECK(voice_engine); | 267 RTC_DCHECK(voice_engine); |
271 return voice_engine; | 268 return voice_engine; |
272 } | 269 } |
273 } // namespace internal | 270 } // namespace internal |
274 } // namespace webrtc | 271 } // namespace webrtc |
OLD | NEW |