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

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

Issue 2996693002: iSAC fixed-point implementation of the Audio{En,De}coderFactoryTemplate APIs (Closed)
Patch Set: review comments Created 3 years, 4 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_encoder_factory_template_unittest.cc
diff --git a/webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc b/webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc
index 19c3071bef3d7b8a68519c83c9e9dcf440850298..4120978291aa408f8f7db74a82befec1a19e29b1 100644
--- a/webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc
+++ b/webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc
@@ -13,6 +13,7 @@
#include "webrtc/api/audio_codecs/g711/audio_encoder_g711.h"
#include "webrtc/api/audio_codecs/g722/audio_encoder_g722.h"
#include "webrtc/api/audio_codecs/ilbc/audio_encoder_ilbc.h"
+#include "webrtc/api/audio_codecs/isac/audio_encoder_isac_fix.h"
#include "webrtc/api/audio_codecs/opus/audio_encoder_opus.h"
#include "webrtc/rtc_base/ptr_util.h"
#include "webrtc/test/gmock.h"
@@ -171,6 +172,26 @@ TEST(AudioEncoderFactoryTemplateTest, Ilbc) {
EXPECT_EQ(8000, enc->SampleRateHz());
}
+TEST(AudioEncoderFactoryTemplateTest, IsacFix) {
+ auto factory = CreateAudioEncoderFactory<AudioEncoderIsacFix>();
+ EXPECT_THAT(factory->GetSupportedEncoders(),
+ testing::ElementsAre(AudioCodecSpec{
+ {"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}}));
+ EXPECT_EQ(rtc::Optional<AudioCodecInfo>(),
+ factory->QueryAudioEncoder({"isac", 16000, 2}));
+ EXPECT_EQ(rtc::Optional<AudioCodecInfo>({16000, 1, 32000, 10000, 32000}),
+ factory->QueryAudioEncoder({"isac", 16000, 1}));
+ EXPECT_EQ(nullptr, factory->MakeAudioEncoder(17, {"isac", 8000, 1}));
+ auto enc1 = factory->MakeAudioEncoder(17, {"isac", 16000, 1});
+ ASSERT_NE(nullptr, enc1);
+ EXPECT_EQ(16000, enc1->SampleRateHz());
+ EXPECT_EQ(3u, enc1->Num10MsFramesInNextPacket());
+ auto enc2 =
+ factory->MakeAudioEncoder(17, {"isac", 16000, 1, {{"ptime", "60"}}});
+ ASSERT_NE(nullptr, enc2);
+ EXPECT_EQ(6u, enc2->Num10MsFramesInNextPacket());
+}
+
TEST(AudioEncoderFactoryTemplateTest, L16) {
auto factory = CreateAudioEncoderFactory<AudioEncoderL16>();
EXPECT_THAT(

Powered by Google App Engine
This is Rietveld 408576698