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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) { | 167 for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) { |
168 voe_codec_->GetCodec(i, codec_instance_); | 168 voe_codec_->GetCodec(i, codec_instance_); |
169 if (!STR_CASE_CMP("opus", codec_instance_.plname)) { | 169 if (!STR_CASE_CMP("opus", codec_instance_.plname)) { |
170 continue; | 170 continue; |
171 } | 171 } |
172 voe_codec_->SetSendCodec(channel_, codec_instance_); | 172 voe_codec_->SetSendCodec(channel_, codec_instance_); |
173 EXPECT_EQ(-1, voe_codec_->SetOpusDtx(channel_, true)); | 173 EXPECT_EQ(-1, voe_codec_->SetOpusDtx(channel_, true)); |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
| 177 TEST_F(CodecTest, OpusCbrCanBeSetForOpus) { |
| 178 for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) { |
| 179 voe_codec_->GetCodec(i, codec_instance_); |
| 180 if (STR_CASE_CMP("opus", codec_instance_.plname)) { |
| 181 continue; |
| 182 } |
| 183 voe_codec_->SetSendCodec(channel_, codec_instance_); |
| 184 EXPECT_EQ(0, voe_codec_->SetOpusCbr(channel_, false)); |
| 185 EXPECT_EQ(0, voe_codec_->SetOpusCbr(channel_, true)); |
| 186 } |
| 187 } |
| 188 |
| 189 TEST_F(CodecTest, OpusCbrCannotBeSetForNonOpus) { |
| 190 for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) { |
| 191 voe_codec_->GetCodec(i, codec_instance_); |
| 192 if (!STR_CASE_CMP("opus", codec_instance_.plname)) { |
| 193 continue; |
| 194 } |
| 195 voe_codec_->SetSendCodec(channel_, codec_instance_); |
| 196 EXPECT_EQ(-1, voe_codec_->SetOpusCbr(channel_, true)); |
| 197 } |
| 198 } |
| 199 |
177 // TODO(xians, phoglund): Re-enable when issue 372 is resolved. | 200 // TODO(xians, phoglund): Re-enable when issue 372 is resolved. |
178 TEST_F(CodecTest, DISABLED_ManualVerifySendCodecsForAllPacketSizes) { | 201 TEST_F(CodecTest, DISABLED_ManualVerifySendCodecsForAllPacketSizes) { |
179 for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) { | 202 for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) { |
180 voe_codec_->GetCodec(i, codec_instance_); | 203 voe_codec_->GetCodec(i, codec_instance_); |
181 if (IsNotViableSendCodec(codec_instance_.plname)) { | 204 if (IsNotViableSendCodec(codec_instance_.plname)) { |
182 TEST_LOG("Skipping %s.\n", codec_instance_.plname); | 205 TEST_LOG("Skipping %s.\n", codec_instance_.plname); |
183 continue; | 206 continue; |
184 } | 207 } |
185 EXPECT_NE(-1, codec_instance_.pltype) << | 208 EXPECT_NE(-1, codec_instance_.pltype) << |
186 "The codec database should suggest a payload type."; | 209 "The codec database should suggest a payload type."; |
(...skipping 17 matching lines...) Expand all Loading... |
204 TEST_LOG("%d ", packet_size); | 227 TEST_LOG("%d ", packet_size); |
205 TEST_LOG_FLUSH; | 228 TEST_LOG_FLUSH; |
206 at_least_one_succeeded = true; | 229 at_least_one_succeeded = true; |
207 Sleep(CODEC_TEST_TIME); | 230 Sleep(CODEC_TEST_TIME); |
208 } | 231 } |
209 } | 232 } |
210 TEST_LOG("\n"); | 233 TEST_LOG("\n"); |
211 EXPECT_TRUE(at_least_one_succeeded); | 234 EXPECT_TRUE(at_least_one_succeeded); |
212 } | 235 } |
213 } | 236 } |
OLD | NEW |