OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 "webrtc/common_audio/blocker.h" | 11 #include "webrtc/common_audio/blocker.h" |
12 | 12 |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 // Callback Function to add 3 to every sample in the signal. | 17 // Callback Function to add 3 to every sample in the signal. |
18 class PlusThreeBlockerCallback : public webrtc::BlockerCallback { | 18 class PlusThreeBlockerCallback : public webrtc::BlockerCallback { |
19 public: | 19 public: |
20 void ProcessBlock(const float* const* input, | 20 void ProcessBlock(const float* const* input, |
21 int num_frames, | 21 size_t num_frames, |
22 int num_input_channels, | 22 int num_input_channels, |
23 int num_output_channels, | 23 int num_output_channels, |
24 float* const* output) override { | 24 float* const* output) override { |
25 for (int i = 0; i < num_output_channels; ++i) { | 25 for (int i = 0; i < num_output_channels; ++i) { |
26 for (int j = 0; j < num_frames; ++j) { | 26 for (size_t j = 0; j < num_frames; ++j) { |
27 output[i][j] = input[i][j] + 3; | 27 output[i][j] = input[i][j] + 3; |
28 } | 28 } |
29 } | 29 } |
30 } | 30 } |
31 }; | 31 }; |
32 | 32 |
33 // No-op Callback Function. | 33 // No-op Callback Function. |
34 class CopyBlockerCallback : public webrtc::BlockerCallback { | 34 class CopyBlockerCallback : public webrtc::BlockerCallback { |
35 public: | 35 public: |
36 void ProcessBlock(const float* const* input, | 36 void ProcessBlock(const float* const* input, |
37 int num_frames, | 37 size_t num_frames, |
38 int num_input_channels, | 38 int num_input_channels, |
39 int num_output_channels, | 39 int num_output_channels, |
40 float* const* output) override { | 40 float* const* output) override { |
41 for (int i = 0; i < num_output_channels; ++i) { | 41 for (int i = 0; i < num_output_channels; ++i) { |
42 for (int j = 0; j < num_frames; ++j) { | 42 for (size_t j = 0; j < num_frames; ++j) { |
43 output[i][j] = input[i][j]; | 43 output[i][j] = input[i][j]; |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 }; | 47 }; |
48 | 48 |
49 } // namespace | 49 } // namespace |
50 | 50 |
51 namespace webrtc { | 51 namespace webrtc { |
52 | 52 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 kNumOutputChannels); | 333 kNumOutputChannels); |
334 | 334 |
335 ValidateInitialDelay(output_cb.channels(), | 335 ValidateInitialDelay(output_cb.channels(), |
336 kNumOutputChannels, | 336 kNumOutputChannels, |
337 kNumFrames, | 337 kNumFrames, |
338 kInitialDelay[i]); | 338 kInitialDelay[i]); |
339 } | 339 } |
340 } | 340 } |
341 | 341 |
342 } // namespace webrtc | 342 } // namespace webrtc |
OLD | NEW |