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

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

Issue 1748403002: Move RtcEventLog object from inside VoiceEngine to Call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: More fixes for bots. Created 4 years, 8 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 ss << ", sync_group: " << sync_group; 75 ss << ", sync_group: " << sync_group;
76 } 76 }
77 ss << '}'; 77 ss << '}';
78 return ss.str(); 78 return ss.str();
79 } 79 }
80 80
81 namespace internal { 81 namespace internal {
82 AudioReceiveStream::AudioReceiveStream( 82 AudioReceiveStream::AudioReceiveStream(
83 CongestionController* congestion_controller, 83 CongestionController* congestion_controller,
84 const webrtc::AudioReceiveStream::Config& config, 84 const webrtc::AudioReceiveStream::Config& config,
85 const rtc::scoped_refptr<webrtc::AudioState>& audio_state) 85 const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
86 webrtc::RtcEventLog* event_log)
86 : config_(config), 87 : config_(config),
87 audio_state_(audio_state), 88 audio_state_(audio_state),
88 rtp_header_parser_(RtpHeaderParser::Create()) { 89 rtp_header_parser_(RtpHeaderParser::Create()) {
89 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString(); 90 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString();
90 RTC_DCHECK_NE(config_.voe_channel_id, -1); 91 RTC_DCHECK_NE(config_.voe_channel_id, -1);
91 RTC_DCHECK(audio_state_.get()); 92 RTC_DCHECK(audio_state_.get());
92 RTC_DCHECK(congestion_controller); 93 RTC_DCHECK(congestion_controller);
93 RTC_DCHECK(rtp_header_parser_); 94 RTC_DCHECK(rtp_header_parser_);
94 95
95 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); 96 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine());
96 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); 97 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id);
98 channel_proxy_->SetRtcEventLog(event_log);
tommi 2016/04/04 14:26:47 how is ownership and lifetime of |event_log| manag
ivoc 2016/04/05 08:02:58 |event_log| is a member of Call, which should outl
tommi 2016/04/07 13:21:53 As a pattern, I think it's one to avoid if we can
97 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc); 99 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc);
98 for (const auto& extension : config.rtp.extensions) { 100 for (const auto& extension : config.rtp.extensions) {
99 if (extension.name == RtpExtension::kAudioLevel) { 101 if (extension.name == RtpExtension::kAudioLevel) {
100 channel_proxy_->SetReceiveAudioLevelIndicationStatus(true, extension.id); 102 channel_proxy_->SetReceiveAudioLevelIndicationStatus(true, extension.id);
101 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension( 103 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension(
102 kRtpExtensionAudioLevel, extension.id); 104 kRtpExtensionAudioLevel, extension.id);
103 RTC_DCHECK(registered); 105 RTC_DCHECK(registered);
104 } else if (extension.name == RtpExtension::kAbsSendTime) { 106 } else if (extension.name == RtpExtension::kAbsSendTime) {
105 channel_proxy_->SetReceiveAbsoluteSenderTimeStatus(true, extension.id); 107 channel_proxy_->SetReceiveAbsoluteSenderTimeStatus(true, extension.id);
106 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension( 108 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension(
(...skipping 14 matching lines...) Expand all
121 if (UseSendSideBwe(config)) { 123 if (UseSendSideBwe(config)) {
122 remote_bitrate_estimator_ = 124 remote_bitrate_estimator_ =
123 congestion_controller->GetRemoteBitrateEstimator(true); 125 congestion_controller->GetRemoteBitrateEstimator(true);
124 } 126 }
125 } 127 }
126 128
127 AudioReceiveStream::~AudioReceiveStream() { 129 AudioReceiveStream::~AudioReceiveStream() {
128 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 130 RTC_DCHECK(thread_checker_.CalledOnValidThread());
129 LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString(); 131 LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString();
130 channel_proxy_->ResetCongestionControlObjects(); 132 channel_proxy_->ResetCongestionControlObjects();
133 channel_proxy_->SetRtcEventLog(nullptr);
131 if (remote_bitrate_estimator_) { 134 if (remote_bitrate_estimator_) {
132 remote_bitrate_estimator_->RemoveStream(config_.rtp.remote_ssrc); 135 remote_bitrate_estimator_->RemoveStream(config_.rtp.remote_ssrc);
133 } 136 }
134 } 137 }
135 138
136 void AudioReceiveStream::Start() { 139 void AudioReceiveStream::Start() {
137 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 140 RTC_DCHECK(thread_checker_.CalledOnValidThread());
138 } 141 }
139 142
140 void AudioReceiveStream::Stop() { 143 void AudioReceiveStream::Stop() {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 243
241 VoiceEngine* AudioReceiveStream::voice_engine() const { 244 VoiceEngine* AudioReceiveStream::voice_engine() const {
242 internal::AudioState* audio_state = 245 internal::AudioState* audio_state =
243 static_cast<internal::AudioState*>(audio_state_.get()); 246 static_cast<internal::AudioState*>(audio_state_.get());
244 VoiceEngine* voice_engine = audio_state->voice_engine(); 247 VoiceEngine* voice_engine = audio_state->voice_engine();
245 RTC_DCHECK(voice_engine); 248 RTC_DCHECK(voice_engine);
246 return voice_engine; 249 return voice_engine;
247 } 250 }
248 } // namespace internal 251 } // namespace internal
249 } // namespace webrtc 252 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698