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 |
| 11 #include "webrtc/voice_engine/channel_proxy.h" |
11 #include "webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixtu
re.h" | 12 #include "webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixtu
re.h" |
| 13 #include "webrtc/voice_engine/voice_engine_impl.h" |
12 | 14 |
13 class CodecBeforeStreamingTest : public AfterInitializationFixture { | 15 class CodecBeforeStreamingTest : public AfterInitializationFixture { |
14 protected: | 16 protected: |
15 void SetUp() { | 17 void SetUp() { |
16 memset(&codec_instance_, 0, sizeof(codec_instance_)); | 18 memset(&codec_instance_, 0, sizeof(codec_instance_)); |
17 codec_instance_.channels = 1; | 19 codec_instance_.channels = 1; |
18 codec_instance_.plfreq = 16000; | 20 codec_instance_.plfreq = 16000; |
19 codec_instance_.pacsize = 480; | 21 codec_instance_.pacsize = 480; |
20 | 22 |
21 channel_ = voe_base_->CreateChannel(); | 23 channel_ = voe_base_->CreateChannel(); |
| 24 static_cast<webrtc::VoiceEngineImpl*>(voice_engine_) |
| 25 ->GetChannelProxy(channel_) |
| 26 ->RegisterLegacyReceiveCodecs(); |
22 } | 27 } |
23 | 28 |
24 void TearDown() { | 29 void TearDown() { |
25 voe_base_->DeleteChannel(channel_); | 30 voe_base_->DeleteChannel(channel_); |
26 } | 31 } |
27 | 32 |
28 webrtc::CodecInst codec_instance_; | 33 webrtc::CodecInst codec_instance_; |
29 int channel_; | 34 int channel_; |
30 }; | 35 }; |
31 | 36 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 EXPECT_EQ(0, voe_codec_->GetRecPayloadType(channel_, codec_instance_)); | 79 EXPECT_EQ(0, voe_codec_->GetRecPayloadType(channel_, codec_instance_)); |
75 | 80 |
76 EXPECT_EQ(123, codec_instance_.pltype); | 81 EXPECT_EQ(123, codec_instance_.pltype); |
77 | 82 |
78 codec_instance_.pltype = original_pltype; | 83 codec_instance_.pltype = original_pltype; |
79 EXPECT_EQ(0, voe_codec_->SetRecPayloadType(channel_, codec_instance_)); | 84 EXPECT_EQ(0, voe_codec_->SetRecPayloadType(channel_, codec_instance_)); |
80 EXPECT_EQ(0, voe_codec_->GetRecPayloadType(channel_, codec_instance_)); | 85 EXPECT_EQ(0, voe_codec_->GetRecPayloadType(channel_, codec_instance_)); |
81 | 86 |
82 EXPECT_EQ(original_pltype, codec_instance_.pltype); | 87 EXPECT_EQ(original_pltype, codec_instance_.pltype); |
83 } | 88 } |
OLD | NEW |