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

Side by Side 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: fuzzer test updated Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "webrtc/api/audio_codecs/audio_decoder_factory_template.h" 11 #include "webrtc/api/audio_codecs/audio_decoder_factory_template.h"
12 #include "webrtc/api/audio_codecs/g722/audio_decoder_g722.h" 12 #include "webrtc/api/audio_codecs/g722/audio_decoder_g722.h"
13 #include "webrtc/api/audio_codecs/ilbc/audio_decoder_ilbc.h"
13 #include "webrtc/base/ptr_util.h" 14 #include "webrtc/base/ptr_util.h"
14 #include "webrtc/test/gmock.h" 15 #include "webrtc/test/gmock.h"
15 #include "webrtc/test/gtest.h" 16 #include "webrtc/test/gtest.h"
16 #include "webrtc/test/mock_audio_decoder.h" 17 #include "webrtc/test/mock_audio_decoder.h"
17 18
18 namespace webrtc { 19 namespace webrtc {
19 20
20 namespace { 21 namespace {
21 22
22 struct BogusParams { 23 struct BogusParams {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 EXPECT_EQ(16000, dec1->SampleRateHz()); 125 EXPECT_EQ(16000, dec1->SampleRateHz());
125 EXPECT_EQ(1u, dec1->Channels()); 126 EXPECT_EQ(1u, dec1->Channels());
126 auto dec2 = factory->MakeAudioDecoder({"g722", 8000, 2}); 127 auto dec2 = factory->MakeAudioDecoder({"g722", 8000, 2});
127 ASSERT_NE(nullptr, dec2); 128 ASSERT_NE(nullptr, dec2);
128 EXPECT_EQ(16000, dec2->SampleRateHz()); 129 EXPECT_EQ(16000, dec2->SampleRateHz());
129 EXPECT_EQ(2u, dec2->Channels()); 130 EXPECT_EQ(2u, dec2->Channels());
130 auto dec3 = factory->MakeAudioDecoder({"g722", 8000, 3}); 131 auto dec3 = factory->MakeAudioDecoder({"g722", 8000, 3});
131 ASSERT_EQ(nullptr, dec3); 132 ASSERT_EQ(nullptr, dec3);
132 } 133 }
133 134
135 TEST(AudioDecoderFactoryTemplateTest, Ilbc) {
136 auto factory = CreateAudioDecoderFactory<AudioDecoderIlbc>();
137 EXPECT_THAT(factory->GetSupportedDecoders(),
138 testing::ElementsAre(
139 AudioCodecSpec{{"ILBC", 8000, 1}, {8000, 1, 13300}}));
140 EXPECT_FALSE(factory->IsSupportedDecoder({"foo", 8000, 1}));
141 EXPECT_TRUE(factory->IsSupportedDecoder({"ilbc", 8000, 1}));
142 EXPECT_EQ(nullptr, factory->MakeAudioDecoder({"bar", 8000, 1}));
143 auto dec = factory->MakeAudioDecoder({"ilbc", 8000, 1});
144 ASSERT_NE(nullptr, dec);
145 EXPECT_EQ(8000, dec->SampleRateHz());
146 }
147
134 } // namespace webrtc 148 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/audio_codecs/test/BUILD.gn ('k') | webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698