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

Side by Side Diff: webrtc/voice_engine/test/auto_test/standard/codec_test.cc

Issue 2961723004: Allow an external audio processing module to be used in WebRTC (Closed)
Patch Set: Moved creation of APMs from CreateVoiceEngines 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) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 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 <stdio.h> 11 #include <stdio.h>
12 #include <string> 12 #include <string>
13 13
14 #include "webrtc/test/testsupport/fileutils.h" 14 #include "webrtc/test/testsupport/fileutils.h"
15 #include "webrtc/voice_engine/test/auto_test/fixtures/after_streaming_fixture.h" 15 #include "webrtc/voice_engine/test/auto_test/fixtures/after_streaming_fixture.h"
16 #include "webrtc/voice_engine/voice_engine_defines.h" 16 #include "webrtc/voice_engine/voice_engine_defines.h"
17 17
18 class CodecTest : public AfterStreamingFixture { 18 class CodecTest : public AfterStreamingFixture {
19 protected: 19 protected:
20 void SetUp() { 20 void SetUp() {
21 memset(&codec_instance_, 0, sizeof(codec_instance_)); 21 memset(&codec_instance_, 0, sizeof(codec_instance_));
22 apm_ = webrtc::AudioProcessing::Create();
23 voe_base_->Init(nullptr, apm_.get(), nullptr);
22 } 24 }
23 25
24 void SetArbitrarySendCodec() { 26 void SetArbitrarySendCodec() {
25 // Just grab the first codec. 27 // Just grab the first codec.
26 EXPECT_EQ(0, voe_codec_->GetCodec(0, codec_instance_)); 28 EXPECT_EQ(0, voe_codec_->GetCodec(0, codec_instance_));
27 EXPECT_EQ(0, voe_codec_->SetSendCodec(channel_, codec_instance_)); 29 EXPECT_EQ(0, voe_codec_->SetSendCodec(channel_, codec_instance_));
28 } 30 }
29 31
32 rtc::scoped_refptr<webrtc::AudioProcessing> apm_;
30 webrtc::CodecInst codec_instance_; 33 webrtc::CodecInst codec_instance_;
31 }; 34 };
32 35
33 static void SetRateIfILBC(webrtc::CodecInst* codec_instance, int packet_size) { 36 static void SetRateIfILBC(webrtc::CodecInst* codec_instance, int packet_size) {
34 if (!STR_CASE_CMP(codec_instance->plname, "ilbc")) { 37 if (!STR_CASE_CMP(codec_instance->plname, "ilbc")) {
35 if (packet_size == 160 || packet_size == 320) { 38 if (packet_size == 160 || packet_size == 320) {
36 codec_instance->rate = 15200; 39 codec_instance->rate = 15200;
37 } else { 40 } else {
38 codec_instance->rate = 13300; 41 codec_instance->rate = 13300;
39 } 42 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 TEST_LOG("%d ", packet_size); 207 TEST_LOG("%d ", packet_size);
205 TEST_LOG_FLUSH; 208 TEST_LOG_FLUSH;
206 at_least_one_succeeded = true; 209 at_least_one_succeeded = true;
207 Sleep(CODEC_TEST_TIME); 210 Sleep(CODEC_TEST_TIME);
208 } 211 }
209 } 212 }
210 TEST_LOG("\n"); 213 TEST_LOG("\n");
211 EXPECT_TRUE(at_least_one_succeeded); 214 EXPECT_TRUE(at_least_one_succeeded);
212 } 215 }
213 } 216 }
OLDNEW
« no previous file with comments | « webrtc/voice_engine/test/auto_test/fakes/conference_transport.cc ('k') | webrtc/voice_engine/voe_base_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698