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

Side by Side Diff: webrtc/voice_engine/transmit_mixer.cc

Issue 2722613002: Simplify webrtc::voe::MonitorModule and remove the .cc file. (Closed)
Patch Set: Add TODO Created 3 years, 9 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
« no previous file with comments | « webrtc/voice_engine/transmit_mixer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } else { 57 } else {
58 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1), 58 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
59 "TransmitMixer::OnPeriodicProcess() => " 59 "TransmitMixer::OnPeriodicProcess() => "
60 "CallbackOnError(VE_TYPING_NOISE_OFF_WARNING)"); 60 "CallbackOnError(VE_TYPING_NOISE_OFF_WARNING)");
61 _voiceEngineObserverPtr->CallbackOnError( 61 _voiceEngineObserverPtr->CallbackOnError(
62 -1, 62 -1,
63 VE_TYPING_NOISE_OFF_WARNING); 63 VE_TYPING_NOISE_OFF_WARNING);
64 } 64 }
65 } 65 }
66 } 66 }
67 #endif 67 #endif // WEBRTC_VOICE_ENGINE_TYPING_DETECTION
68 68
69 bool saturationWarning = false; 69 bool saturationWarning = false;
70 { 70 {
71 // Modify |_saturationWarning| under lock to avoid conflict with write op 71 // Modify |_saturationWarning| under lock to avoid conflict with write op
72 // in ProcessAudio and also ensure that we don't hold the lock during the 72 // in ProcessAudio and also ensure that we don't hold the lock during the
73 // callback. 73 // callback.
74 rtc::CritScope cs(&_critSect); 74 rtc::CritScope cs(&_critSect);
75 saturationWarning = _saturationWarning; 75 saturationWarning = _saturationWarning;
76 if (_saturationWarning) 76 if (_saturationWarning)
77 _saturationWarning = false; 77 _saturationWarning = false;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 TransmitMixer::Destroy(TransmitMixer*& mixer) 169 TransmitMixer::Destroy(TransmitMixer*& mixer)
170 { 170 {
171 if (mixer) 171 if (mixer)
172 { 172 {
173 delete mixer; 173 delete mixer;
174 mixer = NULL; 174 mixer = NULL;
175 } 175 }
176 } 176 }
177 177
178 TransmitMixer::TransmitMixer(uint32_t instanceId) : 178 TransmitMixer::TransmitMixer(uint32_t instanceId) :
179 _monitorModule(this),
179 // Avoid conflict with other channels by adding 1024 - 1026, 180 // Avoid conflict with other channels by adding 1024 - 1026,
180 // won't use as much as 1024 channels. 181 // won't use as much as 1024 channels.
181 _filePlayerId(instanceId + 1024), 182 _filePlayerId(instanceId + 1024),
182 _fileRecorderId(instanceId + 1025), 183 _fileRecorderId(instanceId + 1025),
183 _fileCallRecorderId(instanceId + 1026), 184 _fileCallRecorderId(instanceId + 1026),
184 _instanceId(instanceId) 185 _instanceId(instanceId)
185 { 186 {
186 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, -1), 187 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, -1),
187 "TransmitMixer::TransmitMixer() - ctor"); 188 "TransmitMixer::TransmitMixer() - ctor");
188 } 189 }
189 190
190 TransmitMixer::~TransmitMixer() 191 TransmitMixer::~TransmitMixer()
191 { 192 {
192 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, -1), 193 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, -1),
193 "TransmitMixer::~TransmitMixer() - dtor"); 194 "TransmitMixer::~TransmitMixer() - dtor");
194 _monitorModule.DeRegisterObserver();
195 if (_processThreadPtr) 195 if (_processThreadPtr)
196 { 196 {
197 _processThreadPtr->DeRegisterModule(&_monitorModule); 197 _processThreadPtr->DeRegisterModule(&_monitorModule);
198 } 198 }
199 { 199 {
200 rtc::CritScope cs(&_critSect); 200 rtc::CritScope cs(&_critSect);
201 if (file_recorder_) { 201 if (file_recorder_) {
202 file_recorder_->RegisterModuleFileCallback(NULL); 202 file_recorder_->RegisterModuleFileCallback(NULL);
203 file_recorder_->StopRecording(); 203 file_recorder_->StopRecording();
204 } 204 }
(...skipping 14 matching lines...) Expand all
219 ChannelManager& channelManager) 219 ChannelManager& channelManager)
220 { 220 {
221 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1), 221 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
222 "TransmitMixer::SetEngineInformation()"); 222 "TransmitMixer::SetEngineInformation()");
223 223
224 _processThreadPtr = &processThread; 224 _processThreadPtr = &processThread;
225 _engineStatisticsPtr = &engineStatistics; 225 _engineStatisticsPtr = &engineStatistics;
226 _channelManagerPtr = &channelManager; 226 _channelManagerPtr = &channelManager;
227 227
228 _processThreadPtr->RegisterModule(&_monitorModule); 228 _processThreadPtr->RegisterModule(&_monitorModule);
229 _monitorModule.RegisterObserver(*this);
230 229
231 return 0; 230 return 0;
232 } 231 }
233 232
234 int32_t 233 int32_t
235 TransmitMixer::RegisterVoiceEngineObserver(VoiceEngineObserver& observer) 234 TransmitMixer::RegisterVoiceEngineObserver(VoiceEngineObserver& observer)
236 { 235 {
237 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1), 236 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
238 "TransmitMixer::RegisterVoiceEngineObserver()"); 237 "TransmitMixer::RegisterVoiceEngineObserver()");
239 rtc::CritScope cs(&_callbackCritSect); 238 rtc::CritScope cs(&_callbackCritSect);
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { 1138 void TransmitMixer::EnableStereoChannelSwapping(bool enable) {
1140 swap_stereo_channels_ = enable; 1139 swap_stereo_channels_ = enable;
1141 } 1140 }
1142 1141
1143 bool TransmitMixer::IsStereoChannelSwappingEnabled() { 1142 bool TransmitMixer::IsStereoChannelSwappingEnabled() {
1144 return swap_stereo_channels_; 1143 return swap_stereo_channels_;
1145 } 1144 }
1146 1145
1147 } // namespace voe 1146 } // namespace voe
1148 } // namespace webrtc 1147 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/transmit_mixer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698