Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: webrtc/voice_engine/test/auto_test/standard/codec_test.cc

Issue 2772773002: Adding cbr support for Opus (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/voice_engine/test/auto_test/standard/codec_test.cc
diff --git a/webrtc/voice_engine/test/auto_test/standard/codec_test.cc b/webrtc/voice_engine/test/auto_test/standard/codec_test.cc
index 2b5d12d8fd5f194b458047197d0ebe5837156e2c..a0e96e6235854a4bcfd3088eeb75db0508354529 100644
--- a/webrtc/voice_engine/test/auto_test/standard/codec_test.cc
+++ b/webrtc/voice_engine/test/auto_test/standard/codec_test.cc
@@ -174,6 +174,29 @@ TEST_F(CodecTest, OpusDtxCannotBeSetForNonOpus) {
}
}
+TEST_F(CodecTest, OpusCbrCanBeSetForOpus) {
+ for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) {
+ voe_codec_->GetCodec(i, codec_instance_);
+ if (STR_CASE_CMP("opus", codec_instance_.plname)) {
+ continue;
+ }
+ voe_codec_->SetSendCodec(channel_, codec_instance_);
+ EXPECT_EQ(0, voe_codec_->SetOpusCbr(channel_, false));
+ EXPECT_EQ(0, voe_codec_->SetOpusCbr(channel_, true));
+ }
+}
+
+TEST_F(CodecTest, OpusCbrCannotBeSetForNonOpus) {
+ for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) {
+ voe_codec_->GetCodec(i, codec_instance_);
+ if (!STR_CASE_CMP("opus", codec_instance_.plname)) {
+ continue;
+ }
+ voe_codec_->SetSendCodec(channel_, codec_instance_);
+ EXPECT_EQ(-1, voe_codec_->SetOpusCbr(channel_, true));
+ }
+}
+
// TODO(xians, phoglund): Re-enable when issue 372 is resolved.
TEST_F(CodecTest, DISABLED_ManualVerifySendCodecsForAllPacketSizes) {
for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698