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

Unified Diff: webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc

Issue 2951873002: Expose ILBC codec in webrtc/api/audio_codecs/ (Closed)
Patch Set: Fix tests Created 3 years, 6 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/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc
diff --git a/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc b/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc
index c05fcd6e2f6078ce6334b86a482d3e78dfc7e1fc..283a5f5e67bac1bfcf3e72f83d61ce34615e415a 100644
--- a/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc
+++ b/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc
@@ -10,6 +10,7 @@
#include "webrtc/api/audio_codecs/audio_decoder_factory_template.h"
#include "webrtc/api/audio_codecs/g722/audio_decoder_g722.h"
+#include "webrtc/api/audio_codecs/ilbc/audio_decoder_ilbc.h"
#include "webrtc/base/ptr_util.h"
#include "webrtc/test/gmock.h"
#include "webrtc/test/gtest.h"
@@ -131,4 +132,17 @@ TEST(AudioDecoderFactoryTemplateTest, G722) {
ASSERT_EQ(nullptr, dec3);
}
+TEST(AudioDecoderFactoryTemplateTest, Ilbc) {
+ auto factory = CreateAudioDecoderFactory<AudioDecoderIlbc>();
+ EXPECT_THAT(factory->GetSupportedDecoders(),
+ testing::ElementsAre(
+ AudioCodecSpec{{"ILBC", 8000, 1}, {8000, 1, 13300}}));
the sun 2017/06/27 12:07:19 What do you think about bitrate being 13300 here a
kwiberg-webrtc 2017/06/27 12:50:43 I hadn't caught that, actually. For the decoder,
ossu 2017/06/27 12:53:14 Hmm... acm_codec_database.cc claims that it's 1330
+ EXPECT_FALSE(factory->IsSupportedDecoder({"foo", 8000, 1}));
+ EXPECT_TRUE(factory->IsSupportedDecoder({"ilbc", 8000, 1}));
+ EXPECT_EQ(nullptr, factory->MakeAudioDecoder({"bar", 8000, 1}));
+ auto dec = factory->MakeAudioDecoder({"ilbc", 8000, 1});
+ ASSERT_NE(nullptr, dec);
+ EXPECT_EQ(8000, dec->SampleRateHz());
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698