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 #include "media/filters/audio_file_reader.h" | 5 #include "media/filters/audio_file_reader.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/md5.h" | 11 #include "base/md5.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "media/base/audio_bus.h" | 13 #include "media/base/audio_bus.h" |
14 #include "media/base/audio_hash.h" | 14 #include "media/base/audio_hash.h" |
15 #include "media/base/decoder_buffer.h" | 15 #include "media/base/decoder_buffer.h" |
16 #include "media/base/test_data_util.h" | 16 #include "media/base/test_data_util.h" |
17 #include "media/ffmpeg/ffmpeg_common.h" | 17 #include "media/ffmpeg/ffmpeg_common.h" |
18 #include "media/filters/in_memory_url_protocol.h" | 18 #include "media/filters/in_memory_url_protocol.h" |
19 #include "media/media_features.h" | |
20 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
21 | 20 |
22 namespace media { | 21 namespace media { |
23 | 22 |
24 class AudioFileReaderTest : public testing::Test { | 23 class AudioFileReaderTest : public testing::Test { |
25 public: | 24 public: |
26 AudioFileReaderTest() : packet_verification_disabled_(false) {} | 25 AudioFileReaderTest() : packet_verification_disabled_(false) {} |
27 ~AudioFileReaderTest() override {} | 26 ~AudioFileReaderTest() override {} |
28 | 27 |
29 void Initialize(const char* filename) { | 28 void Initialize(const char* filename) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 TEST_F(AudioFileReaderTest, WaveF32LE) { | 192 TEST_F(AudioFileReaderTest, WaveF32LE) { |
194 RunTest("sfx_f32le.wav", | 193 RunTest("sfx_f32le.wav", |
195 "3.03,2.86,2.99,3.31,3.57,4.06,", | 194 "3.03,2.86,2.99,3.31,3.57,4.06,", |
196 1, | 195 1, |
197 44100, | 196 44100, |
198 base::TimeDelta::FromMicroseconds(288414), | 197 base::TimeDelta::FromMicroseconds(288414), |
199 12720, | 198 12720, |
200 12719); | 199 12719); |
201 } | 200 } |
202 | 201 |
203 #if BUILDFLAG(USE_PROPRIETARY_CODECS) | 202 #if defined(USE_PROPRIETARY_CODECS) |
204 TEST_F(AudioFileReaderTest, MP3) { | 203 TEST_F(AudioFileReaderTest, MP3) { |
205 RunTest("sfx.mp3", | 204 RunTest("sfx.mp3", |
206 "1.30,2.72,4.56,5.08,3.74,2.03,", | 205 "1.30,2.72,4.56,5.08,3.74,2.03,", |
207 1, | 206 1, |
208 44100, | 207 44100, |
209 base::TimeDelta::FromMicroseconds(313470), | 208 base::TimeDelta::FromMicroseconds(313470), |
210 13825, | 209 13825, |
211 11025); | 210 11025); |
212 } | 211 } |
213 | 212 |
(...skipping 28 matching lines...) Expand all Loading... |
242 RunTest("4ch.wav", | 241 RunTest("4ch.wav", |
243 "131.71,38.02,130.31,44.89,135.98,42.52,", | 242 "131.71,38.02,130.31,44.89,135.98,42.52,", |
244 4, | 243 4, |
245 44100, | 244 44100, |
246 base::TimeDelta::FromMicroseconds(100001), | 245 base::TimeDelta::FromMicroseconds(100001), |
247 4411, | 246 4411, |
248 4410); | 247 4410); |
249 } | 248 } |
250 | 249 |
251 } // namespace media | 250 } // namespace media |
OLD | NEW |