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

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

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/monitor_module.cc ('k') | webrtc/voice_engine/transmit_mixer.cc » ('j') | 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 24 matching lines...) Expand all
35 35
36 class AudioProcessing; 36 class AudioProcessing;
37 class ProcessThread; 37 class ProcessThread;
38 38
39 namespace voe { 39 namespace voe {
40 40
41 class ChannelManager; 41 class ChannelManager;
42 class MixedAudio; 42 class MixedAudio;
43 class Statistics; 43 class Statistics;
44 44
45 class TransmitMixer : public MonitorObserver, 45 class TransmitMixer : public FileCallback {
46 public FileCallback {
47 public: 46 public:
48 static int32_t Create(TransmitMixer*& mixer, uint32_t instanceId); 47 static int32_t Create(TransmitMixer*& mixer, uint32_t instanceId);
49 48
50 static void Destroy(TransmitMixer*& mixer); 49 static void Destroy(TransmitMixer*& mixer);
51 50
52 int32_t SetEngineInformation(ProcessThread& processThread, 51 int32_t SetEngineInformation(ProcessThread& processThread,
53 Statistics& engineStatistics, 52 Statistics& engineStatistics,
54 ChannelManager& channelManager); 53 ChannelManager& channelManager);
55 54
56 int32_t SetAudioProcessingModule( 55 int32_t SetAudioProcessingModule(
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 int StartRecordingCall(OutStream* stream, const CodecInst* codecInst); 125 int StartRecordingCall(OutStream* stream, const CodecInst* codecInst);
127 126
128 int StopRecordingCall(); 127 int StopRecordingCall();
129 128
130 void SetMixWithMicStatus(bool mix); 129 void SetMixWithMicStatus(bool mix);
131 130
132 int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer); 131 int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer);
133 132
134 virtual ~TransmitMixer(); 133 virtual ~TransmitMixer();
135 134
136 // MonitorObserver 135 // Periodic callback from the MonitorModule.
137 void OnPeriodicProcess(); 136 void OnPeriodicProcess();
138 137
139
140 // FileCallback 138 // FileCallback
141 void PlayNotification(const int32_t id, 139 void PlayNotification(const int32_t id,
142 const uint32_t durationMs); 140 const uint32_t durationMs);
143 141
144 void RecordNotification(const int32_t id, 142 void RecordNotification(const int32_t id,
145 const uint32_t durationMs); 143 const uint32_t durationMs);
146 144
147 void PlayFileEnded(const int32_t id); 145 void PlayFileEnded(const int32_t id);
148 146
149 void RecordFileEnded(const int32_t id); 147 void RecordFileEnded(const int32_t id);
150 148
151 #if WEBRTC_VOICE_ENGINE_TYPING_DETECTION 149 #if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
152 // Typing detection 150 // Typing detection
153 int TimeSinceLastTyping(int &seconds); 151 int TimeSinceLastTyping(int &seconds);
154 int SetTypingDetectionParameters(int timeWindow, 152 int SetTypingDetectionParameters(int timeWindow,
155 int costPerTyping, 153 int costPerTyping,
156 int reportingThreshold, 154 int reportingThreshold,
157 int penaltyDecay, 155 int penaltyDecay,
158 int typeEventDelay); 156 int typeEventDelay);
159 #endif 157 #endif
160 158
161 // Virtual to allow mocking. 159 // Virtual to allow mocking.
162 virtual void EnableStereoChannelSwapping(bool enable); 160 virtual void EnableStereoChannelSwapping(bool enable);
163 bool IsStereoChannelSwappingEnabled(); 161 bool IsStereoChannelSwappingEnabled();
164 162
165 protected: 163 protected:
166 TransmitMixer() = default; 164 TransmitMixer() : _monitorModule(this) {}
167 165
168 private: 166 private:
169 TransmitMixer(uint32_t instanceId); 167 TransmitMixer(uint32_t instanceId);
170 168
171 // Gets the maximum sample rate and number of channels over all currently 169 // Gets the maximum sample rate and number of channels over all currently
172 // sending codecs. 170 // sending codecs.
173 void GetSendCodecInfo(int* max_sample_rate, size_t* max_channels); 171 void GetSendCodecInfo(int* max_sample_rate, size_t* max_channels);
174 172
175 void GenerateAudioFrame(const int16_t audioSamples[], 173 void GenerateAudioFrame(const int16_t audioSamples[],
176 size_t nSamples, 174 size_t nSamples,
(...skipping 12 matching lines...) Expand all
189 #endif 187 #endif
190 188
191 // uses 189 // uses
192 Statistics* _engineStatisticsPtr = nullptr; 190 Statistics* _engineStatisticsPtr = nullptr;
193 ChannelManager* _channelManagerPtr = nullptr; 191 ChannelManager* _channelManagerPtr = nullptr;
194 AudioProcessing* audioproc_ = nullptr; 192 AudioProcessing* audioproc_ = nullptr;
195 VoiceEngineObserver* _voiceEngineObserverPtr = nullptr; 193 VoiceEngineObserver* _voiceEngineObserverPtr = nullptr;
196 ProcessThread* _processThreadPtr = nullptr; 194 ProcessThread* _processThreadPtr = nullptr;
197 195
198 // owns 196 // owns
199 MonitorModule _monitorModule; 197 MonitorModule<TransmitMixer> _monitorModule;
200 AudioFrame _audioFrame; 198 AudioFrame _audioFrame;
201 PushResampler<int16_t> resampler_; // ADM sample rate -> mixing rate 199 PushResampler<int16_t> resampler_; // ADM sample rate -> mixing rate
202 std::unique_ptr<FilePlayer> file_player_; 200 std::unique_ptr<FilePlayer> file_player_;
203 std::unique_ptr<FileRecorder> file_recorder_; 201 std::unique_ptr<FileRecorder> file_recorder_;
204 std::unique_ptr<FileRecorder> file_call_recorder_; 202 std::unique_ptr<FileRecorder> file_call_recorder_;
205 int _filePlayerId = 0; 203 int _filePlayerId = 0;
206 int _fileRecorderId = 0; 204 int _fileRecorderId = 0;
207 int _fileCallRecorderId = 0; 205 int _fileCallRecorderId = 0;
208 bool _filePlaying = false; 206 bool _filePlaying = false;
209 bool _fileRecording = false; 207 bool _fileRecording = false;
(...skipping 14 matching lines...) Expand all
224 bool _mixFileWithMicrophone = false; 222 bool _mixFileWithMicrophone = false;
225 uint32_t _captureLevel = 0; 223 uint32_t _captureLevel = 0;
226 bool _mute = false; 224 bool _mute = false;
227 bool stereo_codec_ = false; 225 bool stereo_codec_ = false;
228 bool swap_stereo_channels_ = false; 226 bool swap_stereo_channels_ = false;
229 }; 227 };
230 } // namespace voe 228 } // namespace voe
231 } // namespace webrtc 229 } // namespace webrtc
232 230
233 #endif // WEBRTC_VOICE_ENGINE_TRANSMIT_MIXER_H 231 #endif // WEBRTC_VOICE_ENGINE_TRANSMIT_MIXER_H
OLDNEW
« no previous file with comments | « webrtc/voice_engine/monitor_module.cc ('k') | webrtc/voice_engine/transmit_mixer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698