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

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: Dynamically compute sample_duration in transmit_mixer, add w3c links, and use a named constant in c… 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
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 double GetTotalInputEnergy() const;
82
83 double GetTotalInputDuration() const;
84
79 bool IsRecordingCall(); 85 bool IsRecordingCall();
80 86
81 bool IsRecordingMic(); 87 bool IsRecordingMic();
82 88
83 int StartPlayingFileAsMicrophone(const char* fileName, 89 int StartPlayingFileAsMicrophone(const char* fileName,
84 bool loop, 90 bool loop,
85 FileFormats format, 91 FileFormats format,
86 int startPosition, 92 int startPosition,
87 float volumeScaling, 93 float volumeScaling,
88 int stopPosition, 94 int stopPosition,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 std::unique_ptr<FilePlayer> file_player_; 188 std::unique_ptr<FilePlayer> file_player_;
183 std::unique_ptr<FileRecorder> file_recorder_; 189 std::unique_ptr<FileRecorder> file_recorder_;
184 std::unique_ptr<FileRecorder> file_call_recorder_; 190 std::unique_ptr<FileRecorder> file_call_recorder_;
185 int _filePlayerId = 0; 191 int _filePlayerId = 0;
186 int _fileRecorderId = 0; 192 int _fileRecorderId = 0;
187 int _fileCallRecorderId = 0; 193 int _fileCallRecorderId = 0;
188 bool _filePlaying = false; 194 bool _filePlaying = false;
189 bool _fileRecording = false; 195 bool _fileRecording = false;
190 bool _fileCallRecording = false; 196 bool _fileCallRecording = false;
191 voe::AudioLevel _audioLevel; 197 voe::AudioLevel _audioLevel;
198 double _totalInputEnergy = 0.0;
ossu 2017/07/11 10:38:37 Same here: since both styles are used in this file
Zach Stein 2017/07/11 19:50:30 Done.
199 double _totalInputDuration = 0.0;
192 // protect file instances and their variables in MixedParticipants() 200 // protect file instances and their variables in MixedParticipants()
193 rtc::CriticalSection _critSect; 201 rtc::CriticalSection _critSect;
194 rtc::CriticalSection _callbackCritSect; 202 rtc::CriticalSection _callbackCritSect;
195 203
196 #if WEBRTC_VOICE_ENGINE_TYPING_DETECTION 204 #if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
197 MonitorModule<TransmitMixer> _monitorModule; 205 MonitorModule<TransmitMixer> _monitorModule;
198 webrtc::TypingDetection _typingDetection; 206 webrtc::TypingDetection _typingDetection;
199 bool _typingNoiseWarningPending = false; 207 bool _typingNoiseWarningPending = false;
200 bool _typingNoiseDetected = false; 208 bool _typingNoiseDetected = false;
201 #endif 209 #endif
202 210
203 int _instanceId = 0; 211 int _instanceId = 0;
204 bool _mixFileWithMicrophone = false; 212 bool _mixFileWithMicrophone = false;
205 uint32_t _captureLevel = 0; 213 uint32_t _captureLevel = 0;
206 bool stereo_codec_ = false; 214 bool stereo_codec_ = false;
207 bool swap_stereo_channels_ = false; 215 bool swap_stereo_channels_ = false;
208 }; 216 };
209 } // namespace voe 217 } // namespace voe
210 } // namespace webrtc 218 } // namespace webrtc
211 219
212 #endif // WEBRTC_VOICE_ENGINE_TRANSMIT_MIXER_H 220 #endif // WEBRTC_VOICE_ENGINE_TRANSMIT_MIXER_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698