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 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 EXPECT_EQ(0, voe_codec->GetOpusDtxStatus(channel, &DTX)); | 95 EXPECT_EQ(0, voe_codec->GetOpusDtxStatus(channel, &DTX)); |
96 EXPECT_TRUE(DTX); | 96 EXPECT_TRUE(DTX); |
97 | 97 |
98 base->DeleteChannel(channel); | 98 base->DeleteChannel(channel); |
99 base->Terminate(); | 99 base->Terminate(); |
100 base->Release(); | 100 base->Release(); |
101 voe_codec->Release(); | 101 voe_codec->Release(); |
102 VoiceEngine::Delete(voe); | 102 VoiceEngine::Delete(voe); |
103 } | 103 } |
104 | 104 |
| 105 TEST(VoECodecInst, SetOpusCbr) { |
| 106 VoiceEngine* voe(VoiceEngine::Create()); |
| 107 VoEBase* base(VoEBase::GetInterface(voe)); |
| 108 VoECodec* voe_codec(VoECodec::GetInterface(voe)); |
| 109 std::unique_ptr<FakeAudioDeviceModule> adm(new FakeAudioDeviceModule); |
| 110 |
| 111 base->Init(adm.get()); |
| 112 |
| 113 CodecInst codec = {111, "opus", 48000, 960, 1, 32000}; |
| 114 |
| 115 int channel = base->CreateChannel(); |
| 116 |
| 117 bool CBR = false; |
| 118 |
| 119 EXPECT_EQ(0, voe_codec->SetSendCodec(channel, codec)); |
| 120 EXPECT_EQ(0, voe_codec->SetOpusCbr(channel, true)); |
| 121 EXPECT_EQ(0, voe_codec->GetOpusCbrStatus(channel, &CBR)); |
| 122 EXPECT_TRUE(CBR); |
| 123 |
| 124 base->DeleteChannel(channel); |
| 125 base->Terminate(); |
| 126 base->Release(); |
| 127 voe_codec->Release(); |
| 128 VoiceEngine::Delete(voe); |
| 129 } |
| 130 |
105 } // namespace | 131 } // namespace |
106 } // namespace voe | 132 } // namespace voe |
107 } // namespace webrtc | 133 } // namespace webrtc |
OLD | NEW |