diff options
author | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-01-07 17:45:09 +0000 |
---|---|---|
committer | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-01-07 17:45:09 +0000 |
commit | e95dc25b14845cbf00ae363e88459c44e2341c47 (patch) | |
tree | 16d64440bc779b925de14eb552514c4d8348fe69 /voice_engine/transmit_mixer.cc | |
parent | b3b6049e62c99c02132df65560fbcbc86aa54479 (diff) | |
download | webrtc-e95dc25b14845cbf00ae363e88459c44e2341c47.tar.gz |
Remove the requirement to call set_sample_rate_hz and friends.
Instead have ProcessStream transparently handle changes to the stream
audio parameters (sample rate and channels). This removes two locks
per 10 ms ProcessStream call taken by VoiceEngine (four total with the
audio level indicator.)
Also, prepare future improvements by having the splitting filter take
a length parameter. This will allow it to work at different sample
rates. Remove the useless splitting_filter wrapper.
TESTED=voe_cmd_test with audio processing enabled and switching between
codecs; unit tests.
R=aluebs@webrtc.org, bjornv@webrtc.org, turaj@webrtc.org, xians@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/3949004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5346 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'voice_engine/transmit_mixer.cc')
-rw-r--r-- | voice_engine/transmit_mixer.cc | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/voice_engine/transmit_mixer.cc b/voice_engine/transmit_mixer.cc index 743d8e20..b9618c81 100644 --- a/voice_engine/transmit_mixer.cc +++ b/voice_engine/transmit_mixer.cc @@ -1317,18 +1317,6 @@ int32_t TransmitMixer::MixOrReplaceAudioWithFile( void TransmitMixer::ProcessAudio(int delay_ms, int clock_drift, int current_mic_level) { - if (audioproc_->set_num_channels(_audioFrame.num_channels_, - _audioFrame.num_channels_) != 0) { - assert(false); - LOG_FERR2(LS_ERROR, set_num_channels, _audioFrame.num_channels_, - _audioFrame.num_channels_); - } - - if (audioproc_->set_sample_rate_hz(_audioFrame.sample_rate_hz_) != 0) { - assert(false); - LOG_FERR1(LS_ERROR, set_sample_rate_hz, _audioFrame.sample_rate_hz_); - } - if (audioproc_->set_stream_delay_ms(delay_ms) != 0) { // A redundant warning is reported in AudioDevice, which we've throttled // to avoid flooding the logs. Relegate this one to LS_VERBOSE to avoid @@ -1338,8 +1326,8 @@ void TransmitMixer::ProcessAudio(int delay_ms, int clock_drift, GainControl* agc = audioproc_->gain_control(); if (agc->set_stream_analog_level(current_mic_level) != 0) { - assert(false); LOG_FERR1(LS_ERROR, set_stream_analog_level, current_mic_level); + assert(false); } EchoCancellation* aec = audioproc_->echo_cancellation(); @@ -1349,8 +1337,8 @@ void TransmitMixer::ProcessAudio(int delay_ms, int clock_drift, int err = audioproc_->ProcessStream(&_audioFrame); if (err != 0) { - assert(false); LOG(LS_ERROR) << "ProcessStream() error: " << err; + assert(false); } CriticalSectionScoped cs(&_critSect); |