OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // The format of these tests are to enqueue a known amount of data and then | 5 // The format of these tests are to enqueue a known amount of data and then |
6 // request the exact amount we expect in order to dequeue the known amount of | 6 // request the exact amount we expect in order to dequeue the known amount of |
7 // data. This ensures that for any rate we are consuming input data at the | 7 // data. This ensures that for any rate we are consuming input data at the |
8 // correct rate. We always pass in a very large destination buffer with the | 8 // correct rate. We always pass in a very large destination buffer with the |
9 // expectation that FillBuffer() will fill as much as it can but no more. | 9 // expectation that FillBuffer() will fill as much as it can but no more. |
10 | 10 |
| 11 #include <stddef.h> |
| 12 #include <stdint.h> |
| 13 |
11 #include <algorithm> // For std::min(). | 14 #include <algorithm> // For std::min(). |
12 #include <cmath> | 15 #include <cmath> |
13 #include <vector> | 16 #include <vector> |
14 | 17 |
15 #include "base/bind.h" | 18 #include "base/bind.h" |
16 #include "base/callback.h" | 19 #include "base/callback.h" |
| 20 #include "base/macros.h" |
17 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
18 #include "media/base/audio_buffer.h" | 22 #include "media/base/audio_buffer.h" |
19 #include "media/base/audio_bus.h" | 23 #include "media/base/audio_bus.h" |
20 #include "media/base/channel_layout.h" | 24 #include "media/base/channel_layout.h" |
21 #include "media/base/test_helpers.h" | 25 #include "media/base/test_helpers.h" |
22 #include "media/base/timestamp_constants.h" | 26 #include "media/base/timestamp_constants.h" |
23 #include "media/filters/audio_renderer_algorithm.h" | 27 #include "media/filters/audio_renderer_algorithm.h" |
24 #include "media/filters/wsola_internals.h" | 28 #include "media/filters/wsola_internals.h" |
25 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
26 | 30 |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 const int frames_filled = | 670 const int frames_filled = |
667 algorithm_.FillBuffer(bus.get(), kHalfSize, kHalfSize, kMutedRates[i]); | 671 algorithm_.FillBuffer(bus.get(), kHalfSize, kHalfSize, kMutedRates[i]); |
668 ASSERT_EQ(kHalfSize, frames_filled); | 672 ASSERT_EQ(kHalfSize, frames_filled); |
669 ASSERT_FALSE(VerifyAudioData(bus.get(), 0, kHalfSize, 0)); | 673 ASSERT_FALSE(VerifyAudioData(bus.get(), 0, kHalfSize, 0)); |
670 ASSERT_TRUE(VerifyAudioData(bus.get(), kHalfSize, kHalfSize, 0)); | 674 ASSERT_TRUE(VerifyAudioData(bus.get(), kHalfSize, kHalfSize, 0)); |
671 FillAlgorithmQueue(); | 675 FillAlgorithmQueue(); |
672 } | 676 } |
673 } | 677 } |
674 | 678 |
675 } // namespace media | 679 } // namespace media |
OLD | NEW |