 Chromium Code Reviews
 Chromium Code Reviews Issue 2230823004:
  Added a level indicator to new mixer.  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@mixer_gn_fixes
    
  
    Issue 2230823004:
  Added a level indicator to new mixer.  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@mixer_gn_fixes| Index: webrtc/modules/audio_mixer/new_audio_conference_mixer_impl.cc | 
| diff --git a/webrtc/modules/audio_mixer/new_audio_conference_mixer_impl.cc b/webrtc/modules/audio_mixer/new_audio_conference_mixer_impl.cc | 
| index 48380fc550129a6ea62882fe96941a5148473701..b67dbda7091a1735eff4db4c81dfd82065b267d1 100644 | 
| --- a/webrtc/modules/audio_mixer/new_audio_conference_mixer_impl.cc | 
| +++ b/webrtc/modules/audio_mixer/new_audio_conference_mixer_impl.cc | 
| @@ -73,7 +73,6 @@ void RemixFrame(AudioFrame* frame, size_t number_of_channels) { | 
| // |mixed_frame| always has at least as many channels as |frame|. Supports | 
| // stereo at most. | 
| // | 
| -// TODO(andrew): consider not modifying |frame| here. | 
| 
minyue-webrtc
2016/08/11 10:27:33
you think there is no need to consider this anymor
 
aleloi
2016/08/11 12:15:19
I wrote that in a comment in one of the earlier pa
 
minyue-webrtc
2016/08/15 06:30:08
I do not see any case, it is up to you to decide w
 | 
| void MixFrames(AudioFrame* mixed_frame, AudioFrame* frame, bool use_limiter) { | 
| RTC_DCHECK_GE(mixed_frame->num_channels_, frame->num_channels_); | 
| if (use_limiter) { | 
| @@ -237,8 +236,7 @@ void NewAudioConferenceMixerImpl::Mix(int sample_rate, | 
| time_stamp_ += static_cast<uint32_t>(sample_size_); | 
| - use_limiter_ = num_mixed_audio_sources_ > 1 && | 
| - output_frequency_ <= AudioProcessing::kMaxNativeSampleRateHz; | 
| + use_limiter_ = num_mixed_audio_sources_ > 1; | 
| // We only use the limiter if it supports the output sample rate and | 
| // we're actually mixing multiple streams. | 
| @@ -257,6 +255,10 @@ void NewAudioConferenceMixerImpl::Mix(int sample_rate, | 
| LimitMixedAudio(audio_frame_for_mixing); | 
| } | 
| } | 
| + | 
| + // Pass the final result to the level indicator. | 
| + audio_level_.ComputeLevel(*audio_frame_for_mixing); | 
| + | 
| return; | 
| } | 
| @@ -591,4 +593,20 @@ bool NewAudioConferenceMixerImpl::LimitMixedAudio( | 
| } | 
| return true; | 
| } | 
| + | 
| +uint32_t NewAudioConferenceMixerImpl::GetSpeechOutputLevel() { | 
| + int8_t currentLevel = audio_level_.Level(); | 
| + uint32_t level = static_cast<uint32_t>(currentLevel); | 
| + WEBRTC_TRACE(kTraceStateInfo, kTraceAudioMixerServer, id_, | 
| + "GetSpeechOutputLevel() => level=%u", level); | 
| + return level; | 
| +} | 
| + | 
| +uint32_t NewAudioConferenceMixerImpl::GetSpeechOutputLevelFullRange() { | 
| + int16_t currentLevel = audio_level_.LevelFullRange(); | 
| + uint32_t level = static_cast<uint32_t>(currentLevel); | 
| + WEBRTC_TRACE(kTraceStateInfo, kTraceAudioMixerServer, id_, | 
| + "GetSpeechOutputLevelFullRange() => level=%u", level); | 
| + return level; | 
| +} | 
| } // namespace webrtc |