Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(644)

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_stereo_unittest.cc

Issue 1992763002: Moved injection of AudioDecoderFactory into voe::Channel. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@audio-decoder-factory-injections-1
Patch Set: Addressed nit. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 // Test to verify correct stereo and multi-channel operation. 11 // Test to verify correct stereo and multi-channel operation.
12 12
13 #include <algorithm> 13 #include <algorithm>
14 #include <memory> 14 #include <memory>
15 #include <string> 15 #include <string>
16 #include <list> 16 #include <list>
17 17
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h"
19 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h" 20 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h"
20 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" 21 #include "webrtc/modules/audio_coding/neteq/include/neteq.h"
21 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" 22 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h"
22 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" 23 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h"
23 #include "webrtc/modules/include/module_common_types.h" 24 #include "webrtc/modules/include/module_common_types.h"
24 #include "webrtc/test/testsupport/fileutils.h" 25 #include "webrtc/test/testsupport/fileutils.h"
25 26
26 namespace webrtc { 27 namespace webrtc {
27 28
28 struct TestParameters { 29 struct TestParameters {
(...skipping 27 matching lines...) Expand all
56 static_cast<size_t>(frame_size_ms_ * samples_per_ms_)), 57 static_cast<size_t>(frame_size_ms_ * samples_per_ms_)),
57 output_size_samples_(10 * samples_per_ms_), 58 output_size_samples_(10 * samples_per_ms_),
58 rtp_generator_mono_(samples_per_ms_), 59 rtp_generator_mono_(samples_per_ms_),
59 rtp_generator_(samples_per_ms_), 60 rtp_generator_(samples_per_ms_),
60 payload_size_bytes_(0), 61 payload_size_bytes_(0),
61 multi_payload_size_bytes_(0), 62 multi_payload_size_bytes_(0),
62 last_send_time_(0), 63 last_send_time_(0),
63 last_arrival_time_(0) { 64 last_arrival_time_(0) {
64 NetEq::Config config; 65 NetEq::Config config;
65 config.sample_rate_hz = sample_rate_hz_; 66 config.sample_rate_hz = sample_rate_hz_;
66 neteq_mono_ = NetEq::Create(config); 67 rtc::scoped_refptr<AudioDecoderFactory> factory =
67 neteq_ = NetEq::Create(config); 68 CreateBuiltinAudioDecoderFactory();
69 neteq_mono_ = NetEq::Create(config, factory);
70 neteq_ = NetEq::Create(config, factory);
68 input_ = new int16_t[frame_size_samples_]; 71 input_ = new int16_t[frame_size_samples_];
69 encoded_ = new uint8_t[2 * frame_size_samples_]; 72 encoded_ = new uint8_t[2 * frame_size_samples_];
70 input_multi_channel_ = new int16_t[frame_size_samples_ * num_channels_]; 73 input_multi_channel_ = new int16_t[frame_size_samples_ * num_channels_];
71 encoded_multi_channel_ = new uint8_t[frame_size_samples_ * 2 * 74 encoded_multi_channel_ = new uint8_t[frame_size_samples_ * 2 *
72 num_channels_]; 75 num_channels_];
73 } 76 }
74 77
75 ~NetEqStereoTest() { 78 ~NetEqStereoTest() {
76 delete neteq_mono_; 79 delete neteq_mono_;
77 delete neteq_; 80 delete neteq_;
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 427
425 INSTANTIATE_TEST_CASE_P(MultiChannel, 428 INSTANTIATE_TEST_CASE_P(MultiChannel,
426 NetEqStereoTestDelays, 429 NetEqStereoTestDelays,
427 ::testing::ValuesIn(GetTestParameters())); 430 ::testing::ValuesIn(GetTestParameters()));
428 431
429 INSTANTIATE_TEST_CASE_P(MultiChannel, 432 INSTANTIATE_TEST_CASE_P(MultiChannel,
430 NetEqStereoTestLosses, 433 NetEqStereoTestLosses,
431 ::testing::ValuesIn(GetTestParameters())); 434 ::testing::ValuesIn(GetTestParameters()));
432 435
433 } // namespace webrtc 436 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc ('k') | webrtc/modules/audio_coding/neteq/neteq_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698