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

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

Issue 2388153004: Stop using old AudioCodingModule::RegisterReceiveCodec overloads (Closed)
Patch Set: rebase Created 4 years, 2 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 #include <assert.h> 11 #include <assert.h>
12 #include <math.h> 12 #include <math.h>
13 13
14 #include <iostream> 14 #include <iostream>
15 #include <memory> 15 #include <memory>
16 16
17 #include "gflags/gflags.h" 17 #include "gflags/gflags.h"
18 #include "webrtc/common_types.h" 18 #include "webrtc/common_types.h"
19 #include "webrtc/modules/audio_coding/acm2/acm_common_defs.h" 19 #include "webrtc/modules/audio_coding/acm2/acm_common_defs.h"
20 #include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h"
20 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" 21 #include "webrtc/modules/audio_coding/include/audio_coding_module.h"
21 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" 22 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h"
22 #include "webrtc/modules/audio_coding/test/Channel.h" 23 #include "webrtc/modules/audio_coding/test/Channel.h"
23 #include "webrtc/modules/audio_coding/test/PCMFile.h" 24 #include "webrtc/modules/audio_coding/test/PCMFile.h"
24 #include "webrtc/modules/audio_coding/test/utility.h" 25 #include "webrtc/modules/audio_coding/test/utility.h"
25 #include "webrtc/system_wrappers/include/event_wrapper.h" 26 #include "webrtc/system_wrappers/include/event_wrapper.h"
26 #include "webrtc/test/gtest.h" 27 #include "webrtc/test/gtest.h"
27 #include "webrtc/test/testsupport/fileutils.h" 28 #include "webrtc/test/testsupport/fileutils.h"
28 #include "webrtc/voice_engine_configurations.h" 29 #include "webrtc/voice_engine_configurations.h"
29 30
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 "Failed to get codec."; 101 "Failed to get codec.";
101 if (STR_CASE_CMP(my_codec_param.plname, "opus") == 0) 102 if (STR_CASE_CMP(my_codec_param.plname, "opus") == 0)
102 my_codec_param.channels = 1; 103 my_codec_param.channels = 1;
103 else if (my_codec_param.channels > 1) 104 else if (my_codec_param.channels > 1)
104 continue; 105 continue;
105 if (STR_CASE_CMP(my_codec_param.plname, "CN") == 0 && 106 if (STR_CASE_CMP(my_codec_param.plname, "CN") == 0 &&
106 my_codec_param.plfreq == 48000) 107 my_codec_param.plfreq == 48000)
107 continue; 108 continue;
108 if (STR_CASE_CMP(my_codec_param.plname, "telephone-event") == 0) 109 if (STR_CASE_CMP(my_codec_param.plname, "telephone-event") == 0)
109 continue; 110 continue;
110 ASSERT_EQ(0, acm_b_->RegisterReceiveCodec(my_codec_param)) << 111 ASSERT_EQ(true,
111 "Couldn't register receive codec.\n"; 112 acm_b_->RegisterReceiveCodec(my_codec_param.pltype,
113 CodecInstToSdp(my_codec_param)));
112 } 114 }
113 115
114 // Create and connect the channel 116 // Create and connect the channel
115 ASSERT_EQ(0, acm_a_->RegisterTransportCallback(channel_a2b_)) << 117 ASSERT_EQ(0, acm_a_->RegisterTransportCallback(channel_a2b_)) <<
116 "Couldn't register Transport callback.\n"; 118 "Couldn't register Transport callback.\n";
117 channel_a2b_->RegisterReceiverACM(acm_b_.get()); 119 channel_a2b_->RegisterReceiverACM(acm_b_.get());
118 } 120 }
119 121
120 void Perform(const TestSettings* config, size_t num_tests, int duration_sec, 122 void Perform(const TestSettings* config, size_t num_tests, int duration_sec,
121 const char* output_prefix) { 123 const char* output_prefix) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 test_setting.codec.num_channels = FLAGS_num_channels; 260 test_setting.codec.num_channels = FLAGS_num_channels;
259 test_setting.acm.dtx = FLAGS_dtx; 261 test_setting.acm.dtx = FLAGS_dtx;
260 test_setting.acm.fec = FLAGS_fec; 262 test_setting.acm.fec = FLAGS_fec;
261 test_setting.packet_loss = FLAGS_packet_loss; 263 test_setting.packet_loss = FLAGS_packet_loss;
262 264
263 webrtc::DelayTest delay_test; 265 webrtc::DelayTest delay_test;
264 delay_test.Initialize(); 266 delay_test.Initialize();
265 delay_test.Perform(&test_setting, 1, 240, "delay_test"); 267 delay_test.Perform(&test_setting, 1, 240, "delay_test");
266 return 0; 268 return 0;
267 } 269 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698