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

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

Issue 2964593002: Adding stats that can be used to compute output audio levels. (Closed)
Patch Set: Add test coverage in AudioSendStreamTest. Created 3 years, 5 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/channel_proxy.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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 uint32_t CaptureLevel() const; 69 uint32_t CaptureLevel() const;
70 70
71 int32_t StopSend(); 71 int32_t StopSend();
72 72
73 // TODO(solenberg): Remove, once AudioMonitor is gone. 73 // TODO(solenberg): Remove, once AudioMonitor is gone.
74 int8_t AudioLevel() const; 74 int8_t AudioLevel() const;
75 75
76 // 'virtual' to allow mocking. 76 // 'virtual' to allow mocking.
77 virtual int16_t AudioLevelFullRange() const; 77 virtual int16_t AudioLevelFullRange() const;
78 78
79 // See description of "totalAudioEnergy" in the WebRTC stats spec:
80 // https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats-totalaud ioenergy
81 // 'virtual' to allow mocking.
82 virtual double GetTotalInputEnergy() const;
83
84 // 'virtual' to allow mocking.
85 virtual double GetTotalInputDuration() const;
86
79 bool IsRecordingCall(); 87 bool IsRecordingCall();
80 88
81 bool IsRecordingMic(); 89 bool IsRecordingMic();
82 90
83 int StartPlayingFileAsMicrophone(const char* fileName, 91 int StartPlayingFileAsMicrophone(const char* fileName,
84 bool loop, 92 bool loop,
85 FileFormats format, 93 FileFormats format,
86 int startPosition, 94 int startPosition,
87 float volumeScaling, 95 float volumeScaling,
88 int stopPosition, 96 int stopPosition,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 std::unique_ptr<FilePlayer> file_player_; 190 std::unique_ptr<FilePlayer> file_player_;
183 std::unique_ptr<FileRecorder> file_recorder_; 191 std::unique_ptr<FileRecorder> file_recorder_;
184 std::unique_ptr<FileRecorder> file_call_recorder_; 192 std::unique_ptr<FileRecorder> file_call_recorder_;
185 int _filePlayerId = 0; 193 int _filePlayerId = 0;
186 int _fileRecorderId = 0; 194 int _fileRecorderId = 0;
187 int _fileCallRecorderId = 0; 195 int _fileCallRecorderId = 0;
188 bool _filePlaying = false; 196 bool _filePlaying = false;
189 bool _fileRecording = false; 197 bool _fileRecording = false;
190 bool _fileCallRecording = false; 198 bool _fileCallRecording = false;
191 voe::AudioLevel _audioLevel; 199 voe::AudioLevel _audioLevel;
200 double totalInputEnergy_ = 0.0;
201 double totalInputDuration_ = 0.0;
192 // protect file instances and their variables in MixedParticipants() 202 // protect file instances and their variables in MixedParticipants()
193 rtc::CriticalSection _critSect; 203 rtc::CriticalSection _critSect;
194 rtc::CriticalSection _callbackCritSect; 204 rtc::CriticalSection _callbackCritSect;
195 205
196 #if WEBRTC_VOICE_ENGINE_TYPING_DETECTION 206 #if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
197 MonitorModule<TransmitMixer> _monitorModule; 207 MonitorModule<TransmitMixer> _monitorModule;
198 webrtc::TypingDetection _typingDetection; 208 webrtc::TypingDetection _typingDetection;
199 bool _typingNoiseWarningPending = false; 209 bool _typingNoiseWarningPending = false;
200 bool _typingNoiseDetected = false; 210 bool _typingNoiseDetected = false;
201 #endif 211 #endif
202 212
203 int _instanceId = 0; 213 int _instanceId = 0;
204 bool _mixFileWithMicrophone = false; 214 bool _mixFileWithMicrophone = false;
205 uint32_t _captureLevel = 0; 215 uint32_t _captureLevel = 0;
206 bool stereo_codec_ = false; 216 bool stereo_codec_ = false;
207 bool swap_stereo_channels_ = false; 217 bool swap_stereo_channels_ = false;
208 }; 218 };
209 } // namespace voe 219 } // namespace voe
210 } // namespace webrtc 220 } // namespace webrtc
211 221
212 #endif // WEBRTC_VOICE_ENGINE_TRANSMIT_MIXER_H 222 #endif // WEBRTC_VOICE_ENGINE_TRANSMIT_MIXER_H
OLDNEW
« no previous file with comments | « webrtc/voice_engine/channel_proxy.cc ('k') | webrtc/voice_engine/transmit_mixer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698