OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 26 matching lines...) Expand all Loading... |
37 // This test modifies the DTMF payload type from the default 106 to 88 | 37 // This test modifies the DTMF payload type from the default 106 to 88 |
38 // and then runs through 16 DTMF out.of-band events. | 38 // and then runs through 16 DTMF out.of-band events. |
39 TEST_F(DtmfTest, ManualCanChangeDtmfPayloadType) { | 39 TEST_F(DtmfTest, ManualCanChangeDtmfPayloadType) { |
40 webrtc::CodecInst codec_instance = webrtc::CodecInst(); | 40 webrtc::CodecInst codec_instance = webrtc::CodecInst(); |
41 | 41 |
42 TEST_LOG("Changing DTMF payload type.\n"); | 42 TEST_LOG("Changing DTMF payload type.\n"); |
43 | 43 |
44 // Start by modifying the receiving side. | 44 // Start by modifying the receiving side. |
45 for (int i = 0; i < voe_codec_->NumOfCodecs(); i++) { | 45 for (int i = 0; i < voe_codec_->NumOfCodecs(); i++) { |
46 EXPECT_EQ(0, voe_codec_->GetCodec(i, codec_instance)); | 46 EXPECT_EQ(0, voe_codec_->GetCodec(i, codec_instance)); |
47 if (!_stricmp("telephone-event", codec_instance.plname)) { | 47 if (!STR_CASE_CMP("telephone-event", codec_instance.plname)) { |
48 codec_instance.pltype = 88; // Use 88 instead of default 106. | 48 codec_instance.pltype = 88; // Use 88 instead of default 106. |
49 EXPECT_EQ(0, voe_base_->StopSend(channel_)); | 49 EXPECT_EQ(0, voe_base_->StopSend(channel_)); |
50 EXPECT_EQ(0, voe_base_->StopPlayout(channel_)); | 50 EXPECT_EQ(0, voe_base_->StopPlayout(channel_)); |
51 EXPECT_EQ(0, voe_codec_->SetRecPayloadType(channel_, codec_instance)); | 51 EXPECT_EQ(0, voe_codec_->SetRecPayloadType(channel_, codec_instance)); |
52 EXPECT_EQ(0, voe_base_->StartPlayout(channel_)); | 52 EXPECT_EQ(0, voe_base_->StartPlayout(channel_)); |
53 EXPECT_EQ(0, voe_base_->StartSend(channel_)); | 53 EXPECT_EQ(0, voe_base_->StartSend(channel_)); |
54 break; | 54 break; |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 Sleep(500); | 58 Sleep(500); |
59 | 59 |
60 // Next, we must modify the sending side as well. | 60 // Next, we must modify the sending side as well. |
61 EXPECT_TRUE( | 61 EXPECT_TRUE( |
62 channel_proxy_->SetSendTelephoneEventPayloadType(codec_instance.pltype, | 62 channel_proxy_->SetSendTelephoneEventPayloadType(codec_instance.pltype, |
63 codec_instance.plfreq)); | 63 codec_instance.plfreq)); |
64 | 64 |
65 RunSixteenDtmfEvents(); | 65 RunSixteenDtmfEvents(); |
66 } | 66 } |
OLD | NEW |