OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 "webrtc/modules/audio_coding/test/TestAllCodecs.h" | 11 #include "webrtc/modules/audio_coding/test/TestAllCodecs.h" |
12 | 12 |
13 #include <cstdio> | 13 #include <cstdio> |
14 #include <limits> | 14 #include <limits> |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "webrtc/common_types.h" | 17 #include "webrtc/common_types.h" |
| 18 #include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h" |
18 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 19 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
19 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" | 20 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" |
20 #include "webrtc/modules/audio_coding/test/utility.h" | 21 #include "webrtc/modules/audio_coding/test/utility.h" |
21 #include "webrtc/system_wrappers/include/trace.h" | 22 #include "webrtc/system_wrappers/include/trace.h" |
22 #include "webrtc/test/gtest.h" | 23 #include "webrtc/test/gtest.h" |
23 #include "webrtc/test/testsupport/fileutils.h" | 24 #include "webrtc/test/testsupport/fileutils.h" |
24 #include "webrtc/typedefs.h" | 25 #include "webrtc/typedefs.h" |
25 #include "webrtc/voice_engine_configurations.h" | 26 #include "webrtc/voice_engine_configurations.h" |
26 | 27 |
27 // Description of the test: | 28 // Description of the test: |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 acm_a_->InitializeReceiver(); | 135 acm_a_->InitializeReceiver(); |
135 acm_b_->InitializeReceiver(); | 136 acm_b_->InitializeReceiver(); |
136 | 137 |
137 uint8_t num_encoders = acm_a_->NumberOfCodecs(); | 138 uint8_t num_encoders = acm_a_->NumberOfCodecs(); |
138 CodecInst my_codec_param; | 139 CodecInst my_codec_param; |
139 for (uint8_t n = 0; n < num_encoders; n++) { | 140 for (uint8_t n = 0; n < num_encoders; n++) { |
140 acm_b_->Codec(n, &my_codec_param); | 141 acm_b_->Codec(n, &my_codec_param); |
141 if (!strcmp(my_codec_param.plname, "opus")) { | 142 if (!strcmp(my_codec_param.plname, "opus")) { |
142 my_codec_param.channels = 1; | 143 my_codec_param.channels = 1; |
143 } | 144 } |
144 acm_b_->RegisterReceiveCodec(my_codec_param); | 145 acm_b_->RegisterReceiveCodec(my_codec_param.pltype, |
| 146 CodecInstToSdp(my_codec_param)); |
145 } | 147 } |
146 | 148 |
147 // Create and connect the channel | 149 // Create and connect the channel |
148 channel_a_to_b_ = new TestPack; | 150 channel_a_to_b_ = new TestPack; |
149 acm_a_->RegisterTransportCallback(channel_a_to_b_); | 151 acm_a_->RegisterTransportCallback(channel_a_to_b_); |
150 channel_a_to_b_->RegisterReceiverACM(acm_b_.get()); | 152 channel_a_to_b_->RegisterReceiverACM(acm_b_.get()); |
151 | 153 |
152 // All codecs are tested for all allowed sampling frequencies, rates and | 154 // All codecs are tested for all allowed sampling frequencies, rates and |
153 // packet sizes. | 155 // packet sizes. |
154 #ifdef WEBRTC_CODEC_G722 | 156 #ifdef WEBRTC_CODEC_G722 |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 } | 483 } |
482 | 484 |
483 void TestAllCodecs::DisplaySendReceiveCodec() { | 485 void TestAllCodecs::DisplaySendReceiveCodec() { |
484 CodecInst my_codec_param; | 486 CodecInst my_codec_param; |
485 printf("%s -> ", acm_a_->SendCodec()->plname); | 487 printf("%s -> ", acm_a_->SendCodec()->plname); |
486 acm_b_->ReceiveCodec(&my_codec_param); | 488 acm_b_->ReceiveCodec(&my_codec_param); |
487 printf("%s\n", my_codec_param.plname); | 489 printf("%s\n", my_codec_param.plname); |
488 } | 490 } |
489 | 491 |
490 } // namespace webrtc | 492 } // namespace webrtc |
OLD | NEW |