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 <string.h> | 11 #include <string.h> |
12 | 12 |
13 #include <limits> | 13 #include <limits> |
14 #include <memory> | 14 #include <memory> |
15 #include <utility> | 15 #include <utility> |
16 | 16 |
17 #include "webrtc/api/audio/audio_mixer.h" | 17 #include "webrtc/api/audio/audio_mixer.h" |
18 #include "webrtc/base/bind.h" | 18 #include "webrtc/base/bind.h" |
19 #include "webrtc/base/thread.h" | 19 #include "webrtc/base/thread.h" |
20 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h" | 20 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h" |
21 #include "webrtc/modules/audio_mixer/default_output_rate_calculator.h" | |
22 #include "webrtc/test/gmock.h" | 21 #include "webrtc/test/gmock.h" |
23 | 22 |
24 using testing::_; | 23 using testing::_; |
25 using testing::Exactly; | 24 using testing::Exactly; |
26 using testing::Invoke; | 25 using testing::Invoke; |
27 using testing::Return; | 26 using testing::Return; |
28 | 27 |
29 namespace webrtc { | 28 namespace webrtc { |
30 | 29 |
31 namespace { | 30 namespace { |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 constexpr int kOutputRate = 8000; | 472 constexpr int kOutputRate = 8000; |
474 const auto mixer = AudioMixerImpl::CreateWithOutputRateCalculator( | 473 const auto mixer = AudioMixerImpl::CreateWithOutputRateCalculator( |
475 std::unique_ptr<OutputRateCalculator>( | 474 std::unique_ptr<OutputRateCalculator>( |
476 new CustomRateCalculator(kOutputRate))); | 475 new CustomRateCalculator(kOutputRate))); |
477 | 476 |
478 mixer->Mix(1, &frame_for_mixing); | 477 mixer->Mix(1, &frame_for_mixing); |
479 | 478 |
480 EXPECT_EQ(kOutputRate, frame_for_mixing.sample_rate_hz_); | 479 EXPECT_EQ(kOutputRate, frame_for_mixing.sample_rate_hz_); |
481 } | 480 } |
482 } // namespace webrtc | 481 } // namespace webrtc |
OLD | NEW |