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

Unified Diff: webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc

Issue 1983023002: Add muted parameter to audio_frame_manipulator methods (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@mixer-mod-2
Patch Set: Avoid calling frame manipulator functions when muted Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc
diff --git a/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc b/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc
index de115f52636ba4bbd793a833a9d4e725c3600d50..d5aef3247107ec0a09dc9b6f6bf77d64d8625efe 100644
--- a/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc
+++ b/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc
@@ -577,7 +577,7 @@ void AudioConferenceMixerImpl::UpdateToMix(
}
if(audioFrame->vad_activity_ == AudioFrame::kVadActive) {
- if(!wasMixed) {
+ if(!wasMixed && !muted) {
RampIn(*audioFrame);
}
@@ -585,13 +585,15 @@ void AudioConferenceMixerImpl::UpdateToMix(
// There are already more active participants than should be
// mixed. Only keep the ones with the highest energy.
AudioFrameList::iterator replaceItem;
- uint32_t lowestEnergy = CalculateEnergy(*audioFrame);
+ uint32_t lowestEnergy =
+ muted ? 0 : CalculateEnergy(*audioFrame);
bool found_replace_item = false;
for (AudioFrameList::iterator iter = activeList.begin();
iter != activeList.end();
++iter) {
- const uint32_t energy = CalculateEnergy(*iter->frame);
+ const uint32_t energy =
+ muted ? 0 : CalculateEnergy(*iter->frame);
if(energy < lowestEnergy) {
replaceItem = iter;
lowestEnergy = energy;
@@ -599,6 +601,7 @@ void AudioConferenceMixerImpl::UpdateToMix(
}
}
if(found_replace_item) {
+ RTC_DCHECK(!muted); // Cannot replace with a muted frame.
FrameAndMuteInfo replaceFrame = *replaceItem;
bool replaceWasMixed = false;
@@ -620,7 +623,9 @@ void AudioConferenceMixerImpl::UpdateToMix(
kMaximumAmountOfMixedParticipants);
if (replaceWasMixed) {
hlundin-webrtc 2016/05/17 19:29:54 The formatting is "all over the place" in this fil
minyue-webrtc 2016/05/18 01:34:45 Acknowledged but it is weird
- RampOut(*replaceFrame.frame);
+ if (!replaceFrame.muted) {
+ RampOut(*replaceFrame.frame);
+ }
rampOutList->push_back(replaceFrame);
assert(rampOutList->size() <=
kMaximumAmountOfMixedParticipants);
@@ -629,7 +634,9 @@ void AudioConferenceMixerImpl::UpdateToMix(
}
} else {
if(wasMixed) {
- RampOut(*audioFrame);
+ if (!muted) {
+ RampOut(*audioFrame);
+ }
rampOutList->push_back(FrameAndMuteInfo(audioFrame,
muted));
assert(rampOutList->size() <=
@@ -650,7 +657,9 @@ void AudioConferenceMixerImpl::UpdateToMix(
new ParticipantFrameStruct(*participant, audioFrame, muted);
passiveWasMixedList.push_back(part_struct);
} else if(mustAddToPassiveList) {
- RampIn(*audioFrame);
+ if (!muted) {
+ RampIn(*audioFrame);
+ }
ParticipantFrameStruct* part_struct =
new ParticipantFrameStruct(*participant, audioFrame, muted);
passiveWasNotMixedList.push_back(part_struct);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698