diff options
author | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-05-05 18:22:21 +0000 |
---|---|---|
committer | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-05-05 18:22:21 +0000 |
commit | 3cd0f7c23453b72575e9c92bb7144fa3525abb10 (patch) | |
tree | 3b121fc1a32c141a60bed22e74233da622f3e922 /voice_engine/channel.h | |
parent | 60c62f8a7626a02356384e9a0a15a179f1b1f9d6 (diff) | |
download | webrtc-3cd0f7c23453b72575e9c92bb7144fa3525abb10.tar.gz |
Allow the RTP level indicator computation to work at any sample rate.
Break out the computation to a separate class, and call directly into
this from channel.cc rather than going through AudioProcessing. This
circumvents AudioProcessing's sample rate limitations.
We now compute the RMS over all samples rather than downmixing to a
single channel. This makes the call point in channel.cc easier, is
more "correct" and should have similar (negligible) complexity.
This caused slight changes in the RMS output, so the ApmTest.Process
reference has been updated. Snippet of the failing output:
[ RUN ] ApmTest.Process
Running test 4 of 12...
Value of: rms_level
Actual: 27
Expected: test->rms_level()
Which is: 28
Running test 5 of 12...
Value of: rms_level
Actual: 26
Expected: test->rms_level()
Which is: 27
Running test 6 of 12...
Value of: rms_level
Actual: 26
Expected: test->rms_level()
Which is: 27
Running test 10 of 12...
Value of: rms_level
Actual: 27
Expected: test->rms_level()
Which is: 28
Running test 11 of 12...
Value of: rms_level
Actual: 26
Expected: test->rms_level()
Which is: 27
Running test 12 of 12...
Value of: rms_level
Actual: 26
Expected: test->rms_level()
Which is: 27
BUG=3290
TESTED=Chrome assert is avoided and both voe_cmd_test and apprtc
produce reasonable printed out results from RMS().
R=bjornv@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16459004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6056 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'voice_engine/channel.h')
-rw-r--r-- | voice_engine/channel.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/voice_engine/channel.h b/voice_engine/channel.h index 8166f1c2..e605986d 100644 --- a/voice_engine/channel.h +++ b/voice_engine/channel.h @@ -8,13 +8,14 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H -#define WEBRTC_VOICE_ENGINE_CHANNEL_H +#ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_ +#define WEBRTC_VOICE_ENGINE_CHANNEL_H_ #include "webrtc/common_audio/resampler/include/push_resampler.h" #include "webrtc/common_types.h" #include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h" #include "webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer_defines.h" +#include "webrtc/modules/audio_processing/rms_level.h" #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h" #include "webrtc/modules/utility/interface/file_player.h" @@ -556,7 +557,7 @@ private: VoiceEngineObserver* _voiceEngineObserverPtr; // owned by base CriticalSectionWrapper* _callbackCritSectPtr; // owned by base Transport* _transportPtr; // WebRtc socket or external transport - scoped_ptr<AudioProcessing> rtp_audioproc_; + RMSLevel rms_level_; scoped_ptr<AudioProcessing> rx_audioproc_; // far end AudioProcessing VoERxVadCallback* _rxVadObserverPtr; int32_t _oldVadDecision; @@ -606,4 +607,4 @@ private: } // namespace voe } // namespace webrtc -#endif // WEBRTC_VOICE_ENGINE_CHANNEL_H +#endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |