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

Unified Diff: webrtc/modules/audio_mixer/new_audio_conference_mixer_impl.cc

Issue 2230823004: Added a level indicator to new mixer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@mixer_gn_fixes
Patch Set: Made local variable const. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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..72f8e151848b1c9be6035b3a76631bf017014212 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.
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,18 @@ bool NewAudioConferenceMixerImpl::LimitMixedAudio(
}
return true;
}
+
+int NewAudioConferenceMixerImpl::GetOutputAudioLevel() {
+ const int level = audio_level_.Level();
+ WEBRTC_TRACE(kTraceStateInfo, kTraceAudioMixerServer, id_,
+ "GetAudioOutputLevel() => level=%d", level);
+ return level;
+}
+
+int NewAudioConferenceMixerImpl::GetOutputAudioLevelFullRange() {
+ const int level = audio_level_.LevelFullRange();
+ WEBRTC_TRACE(kTraceStateInfo, kTraceAudioMixerServer, id_,
+ "GetAudioOutputLevelFullRange() => level=%d", level);
+ return level;
+}
} // namespace webrtc
« no previous file with comments | « webrtc/modules/audio_mixer/new_audio_conference_mixer_impl.h ('k') | webrtc/modules/audio_mixer/test/audio_mixer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698