OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "media/base/audio_buffer.h" | 6 #include "media/base/audio_buffer.h" |
7 #include "media/base/audio_buffer_converter.h" | 7 #include "media/base/audio_buffer_converter.h" |
8 #include "media/base/sinc_resampler.h" | 8 #include "media/base/sinc_resampler.h" |
9 #include "media/base/test_helpers.h" | 9 #include "media/base/test_helpers.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 ChannelLayout channel_layout, | 22 ChannelLayout channel_layout, |
23 int channel_count, | 23 int channel_count, |
24 int frames) { | 24 int frames) { |
25 return MakeAudioBuffer<uint8>(kSampleFormatU8, | 25 return MakeAudioBuffer<uint8>(kSampleFormatU8, |
26 channel_layout, | 26 channel_layout, |
27 channel_count, | 27 channel_count, |
28 sample_rate, | 28 sample_rate, |
29 0, | 29 0, |
30 1, | 30 1, |
31 frames, | 31 frames, |
32 base::TimeDelta::FromSeconds(0), | |
33 base::TimeDelta::FromSeconds(0)); | 32 base::TimeDelta::FromSeconds(0)); |
34 } | 33 } |
35 | 34 |
36 class AudioBufferConverterTest : public ::testing::Test { | 35 class AudioBufferConverterTest : public ::testing::Test { |
37 public: | 36 public: |
38 AudioBufferConverterTest() | 37 AudioBufferConverterTest() |
39 : input_frames_(0), | 38 : input_frames_(0), |
40 expected_output_frames_(0.0), | 39 expected_output_frames_(0.0), |
41 output_frames_(0), | 40 output_frames_(0), |
42 output_params_(AudioParameters::AUDIO_PCM_LOW_LATENCY, | 41 output_params_(AudioParameters::AUDIO_PCM_LOW_LATENCY, |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 246 |
248 // Since the input buffer size is a multiple of the input request size there | 247 // Since the input buffer size is a multiple of the input request size there |
249 // should never be any frames remaining at this point. | 248 // should never be any frames remaining at this point. |
250 ASSERT_EQ(kInputFrameSize % | 249 ASSERT_EQ(kInputFrameSize % |
251 audio_buffer_converter_->input_buffer_size_for_testing(), | 250 audio_buffer_converter_->input_buffer_size_for_testing(), |
252 0); | 251 0); |
253 EXPECT_EQ(0, audio_buffer_converter_->input_frames_left_for_testing()); | 252 EXPECT_EQ(0, audio_buffer_converter_->input_frames_left_for_testing()); |
254 } | 253 } |
255 | 254 |
256 } // namespace media | 255 } // namespace media |
OLD | NEW |