Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: webrtc/audio/audio_receive_stream.cc

Issue 2669463006: Move RemoteBitrateEstimator::RemoveStream calls from receive streams to Call. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 if (!sync_group.empty()) { 61 if (!sync_group.empty()) {
62 ss << ", sync_group: " << sync_group; 62 ss << ", sync_group: " << sync_group;
63 } 63 }
64 ss << '}'; 64 ss << '}';
65 return ss.str(); 65 return ss.str();
66 } 66 }
67 67
68 namespace internal { 68 namespace internal {
69 AudioReceiveStream::AudioReceiveStream( 69 AudioReceiveStream::AudioReceiveStream(
70 PacketRouter* packet_router, 70 PacketRouter* packet_router,
71 RemoteBitrateEstimator* remote_bitrate_estimator,
72 const webrtc::AudioReceiveStream::Config& config, 71 const webrtc::AudioReceiveStream::Config& config,
73 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, 72 const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
74 webrtc::RtcEventLog* event_log) 73 webrtc::RtcEventLog* event_log)
75 : remote_bitrate_estimator_(remote_bitrate_estimator), 74 : config_(config),
76 config_(config),
77 audio_state_(audio_state), 75 audio_state_(audio_state),
78 rtp_header_parser_(RtpHeaderParser::Create()) { 76 rtp_header_parser_(RtpHeaderParser::Create()) {
79 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString(); 77 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString();
80 RTC_DCHECK_NE(config_.voe_channel_id, -1); 78 RTC_DCHECK_NE(config_.voe_channel_id, -1);
81 RTC_DCHECK(audio_state_.get()); 79 RTC_DCHECK(audio_state_.get());
82 RTC_DCHECK(packet_router); 80 RTC_DCHECK(packet_router);
83 RTC_DCHECK(remote_bitrate_estimator);
84 RTC_DCHECK(rtp_header_parser_); 81 RTC_DCHECK(rtp_header_parser_);
85 82
86 module_process_thread_checker_.DetachFromThread(); 83 module_process_thread_checker_.DetachFromThread();
87 84
88 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); 85 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine());
89 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); 86 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id);
90 channel_proxy_->SetRtcEventLog(event_log); 87 channel_proxy_->SetRtcEventLog(event_log);
91 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc); 88 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc);
92 // TODO(solenberg): Config NACK history window (which is a packet count), 89 // TODO(solenberg): Config NACK history window (which is a packet count),
93 // using the actual packet size for the configured codec. 90 // using the actual packet size for the configured codec.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 AudioReceiveStream::~AudioReceiveStream() { 128 AudioReceiveStream::~AudioReceiveStream() {
132 RTC_DCHECK_RUN_ON(&worker_thread_checker_); 129 RTC_DCHECK_RUN_ON(&worker_thread_checker_);
133 LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString(); 130 LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString();
134 if (playing_) { 131 if (playing_) {
135 Stop(); 132 Stop();
136 } 133 }
137 channel_proxy_->DisassociateSendChannel(); 134 channel_proxy_->DisassociateSendChannel();
138 channel_proxy_->DeRegisterExternalTransport(); 135 channel_proxy_->DeRegisterExternalTransport();
139 channel_proxy_->ResetCongestionControlObjects(); 136 channel_proxy_->ResetCongestionControlObjects();
140 channel_proxy_->SetRtcEventLog(nullptr); 137 channel_proxy_->SetRtcEventLog(nullptr);
141 remote_bitrate_estimator_->RemoveStream(config_.rtp.remote_ssrc);
142 } 138 }
143 139
144 void AudioReceiveStream::Start() { 140 void AudioReceiveStream::Start() {
145 RTC_DCHECK_RUN_ON(&worker_thread_checker_); 141 RTC_DCHECK_RUN_ON(&worker_thread_checker_);
146 if (playing_) { 142 if (playing_) {
147 return; 143 return;
148 } 144 }
149 145
150 int error = SetVoiceEnginePlayout(true); 146 int error = SetVoiceEnginePlayout(true);
151 if (error != 0) { 147 if (error != 0) {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 int AudioReceiveStream::SetVoiceEnginePlayout(bool playout) { 349 int AudioReceiveStream::SetVoiceEnginePlayout(bool playout) {
354 ScopedVoEInterface<VoEBase> base(voice_engine()); 350 ScopedVoEInterface<VoEBase> base(voice_engine());
355 if (playout) { 351 if (playout) {
356 return base->StartPlayout(config_.voe_channel_id); 352 return base->StartPlayout(config_.voe_channel_id);
357 } else { 353 } else {
358 return base->StopPlayout(config_.voe_channel_id); 354 return base->StopPlayout(config_.voe_channel_id);
359 } 355 }
360 } 356 }
361 } // namespace internal 357 } // namespace internal
362 } // namespace webrtc 358 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698