| Index: webrtc/modules/audio_mixer/test/audio_mixer_unittest.cc
|
| diff --git a/webrtc/modules/audio_mixer/test/audio_mixer_unittest.cc b/webrtc/modules/audio_mixer/test/audio_mixer_unittest.cc
|
| index 95c7679967d8eb9105b250e993d22ef5cf5253c9..a5db1001d536af5cb59b956650e180c740ae58e7 100644
|
| --- a/webrtc/modules/audio_mixer/test/audio_mixer_unittest.cc
|
| +++ b/webrtc/modules/audio_mixer/test/audio_mixer_unittest.cc
|
| @@ -13,7 +13,7 @@
|
|
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "webrtc/modules/audio_mixer/audio_mixer_defines.h"
|
| -#include "webrtc/modules/audio_mixer/new_audio_conference_mixer.h"
|
| +#include "webrtc/modules/audio_mixer/audio_mixer.h"
|
|
|
| using testing::_;
|
| using testing::Exactly;
|
| @@ -85,8 +85,7 @@ void MixAndCompare(
|
| RTC_DCHECK(frames.size() == frame_info.size() &&
|
| frame_info.size() == expected_status.size());
|
|
|
| - std::unique_ptr<NewAudioConferenceMixer> mixer(
|
| - NewAudioConferenceMixer::Create(kId));
|
| + std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId));
|
| std::vector<MockMixerAudioSource> participants(num_audio_sources);
|
|
|
| for (size_t i = 0; i < num_audio_sources; i++) {
|
| @@ -112,13 +111,10 @@ void MixAndCompare(
|
| TEST(AudioMixer, AnonymousAndNamed) {
|
| // Should not matter even if partipants are more than
|
| // kMaximumAmountOfMixedAudioSources.
|
| - constexpr int kNamed =
|
| - NewAudioConferenceMixer::kMaximumAmountOfMixedAudioSources + 1;
|
| - constexpr int kAnonymous =
|
| - NewAudioConferenceMixer::kMaximumAmountOfMixedAudioSources + 1;
|
| + constexpr int kNamed = AudioMixer::kMaximumAmountOfMixedAudioSources + 1;
|
| + constexpr int kAnonymous = AudioMixer::kMaximumAmountOfMixedAudioSources + 1;
|
|
|
| - std::unique_ptr<NewAudioConferenceMixer> mixer(
|
| - NewAudioConferenceMixer::Create(kId));
|
| + std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId));
|
|
|
| MockMixerAudioSource named[kNamed];
|
| MockMixerAudioSource anonymous[kAnonymous];
|
| @@ -164,11 +160,9 @@ TEST(AudioMixer, AnonymousAndNamed) {
|
| }
|
|
|
| TEST(AudioMixer, LargestEnergyVadActiveMixed) {
|
| - const int kAudioSources =
|
| - NewAudioConferenceMixer::kMaximumAmountOfMixedAudioSources + 3;
|
| + const int kAudioSources = AudioMixer::kMaximumAmountOfMixedAudioSources + 3;
|
|
|
| - std::unique_ptr<NewAudioConferenceMixer> mixer(
|
| - NewAudioConferenceMixer::Create(kId));
|
| + std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId));
|
|
|
| MockMixerAudioSource participants[kAudioSources];
|
|
|
| @@ -197,8 +191,7 @@ TEST(AudioMixer, LargestEnergyVadActiveMixed) {
|
| for (int i = 0; i < kAudioSources; ++i) {
|
| bool is_mixed = participants[i].IsMixed();
|
| if (i == kAudioSources - 1 ||
|
| - i < kAudioSources - 1 -
|
| - NewAudioConferenceMixer::kMaximumAmountOfMixedAudioSources) {
|
| + i < kAudioSources - 1 - AudioMixer::kMaximumAmountOfMixedAudioSources) {
|
| EXPECT_FALSE(is_mixed) << "Mixing status of AudioSource #" << i
|
| << " wrong.";
|
| } else {
|
| @@ -209,8 +202,7 @@ TEST(AudioMixer, LargestEnergyVadActiveMixed) {
|
| }
|
|
|
| TEST(AudioMixer, ParticipantSampleRate) {
|
| - std::unique_ptr<NewAudioConferenceMixer> mixer(
|
| - NewAudioConferenceMixer::Create(kId));
|
| + std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId));
|
|
|
| MockMixerAudioSource participant;
|
| ResetFrame(participant.fake_frame());
|
| @@ -225,8 +217,7 @@ TEST(AudioMixer, ParticipantSampleRate) {
|
| }
|
|
|
| TEST(AudioMixer, ParticipantNumberOfChannels) {
|
| - std::unique_ptr<NewAudioConferenceMixer> mixer(
|
| - NewAudioConferenceMixer::Create(kId));
|
| + std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId));
|
|
|
| MockMixerAudioSource participant;
|
| ResetFrame(participant.fake_frame());
|
| @@ -243,8 +234,7 @@ TEST(AudioMixer, ParticipantNumberOfChannels) {
|
| // Test that the volume is reported as zero when the mixer input
|
| // comprises only zero values.
|
| TEST(AudioMixer, LevelIsZeroWhenMixingZeroes) {
|
| - std::unique_ptr<NewAudioConferenceMixer> mixer(
|
| - NewAudioConferenceMixer::Create(kId));
|
| + std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId));
|
|
|
| MockMixerAudioSource participant;
|
| ResetFrame(participant.fake_frame());
|
| @@ -263,8 +253,7 @@ TEST(AudioMixer, LevelIsZeroWhenMixingZeroes) {
|
| // Test that the reported volume is maximal as full when the mixer
|
| // input comprises frames with maximal values.
|
| TEST(AudioMixer, LevelIsMaximalWhenMixingMaximalValues) {
|
| - std::unique_ptr<NewAudioConferenceMixer> mixer(
|
| - NewAudioConferenceMixer::Create(kId));
|
| + std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId));
|
|
|
| MockMixerAudioSource participant;
|
| ResetFrame(participant.fake_frame());
|
| @@ -292,8 +281,7 @@ TEST(AudioMixer, LevelIsMaximalWhenMixingMaximalValues) {
|
| // Test that the reported volume is maximal as full when the mixer
|
| // input comprises frames with maximal values.
|
| TEST(AudioMixer, VolumeTwoParticipants) {
|
| - std::unique_ptr<NewAudioConferenceMixer> mixer(
|
| - NewAudioConferenceMixer::Create(kId));
|
| + std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId));
|
|
|
| MockMixerAudioSource participant1, participant2;
|
| ResetFrame(participant1.fake_frame());
|
| @@ -320,11 +308,9 @@ TEST(AudioMixer, VolumeTwoParticipants) {
|
| // Maximal amount of participants are mixed one iteration, then
|
| // another participant with higher energy is added.
|
| TEST(AudioMixer, RampedOutSourcesShouldNotBeMarkedMixed) {
|
| - const int kAudioSources =
|
| - NewAudioConferenceMixer::kMaximumAmountOfMixedAudioSources + 1;
|
| + const int kAudioSources = AudioMixer::kMaximumAmountOfMixedAudioSources + 1;
|
|
|
| - std::unique_ptr<NewAudioConferenceMixer> mixer(
|
| - NewAudioConferenceMixer::Create(kId));
|
| + std::unique_ptr<AudioMixer> mixer(AudioMixer::Create(kId));
|
| MockMixerAudioSource participants[kAudioSources];
|
|
|
| for (size_t i = 0; i < kAudioSources; i++) {
|
| @@ -368,8 +354,7 @@ TEST(AudioMixer, RampedOutSourcesShouldNotBeMarkedMixed) {
|
| }
|
|
|
| TEST(AudioMixer, MutedShouldMixAfterUnmuted) {
|
| - const int kAudioSources =
|
| - NewAudioConferenceMixer::kMaximumAmountOfMixedAudioSources + 1;
|
| + const int kAudioSources = AudioMixer::kMaximumAmountOfMixedAudioSources + 1;
|
|
|
| std::vector<AudioFrame> frames(kAudioSources);
|
| for (auto& frame : frames) {
|
| @@ -386,8 +371,7 @@ TEST(AudioMixer, MutedShouldMixAfterUnmuted) {
|
| }
|
|
|
| TEST(AudioMixer, PassiveShouldMixAfterNormal) {
|
| - const int kAudioSources =
|
| - NewAudioConferenceMixer::kMaximumAmountOfMixedAudioSources + 1;
|
| + const int kAudioSources = AudioMixer::kMaximumAmountOfMixedAudioSources + 1;
|
|
|
| std::vector<AudioFrame> frames(kAudioSources);
|
| for (auto& frame : frames) {
|
| @@ -404,8 +388,7 @@ TEST(AudioMixer, PassiveShouldMixAfterNormal) {
|
| }
|
|
|
| TEST(AudioMixer, ActiveShouldMixBeforeLoud) {
|
| - const int kAudioSources =
|
| - NewAudioConferenceMixer::kMaximumAmountOfMixedAudioSources + 1;
|
| + const int kAudioSources = AudioMixer::kMaximumAmountOfMixedAudioSources + 1;
|
|
|
| std::vector<AudioFrame> frames(kAudioSources);
|
| for (auto& frame : frames) {
|
| @@ -424,8 +407,7 @@ TEST(AudioMixer, ActiveShouldMixBeforeLoud) {
|
| }
|
|
|
| TEST(AudioMixer, UnmutedShouldMixBeforeLoud) {
|
| - const int kAudioSources =
|
| - NewAudioConferenceMixer::kMaximumAmountOfMixedAudioSources + 1;
|
| + const int kAudioSources = AudioMixer::kMaximumAmountOfMixedAudioSources + 1;
|
|
|
| std::vector<AudioFrame> frames(kAudioSources);
|
| for (auto& frame : frames) {
|
|
|