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

Side by Side Diff: webrtc/modules/audio_coding/main/test/delay_test.cc

Issue 1421013006: Delete a chain of methods in ViE, VoE and ACM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month 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
(...skipping 15 matching lines...) Expand all
26 #include "webrtc/modules/audio_coding/main/test/PCMFile.h" 26 #include "webrtc/modules/audio_coding/main/test/PCMFile.h"
27 #include "webrtc/modules/audio_coding/main/test/utility.h" 27 #include "webrtc/modules/audio_coding/main/test/utility.h"
28 #include "webrtc/system_wrappers/include/event_wrapper.h" 28 #include "webrtc/system_wrappers/include/event_wrapper.h"
29 #include "webrtc/test/testsupport/fileutils.h" 29 #include "webrtc/test/testsupport/fileutils.h"
30 30
31 DEFINE_string(codec, "isac", "Codec Name"); 31 DEFINE_string(codec, "isac", "Codec Name");
32 DEFINE_int32(sample_rate_hz, 16000, "Sampling rate in Hertz."); 32 DEFINE_int32(sample_rate_hz, 16000, "Sampling rate in Hertz.");
33 DEFINE_int32(num_channels, 1, "Number of Channels."); 33 DEFINE_int32(num_channels, 1, "Number of Channels.");
34 DEFINE_string(input_file, "", "Input file, PCM16 32 kHz, optional."); 34 DEFINE_string(input_file, "", "Input file, PCM16 32 kHz, optional.");
35 DEFINE_int32(delay, 0, "Delay in millisecond."); 35 DEFINE_int32(delay, 0, "Delay in millisecond.");
36 DEFINE_int32(init_delay, 0, "Initial delay in millisecond.");
37 DEFINE_bool(dtx, false, "Enable DTX at the sender side."); 36 DEFINE_bool(dtx, false, "Enable DTX at the sender side.");
38 DEFINE_bool(packet_loss, false, "Apply packet loss, c.f. Channel{.cc, .h}."); 37 DEFINE_bool(packet_loss, false, "Apply packet loss, c.f. Channel{.cc, .h}.");
39 DEFINE_bool(fec, false, "Use Forward Error Correction (FEC)."); 38 DEFINE_bool(fec, false, "Use Forward Error Correction (FEC).");
40 39
41 namespace webrtc { 40 namespace webrtc {
42 41
43 namespace { 42 namespace {
44 43
45 struct CodecSettings { 44 struct CodecSettings {
46 char name[50]; 45 char name[50];
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 test_cntr_ = 0; 81 test_cntr_ = 0;
83 std::string file_name = webrtc::test::ResourcePath( 82 std::string file_name = webrtc::test::ResourcePath(
84 "audio_coding/testfile32kHz", "pcm"); 83 "audio_coding/testfile32kHz", "pcm");
85 if (FLAGS_input_file.size() > 0) 84 if (FLAGS_input_file.size() > 0)
86 file_name = FLAGS_input_file; 85 file_name = FLAGS_input_file;
87 in_file_a_.Open(file_name, 32000, "rb"); 86 in_file_a_.Open(file_name, 32000, "rb");
88 ASSERT_EQ(0, acm_a_->InitializeReceiver()) << 87 ASSERT_EQ(0, acm_a_->InitializeReceiver()) <<
89 "Couldn't initialize receiver.\n"; 88 "Couldn't initialize receiver.\n";
90 ASSERT_EQ(0, acm_b_->InitializeReceiver()) << 89 ASSERT_EQ(0, acm_b_->InitializeReceiver()) <<
91 "Couldn't initialize receiver.\n"; 90 "Couldn't initialize receiver.\n";
92 if (FLAGS_init_delay > 0) {
93 ASSERT_EQ(0, acm_b_->SetInitialPlayoutDelay(FLAGS_init_delay)) <<
94 "Failed to set initial delay.\n";
95 }
96 91
97 if (FLAGS_delay > 0) { 92 if (FLAGS_delay > 0) {
98 ASSERT_EQ(0, acm_b_->SetMinimumPlayoutDelay(FLAGS_delay)) << 93 ASSERT_EQ(0, acm_b_->SetMinimumPlayoutDelay(FLAGS_delay)) <<
99 "Failed to set minimum delay.\n"; 94 "Failed to set minimum delay.\n";
100 } 95 }
101 96
102 int num_encoders = acm_a_->NumberOfCodecs(); 97 int num_encoders = acm_a_->NumberOfCodecs();
103 CodecInst my_codec_param; 98 CodecInst my_codec_param;
104 for (int n = 0; n < num_encoders; n++) { 99 for (int n = 0; n < num_encoders; n++) {
105 EXPECT_EQ(0, acm_b_->Codec(n, &my_codec_param)) << 100 EXPECT_EQ(0, acm_b_->Codec(n, &my_codec_param)) <<
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 "Failed to set RED.\n"; 160 "Failed to set RED.\n";
166 } 161 }
167 162
168 void ConfigChannel(bool packet_loss) { 163 void ConfigChannel(bool packet_loss) {
169 channel_a2b_->SetFECTestWithPacketLoss(packet_loss); 164 channel_a2b_->SetFECTestWithPacketLoss(packet_loss);
170 } 165 }
171 166
172 void OpenOutFile(const char* output_id) { 167 void OpenOutFile(const char* output_id) {
173 std::stringstream file_stream; 168 std::stringstream file_stream;
174 file_stream << "delay_test_" << FLAGS_codec << "_" << FLAGS_sample_rate_hz 169 file_stream << "delay_test_" << FLAGS_codec << "_" << FLAGS_sample_rate_hz
175 << "Hz" << "_" << FLAGS_init_delay << "ms_" << FLAGS_delay << "ms.pcm"; 170 << "Hz" << "_" << FLAGS_delay << "ms.pcm";
176 std::cout << "Output file: " << file_stream.str() << std::endl << std::endl; 171 std::cout << "Output file: " << file_stream.str() << std::endl << std::endl;
177 std::string file_name = webrtc::test::OutputPath() + file_stream.str(); 172 std::string file_name = webrtc::test::OutputPath() + file_stream.str();
178 out_file_b_.Open(file_name.c_str(), 32000, "wb"); 173 out_file_b_.Open(file_name.c_str(), 32000, "wb");
179 } 174 }
180 175
181 void Run(int duration_sec, const char* output_prefix) { 176 void Run(int duration_sec, const char* output_prefix) {
182 OpenOutFile(output_prefix); 177 OpenOutFile(output_prefix);
183 AudioFrame audio_frame; 178 AudioFrame audio_frame;
184 uint32_t out_freq_hz_b = out_file_b_.SamplingFrequency(); 179 uint32_t out_freq_hz_b = out_file_b_.SamplingFrequency();
185 180
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 test_setting.codec.num_channels = FLAGS_num_channels; 256 test_setting.codec.num_channels = FLAGS_num_channels;
262 test_setting.acm.dtx = FLAGS_dtx; 257 test_setting.acm.dtx = FLAGS_dtx;
263 test_setting.acm.fec = FLAGS_fec; 258 test_setting.acm.fec = FLAGS_fec;
264 test_setting.packet_loss = FLAGS_packet_loss; 259 test_setting.packet_loss = FLAGS_packet_loss;
265 260
266 webrtc::DelayTest delay_test; 261 webrtc::DelayTest delay_test;
267 delay_test.Initialize(); 262 delay_test.Initialize();
268 delay_test.Perform(&test_setting, 1, 240, "delay_test"); 263 delay_test.Perform(&test_setting, 1, 240, "delay_test");
269 return 0; 264 return 0;
270 } 265 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698