OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 |
11 #include <memory> | 11 #include <memory> |
12 #include <utility> | 12 #include <utility> |
13 | 13 |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 | 15 |
16 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer.h
" | 16 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer.h
" |
17 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" | 17 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" |
18 #include "webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.h
" | 18 #include "webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.h
" |
19 #include "webrtc/modules/audio_mixer/audio_mixer.h" | 19 #include "webrtc/modules/audio_mixer/audio_mixer.h" |
20 #include "webrtc/modules/audio_mixer/include/audio_mixer_defines.h" | 20 #include "webrtc/modules/audio_mixer/audio_mixer_defines.h" |
21 #include "webrtc/modules/audio_mixer/include/new_audio_conference_mixer.h" | 21 #include "webrtc/modules/audio_mixer/new_audio_conference_mixer.h" |
22 #include "webrtc/modules/audio_mixer/source/new_audio_conference_mixer_impl.h" | 22 #include "webrtc/modules/audio_mixer/new_audio_conference_mixer_impl.h" |
23 | 23 |
24 using testing::_; | 24 using testing::_; |
25 using testing::Exactly; | 25 using testing::Exactly; |
26 using testing::Invoke; | 26 using testing::Invoke; |
27 using testing::Return; | 27 using testing::Return; |
28 | 28 |
29 using webrtc::voe::AudioMixer; | 29 using webrtc::voe::AudioMixer; |
30 | 30 |
31 namespace webrtc { | 31 namespace webrtc { |
32 class MockAudioMixerParticipant : public MixerParticipant { | 32 class MockAudioMixerParticipant : public MixerParticipant { |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 AddParticipant(&second_frame, MixerParticipant::AudioFrameInfo::kMuted); | 448 AddParticipant(&second_frame, MixerParticipant::AudioFrameInfo::kMuted); |
449 AddParticipant(&third_frame, MixerParticipant::AudioFrameInfo::kMuted); | 449 AddParticipant(&third_frame, MixerParticipant::AudioFrameInfo::kMuted); |
450 | 450 |
451 for (int i = 0; i < 3; ++i) { | 451 for (int i = 0; i < 3; ++i) { |
452 MixAndCompare(); | 452 MixAndCompare(); |
453 } | 453 } |
454 } | 454 } |
455 | 455 |
456 TEST_F(CompareWithOldMixerTest, ManyParticipantsDifferentFrames) { | 456 TEST_F(CompareWithOldMixerTest, ManyParticipantsDifferentFrames) { |
457 Reset(); | 457 Reset(); |
458 constexpr int num_participants = 20; | 458 constexpr int kNumParticipants = 20; |
459 AudioFrame audio_frames[num_participants]; | 459 AudioFrame audio_frames[kNumParticipants]; |
460 | 460 |
461 for (int i = 0; i < num_participants; ++i) { | 461 for (int i = 0; i < kNumParticipants; ++i) { |
462 ResetFrame(&audio_frames[i]); | 462 ResetFrame(&audio_frames[i]); |
463 audio_frames[i].id_ = 1; | 463 audio_frames[i].id_ = 1; |
464 audio_frames[i].data_[10] = 100 * (i % 5); | 464 audio_frames[i].data_[10] = 100 * (i % 5); |
465 audio_frames[i].data_[100] = 100 * (i % 5); | 465 audio_frames[i].data_[100] = 100 * (i % 5); |
466 if (i % 2 == 0) { | 466 if (i % 2 == 0) { |
467 audio_frames[i].vad_activity_ = AudioFrame::kVadPassive; | 467 audio_frames[i].vad_activity_ = AudioFrame::kVadPassive; |
468 } | 468 } |
469 } | 469 } |
470 | 470 |
471 for (int i = 0; i < num_participants; ++i) { | 471 for (int i = 0; i < kNumParticipants; ++i) { |
472 if (i % 2 == 0) { | 472 if (i % 2 == 0) { |
473 AddParticipant(&audio_frames[i], | 473 AddParticipant(&audio_frames[i], |
474 MixerParticipant::AudioFrameInfo::kMuted); | 474 MixerParticipant::AudioFrameInfo::kMuted); |
475 } else { | 475 } else { |
476 AddParticipant(&audio_frames[i], | 476 AddParticipant(&audio_frames[i], |
477 MixerParticipant::AudioFrameInfo::kNormal); | 477 MixerParticipant::AudioFrameInfo::kNormal); |
478 } | 478 } |
479 MixAndCompare(); | 479 MixAndCompare(); |
480 } | 480 } |
481 } | 481 } |
482 | 482 |
483 } // namespace webrtc | 483 } // namespace webrtc |
OLD | NEW |