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 <math.h> | 11 #include <math.h> |
12 #include <stdio.h> | 12 #include <stdio.h> |
13 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
| 14 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" |
14 #include "webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h" | 15 #include "webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h" |
15 #include "webrtc/modules/audio_coding/neteq/tools/output_audio_file.h" | 16 #include "webrtc/modules/audio_coding/neteq/tools/output_audio_file.h" |
16 #include "webrtc/modules/audio_coding/neteq/tools/output_wav_file.h" | 17 #include "webrtc/modules/audio_coding/neteq/tools/output_wav_file.h" |
17 #include "webrtc/modules/audio_coding/neteq/tools/resample_input_audio_file.h" | 18 #include "webrtc/modules/audio_coding/neteq/tools/resample_input_audio_file.h" |
18 #include "webrtc/test/testsupport/fileutils.h" | 19 #include "webrtc/test/testsupport/fileutils.h" |
19 | 20 |
20 using std::string; | 21 using std::string; |
21 | 22 |
22 namespace webrtc { | 23 namespace webrtc { |
23 namespace test { | 24 namespace test { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // Open a wav file. | 239 // Open a wav file. |
239 output_.reset( | 240 output_.reset( |
240 new webrtc::test::OutputWavFile(out_filename, 1000 * out_sampling_khz)); | 241 new webrtc::test::OutputWavFile(out_filename, 1000 * out_sampling_khz)); |
241 } else { | 242 } else { |
242 // Open a pcm file. | 243 // Open a pcm file. |
243 output_.reset(new webrtc::test::OutputAudioFile(out_filename)); | 244 output_.reset(new webrtc::test::OutputAudioFile(out_filename)); |
244 } | 245 } |
245 | 246 |
246 NetEq::Config config; | 247 NetEq::Config config; |
247 config.sample_rate_hz = out_sampling_khz_ * 1000; | 248 config.sample_rate_hz = out_sampling_khz_ * 1000; |
248 neteq_.reset(NetEq::Create(config)); | 249 neteq_.reset( |
| 250 NetEq::Create(config, webrtc::CreateBuiltinAudioDecoderFactory())); |
249 max_payload_bytes_ = in_size_samples_ * channels_ * sizeof(int16_t); | 251 max_payload_bytes_ = in_size_samples_ * channels_ * sizeof(int16_t); |
250 in_data_.reset(new int16_t[in_size_samples_ * channels_]); | 252 in_data_.reset(new int16_t[in_size_samples_ * channels_]); |
251 } | 253 } |
252 | 254 |
253 NetEqQualityTest::~NetEqQualityTest() { | 255 NetEqQualityTest::~NetEqQualityTest() { |
254 log_file_.close(); | 256 log_file_.close(); |
255 } | 257 } |
256 | 258 |
257 bool NoLoss::Lost() { | 259 bool NoLoss::Lost() { |
258 return false; | 260 return false; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 } | 428 } |
427 } | 429 } |
428 Log() << "Average bit rate was " | 430 Log() << "Average bit rate was " |
429 << 8.0f * total_payload_size_bytes_ / FLAGS_runtime_ms | 431 << 8.0f * total_payload_size_bytes_ / FLAGS_runtime_ms |
430 << " kbps" | 432 << " kbps" |
431 << std::endl; | 433 << std::endl; |
432 } | 434 } |
433 | 435 |
434 } // namespace test | 436 } // namespace test |
435 } // namespace webrtc | 437 } // namespace webrtc |
OLD | NEW |