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

Side by Side Diff: webrtc/modules/audio_conference_mixer/test/audio_conference_mixer_unittest.cc

Issue 2750783004: Add mute state field to AudioFrame. (Closed)
Patch Set: Update new usages of AudioFrame::data_ Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 participants[i].fake_frame()->sample_rate_hz_ = kSampleRateHz; 122 participants[i].fake_frame()->sample_rate_hz_ = kSampleRateHz;
123 participants[i].fake_frame()->speech_type_ = AudioFrame::kNormalSpeech; 123 participants[i].fake_frame()->speech_type_ = AudioFrame::kNormalSpeech;
124 participants[i].fake_frame()->vad_activity_ = AudioFrame::kVadActive; 124 participants[i].fake_frame()->vad_activity_ = AudioFrame::kVadActive;
125 participants[i].fake_frame()->num_channels_ = 1; 125 participants[i].fake_frame()->num_channels_ = 1;
126 126
127 // Frame duration 10ms. 127 // Frame duration 10ms.
128 participants[i].fake_frame()->samples_per_channel_ = kSampleRateHz / 100; 128 participants[i].fake_frame()->samples_per_channel_ = kSampleRateHz / 100;
129 129
130 // We set the 80-th sample value since the first 80 samples may be 130 // We set the 80-th sample value since the first 80 samples may be
131 // modified by a ramped-in window. 131 // modified by a ramped-in window.
132 participants[i].fake_frame()->data_[80] = i; 132 participants[i].fake_frame()->mutable_data()[80] = i;
133 133
134 EXPECT_EQ(0, mixer->SetMixabilityStatus(&participants[i], true)); 134 EXPECT_EQ(0, mixer->SetMixabilityStatus(&participants[i], true));
135 EXPECT_CALL(participants[i], GetAudioFrame(_, _)) 135 EXPECT_CALL(participants[i], GetAudioFrame(_, _))
136 .Times(AtLeast(1)); 136 .Times(AtLeast(1));
137 EXPECT_CALL(participants[i], NeededFrequency(_)) 137 EXPECT_CALL(participants[i], NeededFrequency(_))
138 .WillRepeatedly(Return(kSampleRateHz)); 138 .WillRepeatedly(Return(kSampleRateHz));
139 } 139 }
140 140
141 // Last participant gives audio frame with passive VAD, although it has the 141 // Last participant gives audio frame with passive VAD, although it has the
142 // largest energy. 142 // largest energy.
(...skipping 14 matching lines...) Expand all
157 } else { 157 } else {
158 EXPECT_TRUE(is_mixed) << "Mixing status of Participant #" 158 EXPECT_TRUE(is_mixed) << "Mixing status of Participant #"
159 << i << " wrong."; 159 << i << " wrong.";
160 } 160 }
161 } 161 }
162 162
163 EXPECT_EQ(0, mixer->UnRegisterMixedStreamCallback()); 163 EXPECT_EQ(0, mixer->UnRegisterMixedStreamCallback());
164 } 164 }
165 165
166 } // namespace webrtc 166 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698