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

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

Issue 3001483002: iSAC floating-point implementation of the Audio{En,De}coderFactoryTemplate APIs (Closed)
Patch Set: rebase 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_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 d49817feb9820f1a9c074155b980766d2d9f315c..b10b19eb4662ce61e16589c80e9ae2e86c21460c 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
@@ -14,6 +14,7 @@
#include "webrtc/api/audio_codecs/g722/audio_decoder_g722.h"
#include "webrtc/api/audio_codecs/ilbc/audio_decoder_ilbc.h"
#include "webrtc/api/audio_codecs/isac/audio_decoder_isac_fix.h"
+#include "webrtc/api/audio_codecs/isac/audio_decoder_isac_float.h"
#include "webrtc/api/audio_codecs/opus/audio_decoder_opus.h"
#include "webrtc/rtc_base/ptr_util.h"
#include "webrtc/test/gmock.h"
@@ -174,12 +175,32 @@ TEST(AudioDecoderFactoryTemplateTest, IsacFix) {
{"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}}));
EXPECT_FALSE(factory->IsSupportedDecoder({"isac", 16000, 2}));
EXPECT_TRUE(factory->IsSupportedDecoder({"isac", 16000, 1}));
+ EXPECT_FALSE(factory->IsSupportedDecoder({"isac", 32000, 1}));
EXPECT_EQ(nullptr, factory->MakeAudioDecoder({"isac", 8000, 1}));
auto dec = factory->MakeAudioDecoder({"isac", 16000, 1});
ASSERT_NE(nullptr, dec);
EXPECT_EQ(16000, dec->SampleRateHz());
}
+TEST(AudioDecoderFactoryTemplateTest, IsacFloat) {
+ auto factory = CreateAudioDecoderFactory<AudioDecoderIsacFloat>();
+ EXPECT_THAT(
+ factory->GetSupportedDecoders(),
+ testing::ElementsAre(
+ AudioCodecSpec{{"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}},
+ AudioCodecSpec{{"ISAC", 32000, 1}, {32000, 1, 56000, 10000, 56000}}));
+ EXPECT_FALSE(factory->IsSupportedDecoder({"isac", 16000, 2}));
+ EXPECT_TRUE(factory->IsSupportedDecoder({"isac", 16000, 1}));
+ EXPECT_TRUE(factory->IsSupportedDecoder({"isac", 32000, 1}));
+ EXPECT_EQ(nullptr, factory->MakeAudioDecoder({"isac", 8000, 1}));
+ auto dec1 = factory->MakeAudioDecoder({"isac", 16000, 1});
+ ASSERT_NE(nullptr, dec1);
+ EXPECT_EQ(16000, dec1->SampleRateHz());
+ auto dec2 = factory->MakeAudioDecoder({"isac", 32000, 1});
+ ASSERT_NE(nullptr, dec2);
+ EXPECT_EQ(32000, dec2->SampleRateHz());
+}
+
TEST(AudioDecoderFactoryTemplateTest, L16) {
auto factory = CreateAudioDecoderFactory<AudioDecoderL16>();
EXPECT_THAT(

Powered by Google App Engine
This is Rietveld 408576698