OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 * |
| 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 |
| 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ |
| 10 |
| 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_MOCK_MOCK_RENDER_DELAY_BUFFER_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_MOCK_MOCK_RENDER_DELAY_BUFFER_H_ |
| 13 |
| 14 #include <vector> |
| 15 |
| 16 #include "webrtc/modules/audio_processing/aec3/aec3_constants.h" |
| 17 #include "webrtc/modules/audio_processing/aec3/render_delay_buffer.h" |
| 18 #include "webrtc/test/gmock.h" |
| 19 |
| 20 namespace webrtc { |
| 21 namespace test { |
| 22 |
| 23 class MockRenderDelayBuffer : public RenderDelayBuffer { |
| 24 public: |
| 25 explicit MockRenderDelayBuffer(int sample_rate_hz) |
| 26 : block_(std::vector<std::vector<float>>( |
| 27 NumBandsForRate(sample_rate_hz), |
| 28 std::vector<float>(kBlockSize, 0.f))) { |
| 29 ON_CALL(*this, GetNext()) |
| 30 .WillByDefault( |
| 31 testing::Invoke(this, &MockRenderDelayBuffer::FakeGetNext)); |
| 32 } |
| 33 virtual ~MockRenderDelayBuffer() = default; |
| 34 |
| 35 MOCK_METHOD1(Insert, bool(std::vector<std::vector<float>>* block)); |
| 36 MOCK_METHOD0(GetNext, const std::vector<std::vector<float>>&()); |
| 37 MOCK_METHOD1(SetDelay, void(size_t delay)); |
| 38 MOCK_CONST_METHOD0(Delay, size_t()); |
| 39 MOCK_CONST_METHOD0(MaxDelay, size_t()); |
| 40 MOCK_CONST_METHOD0(IsBlockAvailable, bool()); |
| 41 MOCK_CONST_METHOD0(MaxApiJitter, size_t()); |
| 42 |
| 43 private: |
| 44 const std::vector<std::vector<float>>& FakeGetNext() const { return block_; } |
| 45 std::vector<std::vector<float>> block_; |
| 46 }; |
| 47 |
| 48 } // namespace test |
| 49 } // namespace webrtc |
| 50 |
| 51 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_MOCK_MOCK_RENDER_DELAY_BUFFER_H_ |
OLD | NEW |