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

Unified Diff: webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus_unittest.cc

Issue 2772773002: Adding cbr support for Opus (Closed)
Patch Set: Updated after review feedback 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/modules/audio_coding/codecs/opus/audio_encoder_opus_unittest.cc
diff --git a/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus_unittest.cc b/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus_unittest.cc
index 1d4fc2e7813c9c3b2eee1bc6596be2ace20e47f6..ab307ac59efd6636590b9dbbfa1e4e47be5664a3 100644
--- a/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus_unittest.cc
+++ b/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus_unittest.cc
@@ -182,6 +182,16 @@ TEST(AudioEncoderOpusTest, ToggleDtx) {
EXPECT_TRUE(states.encoder->SetDtx(false));
}
+TEST(AudioEncoderOpusTest, ToggleCbr) {
+ auto states = CreateCodec(2);
+ // Enable CBR
+ EXPECT_TRUE(states.encoder->SetCbr(true));
+ // Verify that the mode is still kAudio.
+ EXPECT_EQ(AudioEncoderOpus::kAudio, states.encoder->application());
minyue-webrtc 2017/03/30 20:36:17 please don't check application here, (see above co
+ // Turn off CBR.
+ EXPECT_TRUE(states.encoder->SetCbr(false));
+}
+
TEST(AudioEncoderOpusTest,
OnReceivedUplinkBandwidthWithoutAudioNetworkAdaptor) {
auto states = CreateCodec(1);

Powered by Google App Engine
This is Rietveld 408576698